Home > Fluid Dynamics Search Engine > Help > 1000

Translating the user interface

The Fluid Dynamics Search Engine has been designed for easy translation to non-English languages.

Most text is separated from the code and stored in subfolders of "searchdata/templates". The script pulls text from one of these folders based on the $::Rules{'language'} setting, which you control on the "Admin Page" => "User Interface" page.

Updating translations requires access to the command line. If you do not have telnet access to your web server, you should install Perl on your local computer and run the translator utility there.

Updating Your Translations

To update the translations, follow these steps. German will be used as an example language:

Easy Method

  1. Download the "german.txt" file for the latest version from www.xav.com/latest/translator.

  2. Edit the file and correct the desired translation. Mark your changes with your initials in the "Authority" field. You do not need to modify the "Time", "Instances", or "Context" fields.

  3. Mail your updated "german.txt" file to Fluid Dynamics. If you improve more than 40 strings, you will receive a free registration key and your name will be added to the "translated by" credits.

  4. Your changes will appear in the next FDSE release. If you want a version with your changes immediately, a private build will be created that includes your submissions.

Roll-Your-Own Method

  1. Make a fresh install of FDSE, and do not customize any of the English-language templates.

  2. Download all of the version-specific files from www.xav.com/latest/translator, including english.txt, german.txt, global_no_translate.txt, and translate.pl. Place these files in the folder "searchmods/powerusr".

  3. Open a command prompt and navigate to the "searchmods/powerusr" folder.

  4. Run the command: translate.pl german

  5. This command will review all English-language files from "searchdata/templates/english". It will translate them using the "English::German" mappings found in the downloaded "searchmods/powerusr/german.txt" file. It will then rebuild all of the files in "searchdata/templates/german".

  6. View FDSE over the web and set the language to German (use "Admin Page" => "User Interface" => "Language Settings"). When you see some text that should be changed, open "searchmods/powerusr/german.txt", find the text to change, and edit it. Then run the translate.pl utility again.

Translating to a New Language

To translate to a new language, follow these steps. FooLang will be used as an example language:

Easy Method

  1. Download the "english.txt" file for the latest version from www.xav.com/latest/translator.

  2. Rename the file to "foolang.txt". Translate each line of the file. You do not need to modify the "Authority", Time", "Instances", or "Context" fields.

  3. Mail your updated "foolang.txt" file to Fluid Dynamics. If you improve more than 40 strings, you will receive a free registration key and your name will be added to the "translated by" credits.

  4. Your changes will appear in the next FDSE release. If you want a version with your changes immediately, a private build will be created that includes your submissions.

Roll-Your-Own Method

  1. Make a fresh install of FDSE, and do not customize any of the English-language templates.

  2. Download all of the version-specific files from www.xav.com/latest/translator, including english.txt, global_no_translate.txt and translate.pl. Place these files in the folder "searchmods/powerusr".

  3. Create a new folder called "searchdata/templates/foolang".

  4. Copy the file "searchmods/powerusr/english.txt" to "searchmods/powerusr/foolang.txt".

  5. Open a command prompt and navigate to the "searchmods/powerusr" folder.

  6. Run the command: translate.pl foolang

  7. This command will review all English-language files from "searchdata/templates/english". It will translate them using the "English::FooLang" mappings found in "searchmods/powerusr/foolang.txt" file (which at first will just be English::English mappings). It will then rebuild all of the files in "searchdata/templates/foolang".

  8. Edit the file "searchmods/powerusr/foolang.txt", translating each string to the new language. Periodically run the translate.pl utility and review FDSE over the web to make sure it appears okay.

Contributing to the Master Translations

If you want, you can email your updated language.txt file to Fluid Dynamics (please label your changes using the Authority header). Those who update at least 40 strings will receive a free registered version of the product, and will have their names included in the "translated by" credits (if they want).

To be useful, contributed translations must be distributable by Fluid Dynamics and end users must be free to modify them. Thus, translations cannot be accepted unless you transfer copyright to Fluid Dynamics. Your free registered version and mention in the product is a thank-you gesture for that transfer.

Please do not submit computer-generated translations, as their quality is particularly low on fragmented files with technical subject matter.

Auditing Translations

From a command prompt in the "powerusr" folder, run the command "lang.pl audit".

This command will step through the file "searchdata/LANGUAGE/templates/strings.txt" and confirm that all $sn variables are present and accounted for (the strings.txt file is one of the main files generated by the translate.pl process). For example, you could translate "unable to open file '$s1' - $s2" into "unae ablae openae ilefae '$s1' ecausebae ofae $s2" and the audit would return okay. But if you translated to just "unae ablae openae ilefae '$s1'", then the audit would kick out an error because the $s2 variable was not used.

You are allowed to re-order and re-use variable strings when translating, but if you leave a string out, an ugly ASSERT error will be generated during runtime whenever the string is used.

After building your language-specific strings.txt file, you should load that file in a rich text editor and perform a language-specific spellcheck. This helps greatly in tracking down misspelled words.

Special Translator Strings

Almost all blocks in the "language.txt" file consist of English-to-other translations of words, strings, and sentences. However, four special blocks do not involve literal translation. They are:

<!-- translation credits -->
This string in English is replaced with a visible, non-commented HTML paragraph which lists the names of those who've assisted with this translation.

145
The number 145 is the only stand-alone number in the translation system. It is the width of the admin navigational frame, in pixels. For English, a 145-pixel navigational frame works well. For other languages, like Swedish, the navigational frame needs to be wider, and so 145 is "translated" to 180.

English
The word "English" should be "translated" to the name of the non-English language, expressed in its own native form, such as "Svenska" for "Swedish" or "Espaņol" for "Spanish". This self-referential string is used on "Admin Page" => "User Interface" => "Language Settings" to label the language options.

text/html; charset=iso-8859-1
This is the language-specific content-type header that will appear in the META section of the public and admin pages. The default should work fine for Latin languages. An overview of character sets can be found at http://www.w3.org/International/O-charset-lang.html.


History: the translation concept was introduced in FDSE version 2.0.0.0031. The "translate.pl" script was not available to end users until version 2.0.0.0044. This help topic applies to the 0044 version and newer.


    "Translating the user interface"
    http://www.xav.com/scripts/search/help/1000.html