Adding a new language translation

2010-09-27
2013-02-09
  • The first step is to get the last development sources from the SVN repository. You can do this either downloading a tarball from this address, or using a Subversion client, and checkout the repository. For instance, using the Subversion CLI:

    $ svn co https://vmpk.svn.sourceforge.net/svnroot/vmpk/trunk vmpk-directory
    

    The second step should be to install the programs Qt4 Linguist, lupdate and lrelease that belong to the Qt4 SDK. There is a free download from Nokia or can be installed from your official Linux distribution repositories. Online documentation.

    Now, open the file "vmpk-directory/vmpk.pro" with a text editor and add the new language translation file name to the TRANSLATIONS keyword. You should use the ISO-639-1 two letter code, optionally followed by "_" (underscore) and two upper case letter country code if you are adding a language variation. The list of language codes can be found here.

    For instance, if you are adding a Japanese language translation, the name would be vmpk_ja.ts, and for Brazilian Portuguese it would be vmpk_pt_BR.ts. The translations list with the two new languages would become like this:

    TRANSLATIONS +=  translations/vmpk_cs.ts \
        translations/vmpk_de.ts \
        translations/vmpk_es.ts \
        translations/vmpk_fr.ts \
        translations/vmpk_ja.ts \
        translations/vmpk_pt_BR.ts \
        translations/vmpk_ru.ts \
        translations/vmpk_tr.ts \
        translations/vmpk_zh_CN.ts
    

    Now, open a terminal window and from the vmpk directory, run the lupdate utility with this command line:

    $ lupdate vmpk.pro
    

    You have now your new translation template in the "translations" directory.  Open it with the Qt Linguist program, and translate all the available strings. Once you are done, you can attach the result in an email message or to a tracker request to be added to the repository for the next release. You may also create a SourceForge account and request to be added to the VMPK project,
    so in the future you would be able to update your translation directly in the Subversion repository.

    Regards,
    Pedro