Path

ez.no / exponential / documentation / configuration / configuration / language and charset / creating a new translation


Creating a new translation

What you need

Exponential 3 requires two programs to create and maintain translations, ezlupdate and linguist. (You may not need ezlupdate.) These programs are based on the same tools from the Qt toolkit by Trolltech. The unix version of this toolkit is released under the GPL. 7x provides binaries for Windows and Mac OS X, see the translations page on ez.no/developer.

The linguist is unmodified from the Qt original, so you can also get it from other sources, such as RPMs. If you run Linux or a similar system, you will find the linguist as part of qt-3.*, qt-devel-3.* or a similarly named package.

The ezlupdate program is modified to make it understand Exponential files. You will find the source code and build instructions in support/lupdate-exponential3 in the Exponential distribution.

Making translations

Note: The database content of Exponential is not translated, meaning that for instance class attributes are shown in English wherever this information is visible. This is normally only in the admin interface. The classes provided with Exponential are merely examples provided to get you up and running quickly. You are encouraged to extend and/or replace these classes with your own classes. If you need a non-English administrative interface, you can translate your classes in the "Setup" section. (The translation system covers content in templates and PHP code.)

You must decide the locale code of your language. Exponential 3 uses locale codes on the form aaa-AA, where the 3 first lowercase letters describe the language, while the last two uppercase letter describe the country in which the language is spoken. For instance, English as it is spoken in Great Britain would be eng-GB, while US English is eng-US.

Countries are specified by the ISO 3166 Country Code: http://www.iso.ch/iso/en/prods-services/iso3166ma/index.html

Language is specified by the ISO 639-2 Language Code: http://www.loc.gov/standards/iso639-2/php/code_list.php

You can also create a variation of a locale, you will for instance find two variations of nor-NO, nor-NO@intl and nor-NO@spraakraad, that are slight modifications of the original.

For the rest of this part, I assume you are translating nor-NO. (Just replace nor-NO with your locale.)

Copy share/locale/eng-GB.ini to share/locale/nor-NO.ini. Edit this file with a text editor. Here you set locale details such as time formats, currency and the names of the week days.

There are to methods to make your own .ts file. The fastest is to copy it from the share/translations/untranslated/translation.ts file which should be included in your distribution. Copy it to share/translations/nor-NO/translation.ts, and start translating it with the linguist, see further down.

The second method involves building the .ts file yourself, using ezlupdate. You need to do this if you don't have the untranslated translation.ts file, or if you have changed template text using i18n operators, or if you use i18n in your own custom template or PHP code.

Enter the main Exponential directory in a terminal and type

bin/linux/ezlupdate -v nor-NO

(Provided that nor-NO is your locale, of course. -v is for verbose, showing messages about what happens. You can also use -vv for extra verbose output, or omit it for silent behavior. Run bin/linux/ezlupdate -h for an explanation of the arguments.

You will now find a translation in share/translations/nor-NO/translation.ts or similar for other locales. Open this file in linguist and do the translation.

You will find documentation on linguist on Trolltechs page: http://doc.trolltech.com/3.0/linguist-manual-3.html

When you are done translating in linguist (or earlier, if you want to test part of a translation), open settings/site.ini. Go to the section [RegionalSettings] and set Locale=nor-NO. Also set TextTranslation=enabled, or the default (eng-GB) will be used.

Sample entry in settings/site.ini:

[RegionalSettings]

Locale=nor-NO

TextTranslation=enabled

If you run a multi-language site, you will also need to translate content objects. Set ContentObjectLocale=nor-NO if you want the default language to be nor-NO. Important: Before you do this, you should make sure that the new locale is added to the system. Go to Setup -> Translations and add your locale here if it does not exist. You should also translate the most used objects of your site before you change the ContentObjectLocale. To translate an object, edit it, and click "Edit" under "Translations" in the right-hand menu.

To distribute your translation, create a compressed archive, for instance .zip or tar.gz, of these two files:
share/locale/nor-NO.ini
share/translations/nor-NO/translation.ts

You could for instance do it like this:

tar -zcvf nor-NO.tar.gz 

 share/locale/nor-NO.ini share/translations/nor-NO/translation.ts

Comments

Log in or create a user account to comment.

Contents

Configuration

Configuration
    WebDAV setup
    Exponential running on a CGI version o...
    Path prefix
    Locale Settings
    Introduction
    Configuration files
    Site access
    Common settings
    Multi Site
    Directory structure
    Language and charset
       Installing a Language pack
       Multilanguage site
       Unicode with Exponential
       Creating a new translation
          Installing translations
       How to setup a Multilingual Site
    Cron jobs
    Login handler
    Search engine
    Tips & Tricks
Security
Optimization
Backup & Restore
Troubleshooting


Created

04/07/2003
10:58:52 am
by B�rd Farstad

Last updated

19/10/2006
10:23:49 am
by Gunnstein Lye

Authors

B�rd Farstad
Jan Borsodi
Gunnstein Lye



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.