Author |
Topic |
Deleted
deleted
4116 Posts |
Posted - 20 April 2001 : 14:41:20
|
<font color=red><b>Please make sure you also read this discussion</b></font id=red> === Hi everybody,
We made a long chat session with Mike on the method of implementing internationalisation (Int. hereafter). We decided to share the ideas with you and get your opinions. Below I also suggest a workplan. <font color=red>This post will be updated </font id=red> whenever needed. Please refer to the section when posting replies. Please do not volunteer for translation in this topic. It would be advisable to send different topics under this forum with title "WORKGROUP: ITALIAN" etc. Mike please correct me if something is missing.
<b> ============================================ PRELIMINARY INFO: ============================================ </b> 1. There are around 1000 strings (inc. future extensions, excluding admin sections) 2. Average English string length is around 23 chars (data from my previous translation of v3.0)
<b> ============================================ Challenges to meet and design criteria (DC): ============================================ </b> <i>This section also includes some solution ideas. So feel free to criticise them and/or suggest better ones.</i>
<b>DC1. Multiple language support:</b> The forum will include all current translations. Admin will enable some of them for a specific forum implementation. Users will be able to select among the admin enabled languages. Admin will be capable of selecting a default language. If the user does not prefer one, the default will be the active language. All these preference selections will be made online (in admin section and in the user profile). It will be good if the admin code checks the existence of files, similar to mods.
<b>DC2. Place of Translated Strings:</b> Either files (.asp or .js) or one-time-use (server start-up) database table entries. Files will have a format similar to these (assuming they are includes): inc_lang01.asp, inc_lang90.js, etc. It will be a good idea to keep them in a separate subfolder.
<b>DC3. Database and Speed Considerations:</b> Very few database access is essential. The solution must make maximum benefit from cache (both server and client browser).
<b>DC4. Server Memory Considerations:</b> Server memory should not be overloaded (e.g. with N different language strings). Use of session variables is not desired.
<b>DC5. Place of Preferences:</b> Admin preferences can be kept in the database, whereas user preferences can be kept in cookies (and/or database like in "last visited date")
<b>DC6. File Sizes:</b> Includes and (transferred) file sizes must be kept minimal. There must be one include for a language selection (if any).
<b>DC7. Flexibility and Reliability:</b> Method should be easy to extend in the future (new versions, MODs, etc). A web based translation interface would make it more flexible and reliable. Otherwise typos and quotation marks will result in hard-to-find errors (especially in JavaScript). The results can be kept in database tables and can also be used to implement ASP code to "pre-compile" inc_lang files with write-into-file's. Whenever a new mode and/or file module is added, the setup will upgrade the table, leaving the translators fewer (and foolproof) work.
<b> ============================================ DIFFERENT APPROACHES TO BE CONSIDERED (APP#): ============================================ </b> <b>APPROACH 1 : FULL ASP</b>
<b>APPROACH 1a : FULL ASP WITH INCLUDES</b> One file (hardcoded) will be #include'd in config.asp (best place) as the language file. The file contains variable definitions <font color=red>PROS:</font id=red> The easiest approach. Only one include (probably from cache) will speed up. Approach in DC7 can also be used for flexibility. <font color=red>CONS:</font id=red> Against part of DC1: Only single language supported, so also DC5 is obsolate. File size bigger (ASP sends the result). <font color=red>NOTE:</font id=red> This is not flexible enough, so probably this will not be used
<b>APPROACH 1b : FULL ASP WITH APPLICATION OBJECT</b> The data will be read into the application variables in config.asp, the actual code will use it like: <font color=blue>response.write application("strLangHello")</font id=blue>. The data can be kept in the database or in separate files. Either way there is the chance to support multiple concurrent languages (e.g. strLang01Hello for English, strLang90Hello for Turkish etc), and the code will be like <font color=blue>response.write application("strLang" & strUserLangPreference & "Hello")</font id=blue>. <font color=red>PROS:</font id=red> Support for multiple languages. <font color=red>CONS:</font id=red> Against DC4: Needs server memory. File size bigger (ASP sends the result).
<b>APPROACH 2 : USE OF JavaScript (JS) FILES</b> The data will be in .JS files. Whenever the user starts to use it, it will be loaded into the browser chace and will be used from there on following pages. The actual code will use it using <script> tags and document.write's. Again there is the chance to support multiple concurrent languages as above. <font color=red>PROS:</font id=red> Support for multiple languages. No extra server memory needed. Part of the process takes on client, so less server CPU time needed. <font color=red>CONS:</font id=red> Harder to code (?), strong debugging period needed. Client cache problems if language files change on server (need to keep versions?). Browser compatibility issues must be addressed. Browser must be enabled for script execution. Speed can be problematic on slow clients.
<b> ============================================ QUESTIONS TO BE ANSWERED (Q#): ============================================ </b> Q1. Which approach? Why? Q2. Where to keep the non-volatile data (strings in all languages, when server is down): File or database table(s)? Q3. Where to keep the volatile data (strings in selected languages, on the run)? Application object (server memory), file (server side include), JavaScript file (loaded once into users browsers' cache)? Q4. Where to keep the user preferences: Database or cookie? Q5. Other concepts/ideas I forgot to mention
<b> ============================================ TIME PLAN (Q#): ============================================ </b> While we are talking on the method, We'll do the following:
01. Implement an example for each approach (me, 1 day) 02. Compare them by running benchmarks (render time, file size, ...). (me, 1 day, I'll run on , PWS locally, and from Internet on IIS 5 using 56K dial-up. This is what I can do from home) 03. Share the results here (me, same day) 04. Collect all strings from the files, put them into an excel table (me, say 10 days except admin files) 05. Decide on the method (all of us, same period) 06. Convert the data to desired format, translate into Turkish for being ready to test (me, 2 days) 07. Make the following updates in the files (me, 5 days): a) Change of strings to variables b) Change of html code to response writes c) Test the result internally (alpha test) 09. Implementation of cookie and admin related code just after step 5 (volunteers needed) 10. Publish alpha release with the original language file, so that everybody starts to translate 11. Put the forum files on a test site, and global beta testing (all of us). This site will be upgraded with your language files. (Here I suggest: people native to a language form a team, only one translates, the others tests the results and suggests better phrases etc) 12. Correct and release (step 10-12: 10 days)
After this (or just after step 10): Int. of MODs!!! (MOD writer's)
Totals 30 days
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2001 20:58:57
Edited by - bozden on 21 April 2001 15:00:55
Edited by - bozden on 18 May 2001 10:12:00
Edited by - bozden on 20 April 2002 08:53:15 |
|
bea
Starting Member
2 Posts |
Posted - 21 April 2001 : 03:53:34
|
Hello what about the users messages, because even if all the forum strings are translated in any language, user will still post in their language. So what about generating the ASP pages in the desired language at forum installation time [ or later ] . no javascript or multiple include files needed. Strings can be stored in a database or file and you can generate as many languages as you want. it makes multiple source files but it is easy to maintain as they are automatically generated. by adding a field for language code in the forum tables , multiples forums in several languages could be handled whitout multiplying tables.
It is just a suggestion and for sure must have many "against" reasons ...
< |
|
|
marc
Junior Member
Belgium
175 Posts |
Posted - 21 April 2001 : 07:43:33
|
quote:
We made a long chat session with Mike on the method of implementing internationalisation
Great news !
quote:
Q1. Which approach? Why?
Approach 1b "FULL ASP WITH APPLICATION OBJECT" Because support multiple concurrent languages is a must and loading the language strings once is beter.
quote: Q2. Where to keep the non-volatile data: File or database table(s)?
I prefear in tables. An admin module could be created to edit strings and add new languages.
quote: Q3. Where to keep the volatile data? Application object (server memory), file (server side include), JavaScript file (loaded once into users browsers' cache)?
Application or Session object is beter.
quote: Q4. Where to keep the user preferences: Database or cookie?
The language option should be stored in the users table. It is part of the Profile.
quote: Q5. Other concepts/ideas I forgot to mention
If is important to create for each language a team to have one "official" Snitz language file per existing language.
This sounds great !
Marc Valentin < |
|
|
marc
Junior Member
Belgium
175 Posts |
Posted - 21 April 2001 : 07:48:50
|
quote:
So what about generating the ASP pages in the desired language at forum installation time [ or later ] . (...) multiples forums in several languages could be handled whitout multiplying tables.
What you are talking about is not a multi-language forum but a system to translate a software. It is something static. I think a dynamic system is beter even if there is some performance problem.
Marc Valentin < |
|
|
Deleted
deleted
4116 Posts |
Posted - 21 April 2001 : 10:31:07
|
Bea, welcome to the forums.
quote:
what about the users messages, because even if all the forum strings are translated in any language, user will still post in their language.
We don't speak of an online translation of webpages. There are some websites trying this. But a good question is: Q: Why do we need multiple simultaneous language support? A: (One answer at least) You can devide the forum categories into languages. Say if it is an international/multilanguage software, the support site can be devided into English, German, etc categories. Each user then gets in the desired subcategory, even if he/she does not understand text in the other categories. Just an idea...
quote:
So what about generating the ASP pages in the desired language at forum installation time [ or later ].
We need to have a highly configurable dynamic system. Take the previous example. The company suddenly decides to support German also. You should be doing this on the fly while online (in the admin mode!). No need to create files, no need to FTP... FTP will be needed ofcourse if you add a new translation add-on.
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 21 April 2001 10:44:21
Edited by - bozden on 20 April 2002 08:56:58< |
|
|
Deleted
deleted
4116 Posts |
Posted - 21 April 2001 : 10:40:34
|
marc,
Thank you for answering. FYI I will not comment on answers to questions. But if new ideas, questions or wrong directions exist in an answer, I'll answer too.
quote:
quote: Q3. Where to keep the volatile data? Application object (server memory), file (server side include), JavaScript file (loaded once into users browsers' cache)?
Application or Session object is beter.
With volatile data I meant, the language strings itself (%99). So session object (per user!) is out of question
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2002 09:00:37< |
|
|
bea
Starting Member
2 Posts |
Posted - 21 April 2001 : 11:09:50
|
quote:
We need to have a highly configurable dynamic system. Take the previous example. The company suddenly decides to support German also. You should be doing this on the fly while online (in the admin mode!). No need to create files, no need to FTP... FTP will be needed ofcourse if you add a new translation add-on.
hello I was not talking about FTP changes, but using the FileSystemObject you could create the german version [in your example] online in the admin section ... anyway it was just a suggestion...
< |
|
|
Morpheus73
Average Member
Denmark
597 Posts |
Posted - 21 April 2001 : 11:53:34
|
Most users of Snitz are not big companies (due to the "price" of snitz ;o)), so I don´t think multilanguage support is needed, maybe in some countries, that have different ethnic groups a.s.f., but that can be done with a multiple forums solution.
- however, I think the translations should be databaseadministered with an admin interface, since many users of Snitz are not coders or anything like that, so administration should be simple. Maybe the simplifying the strings in the code could be an solution to size problems
e.g. "Post updated", "new topic posted", "profile edited" a.s.f. could be just plain "Action complete - please wait..." or "updated", "posted" a.s.f.?
Well those where just a couple of my perpsectives, but here is my REAL issue with this post...
The system should in any order be MOD- COMPATIBLE, so that all the cool mod programmers have the best way of adding translations of their mods to the integrated translation system.
MPH73
< |
|
|
Deleted
deleted
4116 Posts |
Posted - 21 April 2001 : 12:27:51
|
I'll second these...
quote:
e.g. "Post updated", "new topic posted", "profile edited" a.s.f. could be just plain "Action complete - please wait..." or "updated", "posted" a.s.f.?
The system should in any order be MOD- COMPATIBLE, so that all the cool mod programmers have the best way of adding translations of their mods to the integrated translation system.
But, till now I felt that "there is a choice of friendliness using natural language", and these are the results. The reason may be just: "the original code is not designed to support multi languages".
For the MOD's, the mode programmers or other co-programmers will use the same methodology to insert new data into database tables (I think): * If a phrase is already defined in the dictionary, it can be used as is. * If there is a new phrase, then DB INSERT is needed.
Problems: * Use of same type of translation (choice of words etc) * Hard to keep versions! Versions of Snitz, versions of MOD's supporting a particular Snitz version, and language definitions for each MOD version. Hard to keep track on.
I think we can define a formal method by extending the MOD Commander methodology. It's better to concentrate on the five questions. Others will depent on the technique chosen. < |
|
|
inworg
Junior Member
Italy
153 Posts |
Posted - 23 April 2001 : 05:54:56
|
Ok, I'm already working, for my personal use, with a great system: use of "extra tags". It's simple, fast, and fully personalizable!
Inside HTML use:
<P><TRANSL><DET 1>Hallo </DET 1><%=Rs.Fields("Name")%>,<DET 2> have a nice day!</DET 2></P></TRANSL> Tags <TRANS> and <DET n> are used with a Table of Conversion (TOC) to replace the strings in another language BEFORE test it. If u need to use the original language simply replace the part of string that starts with <TRANSL and <DET with and finish with > with a null value. Of course this system requires an external program... that is now in alfa test but I can't share 'cause in VB... registered by my Boss , but if u want to know some sourcecode... ok
Edited by - inworg on 23 April 2001 05:59:16< |
|
|
Marino
Starting Member
Canary Islands
42 Posts |
Posted - 23 April 2001 : 07:17:11
|
I wonder if any solution has take in mind the problem of the place of a parameter inside diferent translations.
For example, translating to spanish
View <%=rs.Fields("Name")%>'s links
Ver enlaces de <%=rs.Fields("Name")%>
Well, one choice is to build the sentence in another way in which we have something like Part1 DBParameter Part2 which can lead to non natural sentences
Or we can define translations like "View" = "Ver enlaces de" "'s links" = ""
which make us to have a lot of translations for "View" depending of what do you want to view and a waste of space to keep empty translations.
Marino < |
|
|
Deleted
deleted
4116 Posts |
|
inworg
Junior Member
Italy
153 Posts |
Posted - 23 April 2001 : 10:19:32
|
Bozen and Marino... You're right but if u analize the sentence (using a program) ONLY between the <DET n> tags u've a single sentence to analize and translate using the TOC. Eg. <P><TRANSL><DET 1>Hallo </DET 1><%=Rs.Fields("Name")%>,<DET 2> have a nice day!</DET 2></TRANSL></P> May be considered: Hallo , have a nice day! and using a character (Eg. #) it's possible to insert other code. Eg. Hallo #, have a nice day! becomes Hallo <%=Rs.Fields("Name")%>, have a nice day! and Hallo, have a nice day #! Becomes Hallo, have a nice day <%=Rs.Fields("Name")%>! and so on. Even using the same tags in my messagge above. Simple & fast
Of course is needed to keep simple each sentence (max 2-3 breaks and calling # respectively #1 #2 #3), so translating ONLY the TOC I think in few minutes (Downloading the TOC) the translation is ready.
Keeping a TOC for each language, in future versions of Forum & MODs will be needed to change only the new sentences.
Considering the TOC an alternating of ENGLISH/OTHERLANGUAGE Code, an exaple may be the following:
<TRANSL><DET 1>Hallo </DET 1><%=Rs.Fields("Name")%>,<DET 2> have a nice day!</DET 2></TRANSL> Hallo #, have a nice day!
or in another language
<TRANSL><DET 1>Hallo </DET 1><%=Rs.Fields("Name")%>,<DET 2> have a nice day!</DET 2></TRANSL> Hallo, have a nice day #!
This is an example "ENGLISH-ENGLISH" but it's just to give an idea on how it works
Edited by - inworg on 23 April 2001 11:34:59< |
|
|
pweighill
Junior Member
United Kingdom
453 Posts |
Posted - 23 April 2001 : 17:35:51
|
What about formatting the strings as: blah blah _1_singular text_plural text_1_ blah %1% blah blah
Which would allow for singular and pluralised forms of the sentences.
e.g "You have %1% message_1__s_1_. -> "You have 1 message." or "You have 2 messages."
strLangForumPosts = "The _1_forum has_forums have_1_ %1% post_1__s_1_ by %2% user_2__s_2_." Response.Write TranslateString(strLangForumPosts, Array("100", "5"))
Function TranslateString(pstrMsg, pvarValues) Dim strLook Dim L Dim varValue Dim intCounter Dim strOut Dim strBit Dim i Dim j Dim k
intCounter = 0 strOut = pstrMsg For Each varValue In pvarValues intCounter = intCounter + 1 strLook = "%" & intCounter & "%" L = Len(strLook) Do i = InStr(1, strOut, strLook) If i = 0 Then Exit Do strOut = Left(strOut, i - 1) & varValue & Mid(strOut, i + L) Loop strLook = "_" & intCounter & "_" Do i = InStr(1, strOut, strLook) If i = 0 Then Exit Do j = InStr(i + 1, strOut, strLook) If j = 0 Then Exit Do strBit = Mid(strOut, i + L, j - i - L) k = InStr(1, strBit, "_") If k = 0 Then Exit Do If "" & varValue = "1" Then strOut = Left(strOut, i - 1) & Left(strBit, k - 1) & Mid(strOut, j + L) Else strOut = Left(strOut, i - 1) & Mid(strBit, k + 1) & Mid(strOut, j + L) End If Loop Next TranslateString = strOut End Function
< |
|
|
Marino
Starting Member
Canary Islands
42 Posts |
Posted - 23 April 2001 : 20:43:53
|
quote:
DC1. Multiple language support: The forum will include all current translations. Admin will enable some of them for a specific forum implementation. Users will be able to select among the admin enabled languages. Admin will be capable of selecting a default language. If the user does not prefer one, the default will be the active language. All these preference selections will be made online (in admin section and in the user profile). It will be good if the admin code checks the existence of files, similar to mods.
APPROACH 1 : FULL ASP
APPROACH 1a : FULL ASP WITH INCLUDES One file (hardcoded) will be #include'd in config.asp (best place) as the language file. The file contains variable definitions PROS: The easiest approach. Only one include (probably from cache) will speed up. Approach in DC7 can also be used for flexibility. CONS: Against part of DC1: Only single language supported, so also DC5 is obsolate. File size bigger (ASP sends the result). NOTE: This is not flexible enough, so probably this will not be used
There is an approach that can solve problems with 1a
file: languages.asp
<% intNumLanguages = 3 ' number of languages active
EN = 1 ' English ES = 2 ' Spanish DE = 3 ' German
redim hello(intNumLanguages) redim bye(intNumLanguages) redim profile(intNumLanguages) ... ... %> <--#INCLUDE FILE=langEN.asp--> <--#INCLUDE FILE=langES.asp--> <--#INCLUDE FILE=langDE.asp-->
-- end of languages.asp
file langEN.asp:
<% hello(EN) = "Hello" bye(EN) = "Bye" profile(EN) = "profile" .... %>
end of langEN.asp
file langES.asp
<% hello(ES) = "Hola" bye(ES) = "Adios" profile(ES) = "perfil" ... %>
end of langES.asp
So, user language can be stored in cookie, and you can use
<--#ICNLUDE FILE=languages.asp--> <% Response.Write Hello(intUserLanguage) Response.Write Bye(intUserLanguage)
Other advantage of this method is that language workgroups can maintain their own language file
Marino < |
|
|
Marino
Starting Member
Canary Islands
42 Posts |
Posted - 23 April 2001 : 20:56:27
|
As soon as I finished writing the post as thought in a better way
language.asp:
check for user language preference cookie <% select case intUserLanguage case 1 %> <!--#include langEN.asp--> <% case 2 %> <!--#include langES.asp--> <% case else %> <!--#include langEN.asp--> <%end select %>
and the language files now dont need to be arrays langEN: hello="Hello" bye="Bye"
langES: hello="Hola" bye="Adios"
Mixing this approach with inborg's solution about paramaters I think is a solution to consider.
Marino < |
|
|
Topic |
|
|
|