Python-i18n
Easy to use i18n library for Python
Basic usage
The simplest, though not very useful usage would be
Using translation files
YAML and JSON formats are supported to store translations. With the default configuration, if you have the following foo.en.yml file
in /path/to/translations
folder, you simply need to add the folder to the translations path.
Please note that YAML format is used as default file format if you have yaml module installed. If both yaml and json modules available and you want to use JSON to store translations, explicitly specify that:
Memoization
Setting the configuration value enable_memoization
in the settings dir will load the files from disk the first time they are loaded and then store their content in memory. On the next use the file content will be provided from memory and not loaded from disk, preventing disk access. While this can be useful in some contexts, keep in mind there is no current way of issuing a command to the reloader to re-read the files from disk, so if you are updating your translation file without restarting the interpreter do not use this option.