oTree Forum >

Translation of app using .po files

#1 by tobias

I've been trying to translate my otree app using .po-files. 

Whenever I change the LANGUAGE_CODE in settings.py, it does indeed change the language of all the buttons (through the locale folder from otree). However, it does not change the language of the text of my app. Any ideas of what could be wrong? I have tried setting the LOCALE_PATHS but without any luck.

I was using this github project as a guide, where I face the same problem. Any hint would be appreciated.




Any hint is appreciated.

#2 by olafghanizadeh

I was able to dynamic translation of templates in this code: https://github.com/olafghanizadeh/hl_mpl

You can pass full strings and add to the PO file, but also translate directly in the template with conditional logic, which I found to be more practical in that particular case.

Write a reply

Set forum username