Hi all, My question is regarding i18n in Python. From what I understand, it involves:
- Create a messages file per language (ONLY ONE?!).
- in this file, each message will be of the format
English message here
Message en Francais ici
(yea crappy french..)
- then have this file compiled into another faster binary format
- repeat for all other langs needed
- in app code (
Django
) use the translate method with english (or default) language which will be translated correctly based on locale...tr('English message Here')
Probably I'm a bit off on the steps, but this seems to be the general sense right?
What I'm wondering is, is there a simpler way? I mean in the java webapp world, you set up message bundle files in the bundleName_locale.properties
format. In each one you usually have a key to message relation like greeting = Hello World.
You can have lots of different properties files for different sub sections of your site/app. All the locale files are hierarchical, and missing keys in a sub locale fall through to the parent etc. This is all done automatically by Java, no setup required.
Is there anything like this in the Django/Python world? Is this just insane to follow this route? Could I fake this using a module as a stand in for a java .properties file? Sorry for the long-winded question, and thanks for any input.