Internationalization
====================

Products.ATSuccessStory is translated with Zope Toolkits zope.i18n, which in
turn uses gettext. This means the translations are located in
Products/ATSuccessStory/locales. Each languages translations are located in a
directory with the same name as the language code. So English is in
Products/ATSuccessStory/locales/en, and Brazilian portugese in
Products/ATSuccessStory/locales/pt_BR etc. In each language directory there is
a subdirectory LC_MESSAGES, and in that directory are two
files, ATSuccessStory.po and ATSuccessStory.mo.

The ATSuccessStory.po file is the source file, containing all the translations
in plain text, and the ATSuccessStory.mo file is the compiled source file,
which is used by the application.


Translating Products.ATSuccessStory
-----------------------------------

Products.ATSuccessStory is easy to translate. All you need to do is to pick a
ATSuccessStory.po file from a language you understand, and translate it all
msgstr "something" to your own language. Don't forget to change the headers
with your info and the correct language codes. There are tools to help you
with the translation, like KBabel.

Then you give this file to somebody that has checkin rights in the Plone
collective, and he/she will add this translation to Products.ATSuccessStory.


Adding translations
-------------------
If you are that guy, this is what you do:

You create the structure for the new language (ie
Products/ATSuccessStory/locales/<lang>/LC_MESSAGES and copy the new
ATSuccessStory.po file to the new LC_MESSAGES directory.

When you restart the server a file called ATSuccessStory.mo should be created
in the LC_MESSAGES directory. If not, then there is something wrong. Don't
check in ATSuccessStory.mo, the .mo file is to the .po file like the .pyc files
are to .py files.


Extending Products.ATSuccessStory
---------------------------------

If you have added new words in templates that need to be translated, you need
to recreate the ATSuccessStory.pot file, the template for the
ATSuccessStory.po files. This is done by standing in Products/ATSuccessStory/
and running i18ndude. i18ndude is a script for helping translations of Zope
software. It can be installed with easy_install i18ndude. For more infor see
http://pypi.python.org/pypi/i18ndude

The command to update the pot file is 

    i18ndude rebuild-pot --pot locales/ATSuccessStory.pot --merge locales/custom.pot --create ATSuccessStory .

If you have messages that need translated that are not discovered by i18ndude,
add them to the file custom.pot before running the rebuild.

After this you need to synchronize the templates. Start with one language:

    i18ndude sync --pot locales/ATSuccessStory.pot locales/XX/LC_MESSAGES/ATSuccessStory.po

Translate the new messages, compile with msgfmt (see above) and test it out.
Testing is most easily done by setting the only supported language in 
portal_languages to the language you want to test.

Since all messages should be in English as default, if the only language you
do know is English, you will not see if that message was properly translated
or not. In that case you need to test with another language, but you can put
in nonsens as translations, to make sure it works, and then remove that
nonsense, once everything work. In any case, please keep the English
translation up to date.

When the translations works to your satisfaction, sync all the other languages
as well, and notify the translators that you need an updated translation.
