Languages / i18n
s9y is fully compatible to be used in a native language and supports native and UTF-charsets, timezones and entity-encoding. Apart from the bundled languages (english, german, danish, czech, french, spanish and many others) you can easily translate the strings into your language. Given that you can read at least one of the mentioned languages. :-)
Language files are stored inside the 'lang' subdirectory of s9y. Each language file has its filename token: 'de' for 'German', 'en' for english and so forth:
- lang/serendipity_lang_en.inc.php: This file holds a list of constants for each string/message that is used in Serendipity. The file also defines some common variables like the national timezone, locales, a dateformat and the used codepage/charset (ISO-88591-1, windows-1252 etc).
If you want to add a new language, just copy this mentioned file and adjust your language prefix. Say you want to add a dutch version of s9y you just need the file lang/serendipity_lang_nl.inc.php.
Now you also need to supply a UTF-8 version of your language file, which you then put into the UTF-8 directory. For new language we suggest that you only create a UTF-8 version of your language, with all the Constants set to UTF-8 and the file saved in UTF-8 encoding. Then you just put the same file into both the lang and lang/UTF-8 directories. If all this UTF-8 mumbo-jombo is too complex for you, just announce your translated language file on the Serendipity Forums, and somebody will come to your help to create the UTF-8 variant!
Now to make Serendipity recognize the new language, you need to edit the file serendipity_config.inc.php in the main serendipity directory. Open that file with an editor and look for the definition of the $serendipity['languages'] array. It will look something like this:
$serendipity['languages'] = array('en' => 'English',
'de' => 'German',
'da' => 'Danish',
'es' => 'Spanish',
'fr' => 'French',
'fi' => 'Finnish',
'cs' => 'Czech (Win-1250)',
'cz' => 'Czech (ISO-8859-2)',
'nl' => 'Dutch',
'is' => 'Icelandic',
'tr' => 'Turkish',
'se' => 'Swedish',
'pt' => 'Portuguese Brazilian',
'pt_PT' => 'Portuguese European',
'bg' => 'Bulgarian',
'hu' => 'Hungarian',
'no' => 'Norwegian',
'pl' => 'Polish',
'ro' => 'Romanian',
'it' => 'Italian',
'ru' => 'Russian',
'fa' => 'Persian',
'tw' => 'Traditional Chinese (Big5)',
'tn' => 'Traditional Chinese (UTF-8)',
'zh' => 'Simplified Chinese (GB2312)',
'cn' => 'Simplified Chinese (UTF-8)',
'ja' => 'Japanese',
'ko' => 'Korean',
'sa' => 'Arabic',
'ta' => 'Tamil');
Now just add your new language with the prefix and the language name to that array, and you can choose it in your Serendipity Interface.
Please also think about contributing? your translated language files so that all users can benefit from your efforts!
