Laffer Project URL: http://laffer.sourceforge.net
How To Translate Laffer Interface To Your Favourite Language
Author: Slavei Karadjov
Date: 28-06-2005
URL: http://laffer.sourceforge.net/cgi-bin/index.pl?page=article&id=docs&key=373321466

Table of Contents

  1. Before you start to translate
  2. How to translate
  3. How to check the translation
  4. What to do when you are ready
  5. Meta

Before you start to translate

What translations are available

For the moment there are three translations of the Laffer interface available. They are in English, Russian and Bulgarian language. If you want to translate the interface into your favourite/native language you've got to have good knowledge of one of the languages mentioned above.

First steps you need to take before you start to translate

If you are want to translate the interface in language X, try to find out if somebody has already started such translation in language X, or there is official translation. The best way to find the answer is to send request to slaff(a)users.sourceforge.net

What do I need to know before I start to translate

Except good knowledge of the language you want to add the new translation, and the language from which you want to translate, you must have some spare time and desire to do it. Programing knowledge will help you to cope better with the translation but it's not required.

How to translate

Files needed

Go to modules/lang directory. In it you will find sub-directories with name the two-letter code of the language. For example bg/ is for Bulgarian and en/ is for English. Find out what is the two letter code of your language - for example kr/ for Korean and create such sub directory. Go to kr/ directory and copy the content of the en/ directory, if you know English language, to this directory

Example commands for Unix/Linux OSes:
$ cd modules/lang $ mkdir kr/
$ cd kr/
$ cp -R ../en .

All the files in this directory should be translated.

How to translate words and sentences

Fist you have to choose the character set in which you will write the messages. For example the Bulgarian translation uses windows-1251 character set, which supports Cyrillic and Latin letters. If you are not sure which charset you are using, ask some computer geek near you or google.

Open file "default" located in your language directory with your favourite text editor. There are three things you need to know how to change.

Charset - find the line
$CHARSET = "windows-1251";
and change windows-1251 with the charset you will use.

There is a function called "nat2lat" which is responsible for translating letters in the translation you are using into latin letters. If you don't know what to do with this function make it look like:
# [Function to convert from nativate to latin]
function nat2lat($TMP_DYNAMIC_HTML) {
return $TMP_DYNAMIC_HTML;
}

Translation of word/sentences/phrases.
The file "default" is full with lines which look like this

define(STR_START_SEARCH,"Search >>");

To translate this to German, for example, you must change the line to look like:

define(STR_START_SEARCH,"Suchen >>");

Special symbols and ways to escape them

You can wrap the translate text with "_TEXT_", or '_TEXT_'. If you use " for wrapping the translated string, every " inside the translated text must be written as \". The same rule apply for '. A little programmer's knowledge will help you here.

How to check the translation

Show the translation to your friend

May be the best way to check your translation is to show it to other people, who know the translated language. Ask them for their comments and objections.

Check if the translation is "working"

If you think the translation is ready for prime time then open file "config.inc" located in modules/ and find this line:

$allowedLanguages = array("bg"=>"Български", "en"=>"English");

Add the two letter code and the name of the language. Look at the example below:

$allowedLanguages = array("de"=>"Deutch", "bg"=>"Български", "en"=>"English");

Also change the line:
$LANG="en"; # default language
To:
$LANG="de";

What to do when you are ready

Send the translation back to Laffer developers

Send archive of the directory with the translated files to slaff(a)users.sourceforge.net or try to announce your translation in the forums of the project: http://laffer.sf.net The only sure way to have your translation in the official distribution of Laffer is to send it to the developers.

Meta

This manual is written by Slavej Karadjov for Laffer Web Client(LWC) version 0.3.2.6 or bigger.
LWC is part of the Laffer Project.
LWC is free software under GPL license.

<< | Laffer Web Client Mini Manual >>

All materials in this site are published under Creative Commons License unless otherwise noted. Creative Commons License
All trademarks, logos and copyrights mentioned on this site are the property of their respective owners.
Copyright © 2004-2005 Slavei Karadjov.
All rights reserved.