I have created localization files for language Khmer(km) for the following custom addon. I have followed all recommended settings for declaration of l18n namespace and marked the strings with '_'.
However the localization strings are not picked up when you request for the translated language Khmer (km).
Using the debug shell I tried to see if the language strings are translated:
>>> site = app.plone
>>> site
<PloneSite at /plone>
>>> translation_service = site.translation_service
>>> translation_service.translate("A Person", domain="popolo.contenttypes", target_language="km")
'A Person'
Wonder if someone could tell me what am I missing?
Hi @arky – does the translation work if you choose a different language? I'm missing some context here: are you creating a new translation or are you trying to add translation capability to your add-on, or both? If both, maybe try to test one before you test both?
I could load other translations such German locale of Plone core and also addons with German, Dutch, Finnish from collective addons. Only the language localization Khmer(km) from my custom addon does not load.
My guess is that 'zope_i18n_compile_mo_files true' is not building and loading the localization strings.
So what worked for me so far is adding 'precompile' step to the buildout to load the custom localizations. There might be simpler way to load locales, if so please let me know.
Also adding a custom 'plone.pot' file to translate the strings in XML files solved the problem of untranslated string in toolbar (Thanks @jensens)