Translations for ubcpi

Has anyone been able to have the translations working for ubcpi https://github.com/ubc/ubcpi in Juniper?

I saw that some of the translations for .py files were working but the translations in the .html files like ubcpi/static/html/ubcpi.html do not seem to work at all.

I wonder if this has anything to do with the use of the HMTL attribute “translate” in those files instead of ugettext that is traditionally used in html templates in Open edX.

Does any one have any idea?

I did open an issue in https://github.com/ubc/ubcpi/issues/176 but I still have yet to hear from the authors.

And if someone was able to get the translations working in their own language, is there a step missing that I should know about?

Thanks for any information.

1 Like

I might have found the problem. I was using the translations for fr_CA. My instance uses fr (long story since we started with fr before getting the control of fr_CA in Transifex), so I had to tweak the ubcpi/static/js/src/translations.js file so that it recognizes fr_CA and fr to use the same translations. And I had to concatenate the contents of ubcpi/translations/fr_CA/LC_MESSAGES/text.po in edx-platform/conf/locale/fr/LC_MESSAGES/django.po.

Not perfect, but definitely better :grin: