Difference between revisions of "Translations"

From GeeklogWiki
Jump to: navigation, search
(Started page on how to create / update a translation)
 
(Getting help / publishing)
Line 46: Line 46:
  
 
To update a translation, you can either browse through the language file and look for English texts, or you can translate texts as required as you run into them when using your Geeklog site.
 
To update a translation, you can either browse through the language file and look for English texts, or you can translate texts as required as you run into them when using your Geeklog site.
 +
 +
 +
= Getting help =
 +
 +
The [http://eight.pairlist.net/mailman/listinfo/geeklog-translations geeklog-translations mailing list] is probably the best place to go to when you need help with your translation. We recommend that all maintainers of language files subscribe to this list, as we will also post information about changes in the language files in upcoming Geeklog releases on this list.
 +
 +
 +
= Publishing your translation =
 +
 +
The best way to publish your translation is to get it included in the official Geeklog tarballs. Pre-announcements of upcoming releases will be posted on the geeklog-translations mailing list, so that you can finish your work in time to be included.
 +
 +
Between Geeklog releases, you can always upload your translation on geeklog.net. Make sure to compress your language file(s) as .zip or .tar.gz files to prevent special characters from being corrupted.
 +
 +
Translations uploaded to geeklog.net will also usually be picked up to be included in future Geeklog releases.

Revision as of 20:00, 10 August 2008

Creating a new translation

Geeklog has already been translated into more than 20 languages. If your language is not among them, you may want to check for a related language first. But usually, the best way to start a new translation is to make a copy of english.php (or english_utf-8.php) and give it the English(!) name of your language.

Things to consider:

  • The character set: If you're using UTF-8, that should be reflected in the name of the language file.
  • Dialects / variations of a language: Local variations of a "main" language should also be reflected in the file name. See, for example, portuguese_brazil.php for "Portuguese, as spoken in Brazil".


Character set and text direction

Your language file should define the character set to use for your language:

$LANG_CHARSET = 'iso-8859-1';

For languages that are written right-to-left (e.g. Hebrew, Arabic), you should also set

$LANG_DIRECTION = 'rtl';

If $LANG_DIRECTION is not set in the language file, the left-to-right is assumed.


The $LANG arrays

Geeklog uses PHP arrays to define the texts used, e.g.

$LANG01 = array(
    1 => 'Contributed by:',
    2 => 'read more',
(...)
);

So whenever Geeklog needs the text for "read more", it refers to $LANG[2] and picks up the localized text from the current language file. So you only need to translate the text to the right of the => sign.

Note that some language arrays are using a textual key instead of a number, e.g.

$LANG_ACCESS = array(
    'access' => 'Access',

Again, you should only translate the text on the right side. PHP also allows text strings as an array index, so the word "Access" would be referred to by $LANG_ACCESS['access'] (and if you changed the 'access' on the left side, this wouldn't work any more).


Updating a translation

Not all language files are still actively supported. Therefore, you may notice that some texts will show up in English even when you switched to a different language. The language files, as shipped with Geeklog, are updated such that they include all the required texts. Where a translation is not available, the English text is used.

To update a translation, you can either browse through the language file and look for English texts, or you can translate texts as required as you run into them when using your Geeklog site.


Getting help

The geeklog-translations mailing list is probably the best place to go to when you need help with your translation. We recommend that all maintainers of language files subscribe to this list, as we will also post information about changes in the language files in upcoming Geeklog releases on this list.


Publishing your translation

The best way to publish your translation is to get it included in the official Geeklog tarballs. Pre-announcements of upcoming releases will be posted on the geeklog-translations mailing list, so that you can finish your work in time to be included.

Between Geeklog releases, you can always upload your translation on geeklog.net. Make sure to compress your language file(s) as .zip or .tar.gz files to prevent special characters from being corrupted.

Translations uploaded to geeklog.net will also usually be picked up to be included in future Geeklog releases.