I just started my new project right now, however I can't find any documentation on how I should proceed to accept translations on it.
- how I should proceed to accept translations through the launchpad.net?
- I really need to create a Translation group to start accept this kind of contribution?
I do not care if you are a translator or developer, I'm really interested in hearing from both sides. So, go make your answer below and don't forget to suggest best practices too. Thanks!
Launchpad translations uses a free software translation system called GNU gettext. This is available as a library for pretty much any programming language you decide to use. Normally, the syntax is something like:
This will translate the string for the user using their locale. If there is no translation for their locale the English string is used.
There will probably be tools for your specific language to extract these strings to translate from your code and put them in a .pot file. A .pot file contains information about the strings that need to be translated. It can also contains licencing information at the top (this is required to be a BSD licence for use in Launchpad) and comments for the translators.
Once you have your pot file, you should put it in a po/ directory in the root of your source code. The pot file should be named
textdomain.pot
. When using gettext in your code, you will need to specify the text domain - see the gettext documentation for your programming language for more details. Normally, the text domain is the same as the name of your software package.Once you have the po/ directory and pot file, you can import them into Launchpad.
In the translations tab of your project you should set Launchpad to manage your translations.
Also, set up the import from your code branch.
Once this is done, translators will be able to translate the strings in your pot file into their language.