HowTo:Add a Language to the Linux Client
From iFolder
All of the strings for the iFolder Linux client are stored in .po files (Portable Object). The files for the linux client are in the folder src/LinuxClient/po. The ifolder3.pot file is the "template file" that all other languages should be generated from. The first step is to make sure the pot file is up to date. Do this by running:
make update-po
in the src/LinuxClient/po folder. This will run xgettext and parse all of the files that contain strings to update the ifolder3.pot file. Next, copy the ifolder3.pot file to the language you wish to translate. If you were translating to Spanish, you would copy the ifolder3.pot file to es.po. You then need to edit the new .po file and translate all of the strings contained in it with the translated equivalents. Each string that needs to be translated has an entry in the file that looks like this:
#: src/LinuxClient/library/AccountDialog.cs:190 msgid "Used space on server:" msgstr ""
The translated string should be added to the msgstr line. The actual translation of this string would look like this (and I have no idea if that is the correct translation):
#: src/LinuxClient/library/AccountDialog.cs:190 msgid "Used space on server:" msgstr "Espacio usado en el servidor:"
The section at the top of the .po file also needs to be updated to include the correct charset used (normally UTF-8), the translator information and the package version. If those fields are not updated, the .po compilation will fail.
The final step in adding a new language is updating the Makefile.am. The POFILES variable needs to contain a line for the new .po you are adding. The make system will then begin to generate a .mo file (Machine Object) from your .po file and will install it to the correct location. If you set the LANG environment variable to your .po file's language, iFolder will run and display the newly translated strings.
Adding new strings and/or files
The iFolder Linux Client uses GNU gettext to load all of its strings. We have included a utility class that takes care of everything that needs to happen in order to load the correct languages. If you have new strings to add to any of the source files, you need to wrap the strings in a Util.GS() method. If you were setting the iFolder status to be displayed as "Idle..." the statement might look like this:
UpdateStatus(Utils.GS("Idle..."));
The Make system will parse out all strings that are wrapped in Util.GS and add them to the iFolder.pot file AND all .po files that are listed in the Makefile.am. This way, new strings get added to existing language .po files but without the translated versions. You can search the .po files for msgstr followed by a blank string "" and you'll find all of the new strings that need to be translated.
If you are adding a new file to the iFolder client and it contains strings that need to be translated, make sure you add the file to the src/LinuxClient/po/POTFILES.in file. Be sure to use the full path of the file from the root of the project.
