Author |
Topic |
inworg
Junior Member
Italy
153 Posts |
Posted - 24 April 2001 : 02:16:47
|
I apologize but I think there is a no-sense in DC1. Why an user that don't know a language (EG. English) has to choose to have all commands EG. in Italian? The Posted Messages are always in English! Which is the sense of let to choose a language to a user when the contents of the forum are in another language? Well I think that if a forum borns in english all the forum must be in english and the same for the other languages. It's also possible to think that each Topic may have a different language so i suggest the use of redirection system to include only the needed file for translation. It's hard for a server to load eg. 8 languages and compile it, 'cause using the above method (case + cookies) even ALL the include files must me loaded and then copiled in memory BEFORE execute ASP... just for using ONLY ONE of them!!! A better approach I think is to use a system like this:
Keep a Cookie or a Session to store the language profile then: a) use a Language-file that #includes the code instead Code that #includes language file (seem the same thing, eh?) b) use a redirection file and, like Marino's idea,: check for user language preference cookie <% select case intUserLanguage case 1 %> Response.Redirect "langEN.asp" <% case 2 %> Response.Redirect "langES.asp" <% case else %> Response.Redirect "langEN.asp" <%end select %>
and so on.
Well, keep in mind that
File: FileCodeEN.Asp
<!-- #include FileLangES --> Code
or
File: FileCodeES.Asp
Code Strings <!-- #include FileLangEN -->
are the SAME thing but this code let us the power to use redirection system.
To pweighill: quote: 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."
Keep in mind that using singular or plural sentences means that also in EN language u have a dual-string system so, using your example: blah blah _1_singular text_plural text_1_ blah %1% blah blah becomes <TRANSL> "You have %1% <DET 1>message.</DET 1><DET 2>messages.</DET 2></TRANSL>"
Remeber that this code, using my system, MUST be "pre-processed" by Admin BEFORE use it On-Line.
Edited by - inworg on 24 April 2001 02:22:08< |
|
|
Deleted
deleted
4116 Posts |
Posted - 24 April 2001 : 11:49:53
|
Friends,
Although better managed, includes are slow! The results of real-world performance test results prove them. (Sorry I'm late, but I'll share the results this week)
Marino, multiple includes with if-then-else is the worst way. As said, the first thing the server does is to include all of them.
Inworg, sorry... I didn't understand your redirection idea. Please check if my reasoning is correct or not: 1. You'll keep variables of languages in include files (like in APP#1) 2. As almost every file in forum directory have strings, you will include a file (you're calling it redirection file). This code will redirect you to some langXX.asp file.
Q: What then? How will it come back to (say) active.asp? What if for security reasons the browser disables automatic redirection? Is the redirection a slow or fast process?
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2002 09:08:19< |
|
|
inworg
Junior Member
Italy
153 Posts |
Posted - 24 April 2001 : 12:14:49
|
Right Bozden, I apologize for by bad english...
Let me show an example:
U're in page Default.Asp and have to go (using a link) to page "Topic.asp" If u're logged u've a cookie that keeps the ID-Language Well, the page "Topic.Asp" isn't the "real" page... it checks the value of the Cookie-language and redirects to Topic_EN.Asp or Topic_ES.Asp or Topic_IT.Asp, as needed. Third step: Topic_XX.Asp is structured as follow
LangString01 LangString02 LangString03 ............ <!-- include Topic_CODE.Asp -->
where topic code is the present file "Topic.Asp"
About the speed of redirection: connecting directly on a server using remote port 80, the server sends only 4 lines of http code. About the security... redirection system is enabled in all browsers tha can see hosts with IP-Shared domains (HTTP1.0)... as I know.
Edited by - inworg on 24 April 2001 12:21:03< |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 04 May 2001 : 13:56:57
|
Response.Redirect is no good... What your doing there is just forwarding to the language file and leaving the existing page (let me know if I'm missing something).
From the options that Boz showed us in his first post here...
1.a and 1.b are guarenteed for one langue only.
1.b has potential for two and maby... if you have a decent server three... but you'll be very hard pressed to get more in it without hiting performance badly.
2. Gives full support for as many languages as the webmaster wants, but then you end up requiring JavaScript to be enabled on the client machine. Reason: The client machine will be the one parsing the code and presenting it to the end user. It can be not so safely said that most of our users are already using JavaScript, and that if they want to use the new version, they would have to enable it if they arn't already.
Ruled out methods: 1. Storing values in database and calling them directly from the database on each page load. (to system intensive, not an option)
2. Changing text in all ASP pages by search and replace by the user wanting internationalization. (to much to ask of end users, not an option)
Anyone else have a 3rd realistic option that differes from the three (1.a 1.b and 2) that boz presented? Please share.
There are major benefits to method 2, but it does have a drawback... if the end user does not have Javascript... they can not use the forum.
Course, thinking out loud here... we could hard code the english version into the forum code itself... and place it in <noscript> tags... so if the end user does not have javascript support, the <noscript> shows the english version... but if they have javascript enabled... they get the options and ability to view in their native language (since with this approach you can make available the entire language library)... heck... for us US people, we could make a seperate language file for each state in the union with state specific slang if you wanted to using this method.
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a< |
|
|
Deleted
deleted
4116 Posts |
Posted - 04 May 2001 : 16:22:18
|
Welcome Back Mike
You forgot to mention that its not easy to convert the code in option 2. To be able users translate/adopt the language files, you also need to keep the data in DB and write an interface. Also hard to cope with quotes (actually I hate JS he he)... But you're right, its most challenged and better method.
Let me continue your last thoughts: 1. We need to keep the strings in DB for easy translation etc. From there we can also create langXX.JS files (offline). 2. In a way we keep a user controllable flag (preference) for JS or ASP, which defaults to "JS" (from cookie). 3. So instead of "hardcoded" english data, we can use application object approach, use a function to display strings, either with your <NOSCRIPT> tag. Example
in xxx.asp files:
response.write DisplayLangStr("lang0017") & intNumTopics & DisplayLangStr("lang0001")
which is supposed to output: "There are 3 topics"
in inc_functions.asp (or a better place?): (in pseudo code)
function DisplayLangStr(strID) if (isUserEnabledJS) then response.write "<script> .... </script>" else response.write application(strID & strUserdefinedLanguageCode) end if end function
What we gain: * For users (must be members? - most hits) with JS, we gain server speed as they will be using JS * We also enable all visitors the default forum language (can be any supported, admin defined one) * We also enable JS disabled people.
We have some extra JS commands in hand. Such as navigator.javaEnabled (compatibility: NN3, IE4) navigator.language (NN4) navigator.browserLanguage (IE4) navigator.systemLanguage (IE4) navigator.userLanguage (IE4) navigator.preference (name [,value]) (NN4)
No way to access scripting settings under security (IE). I didn't use any of them before, but probably these can be used if JS is to be used.
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2002 09:03:46< |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 07 May 2001 : 13:14:01
|
Sounds like you have some great ideas to add Boz! But I disagree on your very first point ... it is very easy for the end users to create a custom Language file! And your idea of incorporating the default language into the server memeory is outstanding... and takes care of the whole issue!
Fortunately... you don't have to worry so much about JavaScript stuffs... we'll go over what needs to be done... and it's just a matter of find and replace... not realy to much fancy stuff.
Expanding outside of the "application(strID & strUserdefinedLanguageCode)" the forum administrator should be able to say which language file is the default one. And then have the config.asp expanded to include the default language. Makes for a larger file, but one less include for the default language. This way the default loaded language can be any language the end user wants (which is what you were saying I believe) and your writing of code / variables to replace all the text in the forum code is limited strictly to variables... no Application(xxx,xxx) stuffs.
Tie that into your idea for a language function in the inc_functions.asp and we're in business... so your final variable that is inserted into the pages is actualy soemthing like:
fLangageConvert(strCurrentStringID)
and then we can pull the current cookie values in at the function point and establish JavaScript capabilities and result in the appropriate code.
Soooooo.... hmmmmm.... this is getting interesting... and very promissing!!! :)
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a< |
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 07 May 2001 : 15:36:03
|
Could you use something similar to Huw's file upload process where you have a language file "inc_language.asp" and have similar files "inc_language_english.asp", "inc_language_spanish.asp", etc. Then in the admin section, have a place where they could select a language, then that language file would overwrite the inc_language.asp file. You would then have just one file to include. Would require the use of the FileSystemObject, but I don't know how much of a barrier that would be....
Just a thought. Might have been considered already and discarded.
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead< |
|
|
marc
Junior Member
Belgium
175 Posts |
Posted - 08 May 2001 : 06:45:18
|
quote:
Then in the admin section, have a place where they could select a language, then that language file would overwrite the inc_language.asp file. You would then have just one file to include.
This is not a multi-language solution Dave... I think we have to put multi-language in the forum. -marc-
Marc Valentin < |
|
|
Deleted
deleted
4116 Posts |
Posted - 08 May 2001 : 17:21:38
|
Mike,
quote:
And then have the config.asp expanded to include the default language. Makes for a larger file, but one less include for the default language.
Well, either I'm missing something, or this way the default language must be fixed one, english probably... This is to exclude one include. Somehow this has to be chosen from the admin console and using filesystemobject a config.asp must be generated. I don't know what will happen in a working site (file locks, any kind of interruptions)...
quote:
This way the default loaded language can be any language the end user wants (which is what you were saying I believe)...
I think with the end user you mean the "admin". This way you cannot support multiple simultaneous languages.
This is what I think that must be supported:
* Admin will choose one default language among supported (currently translated) ones (say Turkish) (call it MASTER LANGUAGE) * Admin will choose other alternate forum languages (say English and German) (call them ALT-LANGUAGES) * A new non-member user will see the forum with MASTER LANGUAGE (Turkish) * A member will be able to choose among master+alternate languages (Turkish, English, German), this will be set in profile/written to database/kept in cookie (call it PREFERRED LANGUAGE). On the next hit heshe will see the forum in that PREFERRED language.
Mike, I know you're against keeping more than one language in the application object because of server performance. What I think is, in a way hardware is doubling its speed, so does server memory capacities. Internet speeds do not have such acceleration, but the bandwidths do. Least and most costly developing area is the software.
My most desired solution is: Design and implement it flexible/expandable, but don't use it. Thus no non-parametric hardcoding.
quote:
so your final variable that is inserted into the pages is actualy soemthing like:
fLangageConvert(strCurrentStringID)
and then we can pull the current cookie values in at the function point and establish JavaScript capabilities and result in the appropriate code.
Do you want us to check for cookies for every single piece of string to be output? OK, one time on one page: one global variable, if not defined then check...
In
fLangageConvert(strCurrentStringID)
strCurrentStringID must be a "hardcoded" constant. Isn't it? Like in:
fLangageConvert("topic01")
Sorry, probably I have an idefix. I'll do one set of functions, with one set of test files and data, and share tem with you on thursday night (GMT+3).
Edited by - bozden on 08 May 2001 17:26:05< |
|
|
inworg
Junior Member
Italy
153 Posts |
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 10 May 2001 : 17:01:06
|
|
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 10 May 2001 : 17:05:24
|
quote:
Exaustive map of my idea is avaible here: http://www.inworg.com/forum.pdf. The document is in PDF Format. Bye
I see how this could work... the language file could actualy contain a link to the actual end document in a <link> tag.
I think the solution that is preferable is to build a dynamic Server Side Include (SSI) string... if we can do this... it simplifys everything.
If it's not possible... then we need to weigh your solution against the javascript method. Both have very strong reasons for their use.
I'll make a new post requesting research on the SSI
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a< |
|
|
Deleted
deleted
4116 Posts |
Posted - 10 May 2001 : 22:45:44
|
Please also read this dissussion.
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2002 09:16:54< |
|
|
Deleted
deleted
4116 Posts |
Posted - 10 May 2001 : 22:48:51
|
quote:
the language file could actualy contain a link to the actual end document in a <link> tag.
Probably you know something, but I couldn't configure what you mean with the <link> tag. As far as I know, its not a supported tag for most browsers, except CSS. Isn't it?
Bulent Ozden History Foundation of Turkey
Edited by - bozden on 20 April 2002 09:10:32< |
|
|
inworg
Junior Member
Italy
153 Posts |
Posted - 16 May 2001 : 09:41:14
|
NOT ALL SERVERS ALLOW SSI !!
!!! WARNING !!! New Version of forum must have, due to real multi-language support, an array with Months & Weekdays Names!! Requires also a double chkDate function, one that returns date in the choosed format (eg. dd mmmm yyyy - Italian) the other that returns ALWAYS the date in the choosed NUMERIC format to be used in mods that let users to handle dates in local format (eg. Events Mod). If already done let me know
Soon avaible in my website the new version "pathed" in italian language.
Edited by - inworg on 17 May 2001 04:18:42< |
|
|
Topic |
|