Translator Instructions

From LinphaWiki

Jump to: navigation, search

dronsitze Important: This applies only to LinPHA 2.x!


Contents

LinPHA internationalization

Translators

Howto update an existing language file

  1. Make sure you are using the latest LinPHA developper version (e.g. daily snapshot)
  2. Open your linpha site, log in as admin and point your browser to the url .../linpha/lib/lang/editlang.php
  3. Choose your language in the "LinPHA language files" section and press the button "Update language file"
    You will get a list of all language entries which aren't yet in your language file
  4. Open the file linpha/lib/lang/lang.Yourlang.php in a text editor which can handle the character encoding you are going to use
    e.g. jEdit (Microsofts notepad will not work)
  5. Copy all entries to the language file; without the hyphens, above the line "// paste new language entries here"
    Make sure that the last line always contains the characters "); ?>"
  6. Start translating the entries. The quotes must stay there, e.g.: you will change the line
    "Friday" => "",
    to
    "Friday" => "Freitag",
  7. Repeat step 3-6 with the section "Installer language files"
  8. Save your language file and verify your translation on your linpha site
  9. Upload both language files to the LinPHA patch tracker at http://sourceforge.net/tracker/?atid=508616&group_id=64772&func=browse or mail it to fangehrn at users.sourceforge.net or bzrudi at users.sourceforge.net

Howto create a new language file

Same procedure as updating an existing language file, but as the first step you have to copy the file linpha/lib/lang/lang.Example.php to linpha/lib/lang/lang.Yourlang.php and linpha/install/lang/lang.Example.php to linpha/install/lang/lang.Yourlang.php

Special stuff

Date and time formats

There are two special language entries: special_date_format and special_time_format They are used to format the date and time presentation.

If the time and date format is different in your country with these definition, change it according to the definitions at http://www.php.net/manual/en/function.strftime.php.

They don't apply to the english language, because the date format is different within the english spoken countries. If the language is English, the specific values are taken from the config table in the database.

Place holders

%s and similiar signs are placeholders which will be replaced when using it. You have to keep them in your translated text.

If there are more than one placeholder, you might want to change the order of the placeholders. This link http://www.php.net/manual/en/function.sprintf.php shows how to do.

Special characters / Encoding

  • If possible use always the UTF-8 encoding.
  • Replace all special characters with their respective html entity.
    For example:
    ö -> ö
    " -> "
    $ -> $


Developer

Dos and Donts

 use i18n("text string") not i18n('text string')
 use i18n("test") + $foo + i18n("string") not i18n("test" + $foo + "string")
 use i18n("a long string") not i18n("a long ".
 		                       "string")
Personal tools