Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4-archive)
 Overview of Snitz Internationalization?
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

luxem
Starting Member

USA
7 Posts

Posted - 08 May 2002 :  15:28:26  Show Profile  Visit luxem's Homepage  Reply with Quote
Could someone point me to an overview of how Snitz handles internationalization?

I currently manage an open-source help desk project called Liberum Help Desk (http://www.liberum.org), and I am trying to get a feel for how other database driven, ASP applications handle multiple languages.

Here's how Liberum is currently working:

First off, in our system the database holds the language stringsn and each user can select a different language to view the pages in (plus there is a default language selected for the help desk for those who aren't logged in).


Tables Layout
tblLanguages
LangPK Int
LangName VC64

tblLangStrings
StringPK Int
LangFK Int (relates to tblLanguages.LangPK)
LangVariable VC64
LangString Text

tblUsers
[normal user information]
LangFK Int (relationship to tblLanguage.LankPK)

In the web pages where we want to print text we use a function and pass it the variable name of the string. For example, if we wanted to print "Submit New Problem", the code would be:
<%=Lang("SubmitNewProb")%>

The function 'Lang' does the interesting part. Instead of just reading in a translated string one variable at a time, it reads all strings for a language at a time. The strings are then stored in an application variable so future request for translated strings won't need to hit the database. The reason this was done was becuase on a given page there may be 20+ request for translated strings.

Here's some psuedo-code for Function Lang(strStringVariable):

SELECT LangFK FROM tblUsers
If Not IsObject(Application("LangCache")) Then
  ' ### If the cache doesn't exist, created it by querying the DB
  SELECT LangVariable, LangString FROM tblLangStrings
         WHERE LangFK = [tblUsers.LangFK]
  Application("LangCache") = rs.GetRows
End If
Lang = FindInArray(Application("LangCache"), strStringVariable)


FindInArray is fairly efficient in searching the cache and has a O(n) = sqrt(n). I guess my concern with this is the amount of memory usage on the web server when have all of the languages cached. We currently have about 400 strings, which may increase to 1000 for the next release. If we average about 30 bytes for the translated text and 10 bytes for the variable, that's 40 bytes per entry which is 39KB (40B * 1000) per language. A site with 3 languages enabled is using about 120KB of memory for these Application variables.

How does Snitz compare in handling the translated strings? I haven't had a chance to go through the code as I've been a little busy with my project (and cleaning up my hacked forum). Does Snitz even use the database to house translated strings?

Thanks for you time and any help you can give me!
Doug Luxem


[moved by bozden on 01 October 2002]

<

Edited by - Deleted on 01 October 2002 18:09:37

Deleted
deleted

4116 Posts

Posted - 08 May 2002 :  16:22:53  Show Profile
We ruled out the database case because we already have near 2000 strings (will be more in v3.4). We run some tests and found the best way is to use include files with language variables in them. This is because we have some restrictions:

* We had to be IIS 4 compatibility
* We could not use any other object such as FSO

The include method will work optimal if you are on IIS 5 (Win 2K). Here you can use constants (instead of variables) and use the server.execute call to include them. This way you also eliminate the load from multiple include files.

Did you have a look at the dictionary object? It seems to be most powerful one.

More info can be found in the following links:

Topics on preliminary decisions:
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=9447
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=8433

Topics on performance tests:
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=25267
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=27023

Download v4b04 and look at the Lang1033.asp files. You may also like to follow the link in my signature.


Think Pink
==> Start Internationalization Here<
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07