Good question! The official reference for creating OpenERP localization modules is this page of the documentation. However it does not explain how to translate a localization module, because ironically, localization modules seldom need to be translated.
A bit of context: Contrasting with the way generic OpenERP modules are written, the localization modules of monolingual countries have the names of the taxes, G/L accounts, etc. directly defined in the country's language, rather than defined in English and then translated in .po files. In fact the OpenERP models for localization data (tax templates, account templates, etc.) have the translation flag voluntarily turned off. The reason is simple: if the names of these items were always translatable, they would appear in the list of terms to translate for all OpenERP translations! Imagine the mess if each translator team was asked to translate in their language the names of all taxes and G/L account of the world, something perfectly useless.
Belgium being one of the lucky multilingual countries, there is however an (experimental) way to make your chart of accounts translatable.
The solution is threefold:
Your l10n_xx module must depend on the l10n_multilang
module. This small module turns the translation flag on for most of the fields that you would want to translate in a chart of account. It also adds a special spoken_languages
field on the Chart of Accounts Template model, and will automatically try to load the corresponding translations when that chart of accounts is installed (provided these languages have been installed previously in the same database)
You must add a spoken_languages
field to the XML declaration of your chart of accounts. Its value must be a semicolon-separated list of language codes, where each code is the value of the code
field of that language when it is installed in OpenERP. You can see the list of all available language codes in the source. For example if you wanted to add a French and a German translation for your Chart of Accounts, you could use the following value XML field:
<field name="spoken_languages">fr_FR;de_DE</field>
Last but not least, you need to actually create the translation files, similarly to what you'd do for any other OpenERP module. You should ideally use English names in the master data files, arguably awkward if English is not one of the official country languages, so using one of the official languages of your country will work too. Then export the l10n_xx.pot
PO Template file by using the translation export wizard inside OpenERP (select your module and no language in the export wizard), and put it in the l10n_xx/i18n/
directory of your module. Finally you can create the initial translations by duplicating the l10n_xx.pot
for each desired language (e.g. fr.po
for French, etc.), and filling in the translations using a PO Editor such as Poedit.
Check out the documentation about OpenERP translations for more details on the PO/POT file format and organization, as well as DReispt's related question (already mentioned).
After performing the above steps, the translations should be loaded automatically in each database where you install your localization module (but make sure to install all the relevant languages before installing the Chart of Account)
This technique is still a bit experimental, so don't hesitate to report bugs if it doesn't seem to work as described.
PS: Obviously all of this should be mentioned in the official OpenERP localization documentation, so if someone feels like doing it, remember that the documentation is open and anyone can directly contribute to it ;-)