> How do your translators access this database to update/add their
> translations?

For users with the right privileges, a "Translate" button appears
on most forms/screens, as well as in e.g. the main menu bar.

Clicking that button presents a list of the strings associated
with the widget tree where the button was found. In this way,
translation is done in the program context where the string is used.
Translation is done for the currently selected language. Note that
all this is really application logic, and has very little to do
with the actual storage mechanism.

> - Not all applications need a RDBMS. Having a database only for  
> translations is inconvenient.

True, but my applications do.

> - Two strings worded the same in the original language may need a  
> different translation, depending on the context. Extracting a  
> translation from a database with just a SELECT translation FROM  
> lang1_to_lang2 WHERE str="original string" may return a completely  
> wrong translation.

But you can make the original strings unique, and translate even for
the original language.

Another way is to optionally associate translations with a context,
which may be as simple as an integer. Use a unique but fixed id
for each form and use that number in the database along with the
source string as part of the primary key. Associate id=0 with
"global" translations.

   SELECT translated FROM translations
          WHERE raw="Hello" AND (id = 5 OR id = 0) AND lang = "SV_se"
          ORDER BY id DESC
          LIMIT 1

Where "5" is an example id.

Actually, support for this fixed id in translatable strings, as created
by WString::tr, is the subject of a possible upcoming feature request.

/Lars Hamrén


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to