The trad-lang translation system

Wednesday 6 October 2004 Mathieu Lutfy

String translation is used by calling the _T() function. For example:

Since the software has about 1000 strings to translate, we must adhere to some sort of notation on how we name the strings so that translators may have some idea of the context for each strings.

The translation system, Trad-Lang, is installed on this NGO-bg server (LCM translation interface). Modifying the strings from this interface does not affect other systems nor the CVS. You must transfer the file and commit it yourself, locally.

To find non-translated strings

There are two methods provided to highlight the translated strings, therefore helping to find non-translated strings:

- Add the variable "debug_tr=1" in the URL of the request. For example:

- In the my_options.php file:


<?php
 $GLOBALS['debug_tr'] = true;
?>

Giving a name to your strings

To help translators understand where a given string is used (and to avoid a general mess), use the following format to give a meaning to your string:

- case_FOO_... (strings used by case details, edit case)
- client_FOO_... (strings used by client details, edit client)
- org_FOO_... (strings used by organisation details, edit organisation)
- install_FOO... (strings used in the installer)
- login_FOO... (strings used in the login forms)
- pass_FOO... (strings used in the "forgotten password" or "register" forms)
- authorconf_FOO... (config_author.php)
- siteconf_FOO... (config_site.php)
- directories_... (lcm_test_dirs.php)

Foo?

The FOO stands for the use of your strings. Here is a general list:

- input: To request or print information — usually ends in ":".
- info: A longuer sentence, informative message.
- warning: Warnings or errors.
- subtitle: Usually shown in some fancy header — does not end with a ":".
- tab: Text shown in a tab header (see config_site, config_author, etc.) — does not end with a ":".

Exceptions

- button_NAME: Button used in a form
- menu_SECTION_NAME: For menus (ex: menu_nav_case)
- input_NAME: Input fields shown in every page (ex: search)

Short words

Keep in mind:

- Gender (which may vary from language to language)
- Numbers

This is the main reason why some words, which could have been the same string used in different part of the application, are duplicated into various strings. This also helps us later if we need to give a string a more specific meaning.

To send a message Private area Registering with the site xml ?