How to translate phlyMail into another language

Hints for improving your installation and tuning it

How to translate phlyMail into another language

Postby mso » 11.02.2009 08:15

Translating phlyMail into additional languages is fairly easy. Since the internal encoding is UTF-8, almost any language spoken anywhere around the world could be supported.

For the closest accuracy to the originally intended message you should choose either the German translation, which is the mother tongue of the phlyMail team or English, which should come close enough.

phlyMail Lite includes all the necessary files for translation, the relevant ones are:

Code: Select all
phlymail/shared/messages/en.php
phlymail/handlers/bookmarks/lang.en.php
phlymail/handlers/calendar/lang.en.php
phlymail/handlers/contacts/lang.en.php
phlymail/handlers/files/lang.en.php
phlymail/config/messages/en.php


Open the files in a text editor of your choice, which is capable of UTF-8 and UNIX line endings (for the geeks: \n or LF or Line Feed as the default newline character).
Don't use the Windows or Mac type line endings (for the geeks: \r\n / \r, CRLF / CR).
Make sure, that the file is stored without BOM (Byte Order Mark).

We suggest you copy the file, you wish to translate and save it with the new language code before starting your work. The language code is the two letter code in lower case from ISO 639-1. So translating your phlyMail from English to, say, Czech, you would replace the .en.php in the file name by .cs.php.

All the files have the same anatomy. They are basically PHP files, where the tokens are to the left and the text string is to the right, enclosed in single quotes and finalised by a semi colon. See this example line, where the message payload is marked in bold:

$WP_msg['CalWarnBeforeStart'] = 'before the event starts';


A few of the messages contain HTML markup. Please leave it in the file, since it carries some meta information. The same holds true for line breaks, which might be carried out by just a new line in the file or by the newline meta character \n.
Some others of the messages might contain place holders, which get filled in with actual values at runtime. An example looks like this:
Code: Select all
$WP_msg['dateformat_calendarmhead'] = 'Week $1'; // Filled with the week of the year

Notice the $1? This is the place holder, which you need to let intact.

A note about a few of the message tokens, which you should take special care of:

Code: Select all
$WP_msg['language'] = 'en';

This should be filled with the language code from ISO 639-1 (see above)

Code: Select all
$WP_msg['language_name'] = 'English';

This should be the translated language name. So Russian would be written as ???????.

Code: Select all
$WP_msg['iso_encoding'] = 'iso-8859-1';

This is optional, but should be set to the native ISO representation of the language, if any. In doubt, please set it to utf-8.

Code: Select all
$WP_msg['tz'] = 'Europe/London';

The default time zone, where the majority of the language is spoken to cover most of the speakers. For languages, which spread over many time zones, choose the one of the capitol. In doubt, ask for our assistance.

Code: Select all
$WP_msg['html_bidi'] = 'ltr';

This denotes, whether the language is written from left to right (ltr) or from right to left (rtl). The latter holds true for e.g. Arabic or Hebrew.
Defining a language as being rtl, phlyMail will change the layout of its interface.

Code: Select all
$WP_msg['msg_copyright'] = '© 2001-2009 phlyLabs, http://phlylabs.de';

This is the place to name yourself. HTML allowed, but please be sane! No Javascript, no Flash please.

Code: Select all
$WP_msg['dec'] = '.';
$WP_msg['tho'] = ',';

The decimal point and thousands separator of the language. See Wikipedia

Code: Select all
$WP_msg['dateformat'] = 'm-d-Y H:i';
$WP_msg['dateformat_new'] = 'm-d H:i';
$WP_msg['dateformat_old'] = 'm-d-Y';

Choose the date formats used in the language. For a comprehensive list of options, see the PHP manual page for the date function.

A final note to sharing your work: We would be very glad, to add your translation to the phlyMail core. If you have any questions not covered in this short manual, don't hesitate to ask them here. We will be glad to assist you.
Matthias Sommerfeld

phlyMail Developer
http://phlymail.com
User avatar
mso
Site Admin
Site Admin
 
Posts: 1259
Joined: 01.11.2001 01:00
Location: Berlin

Return to Tipps & Tricks

Who is online

Registered users: No registered users

cron