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 languaje 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:

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 languaje 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 ##TO DO##

  1. 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/
    
  2. 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 ""

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 languaje 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. The mail address is natasab@users.sourceforge.net. Thank you!