YaPiG Multilingual Support
YaPiG has multilingual support, that is, it can be translated into any language without needing to modify the source code. So, if YaPiG is not translated into your language you can do it yourself.
Setting YaPiG's Language
As default, YaPiG interface is configured to show all messages in English but them can be shown in these supported languages:
- br = Brazilian Portuguese (0.92b). Thanks to Megajoy.
- ca = Catalan Language (0.83b). Thanks to Antoni Hortal.
- cn = Chinese Language (0.91b). Thanks to attimmee.
- cz = Czech Language (0.92b) Thanks to Jiri Cincura and Frettie.
- de = German (0.80b) Thanks to docviper.
- en = English (Original Source Code Language).
- es = Spanish (0.92b) Thanks to me (NaTaSaB)
- fi = Finnish (0.92b) Thanks to Miikka Mättölä (mixxu)
- fr = French (0.81b) Thanks to Thomas Oireaux and David Foucher.
- gl = Galician (0.92b) Thanks to Rashgaroc.
- hu = Hungarian (0.92b) Thanks to Greg J. (greggood)
- id = Indonesian (0.8x) Thanks to Bernouli.
- it = Italian (0.82b) Thanks to Andrea Baldon.
- ja = Japanese (0.92). Thanks to Tadashi Jokagi (elf2000)
- no = Norwegiam (0.92). Thanks to Bernt Egil Berntzen (zenmed)
- nl = Dutch (0.83b). Thanks to Theo Beers.
- ro = Romanian (0.92b). Thanks to Mat (kamikadzee)
- ru = Russian (0.83b) Thanks to Arseny Vesnin.
- sk = Slovak translation (0.92). Thanks to Andrej Zatko
- sv = Swedish (0.92b) Thanks to Daniel Ek and updated to 0.92b by Jasmin Z.
Note: Some of this translations might not be up to date so some of the messages can appear in English. If you want to change this please read How can I translate YaPiG into my language.
To set your language just edit config.php file modifying the
LANG
variable in the Interface Config area. For example,
to set Spanish language as default:
$LANG="es";
¿How can I translate YaPiG into my language?
First step is know what is your country language identifier (from now, lang_id). You can find your language identifier in this web
New Translation
Once you know your lang_id you must create a subfolder of the YaPiGs root folder with this format: ./locale/lang_id/LC_MESSAGES/.For example,the Spanish language (lang_id=es):
locale/es/LC_MESSAGES/
Next step is copying the file ./locale/yapig.pot into ./locale/lang_id/LC_MESSAGES/yapig.po. For example:
$ cp ./locale/yapig.po ./locale/es/LC_MESSAGES/
Update translation
If YaPiG is already translated into your language, this translation might be old so some messages appear in English. What you have to do is: in your lang_id/LC_MESSAGES/ directory edit yapig-latest.po, add/modify missing translations messages and copy yapig-latest.po into yapig.po. Then check in yapig that all is correct.
Note: Take care about messages with the comment #'fuzzy. This means that it is possible to be an incorrect translation. Gettext tools, used to generate this file have some kind of inteligence, but sometimes it makes mistakes, and it warns using the fuzzy message.
Next step is edit yapig.po file. It has a this format:
# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR EMAIL@ADDRESS, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2003-11-06 17:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. end log #. ############################ MAIN PROGRAM ################# #: ../add_comment.php:44 msgid "English text" msgstr "" #: ../add_comment.php:47 msgid "This text has to be translated" msgstr ""
First of all, set the proper charset encoding. For Latin languages such as Spanish, French, Italian the charset encoding is iso-8859-1.
What you have to translate are msgid strings. This way:
msgid "English text" msgstr "Texto en Inglés" msgid "This text has to be translated" msgstr "Este texto tiene que ser traducido"
That is, you only have to fill msgstr string with the equivalent in your language of the msgid string.
Finally, once you have the translated file, it would be great if you send to YaPiG developers this file. That way, you will be helping people that uses your same language because it will added to the YaPiG supported languages in next released version. You can upload the file in the YaPiG's Patch page (preferred) or mail it to me, the address is natasab@users.sourceforge.net. Thank you!