oTree Forum >

Template Localization and Lazy translation

#1 by joefound

I am porting a multi language application to Otree 5.10 . Since the old application were relying on .PO files I would like to maintain the same .PO files wherever possible.
I am using pybabel with otree/locale/babel.ini (that rely on extract_otreetemplate_internal) to generate the .pot file.
When adding a new translated paragraph to a template file using {{ trans 'my text here' }}, the paragraph 'my text here' is not added to the generated .pot file. if I replace it with {{ 'my text here'|gettext }}, the paragraph is added to the .pot file but then the translated paragraph is not picked up when the application is running, unless I revert it back to  {{ trans 'my text here' }}.

From the documentation in pypy.org I am not clear if the advice is to add the new translations to the .po files that are included in otree rather than my locally generated ones. In this case how to deploy them on Heroku ?

On the topic of lazy translation + .PO files, what is the current approach to run a multi-language application where the players use a different language that select on the first app?

Thank you to all who have a look!


Write a reply

Set forum username