core (tools/common/template): i18n support
- babel has been added as a new dependencies, and should replace gettext in core in the future
- added i18n support in template rendered
- current locale is available as babel Locale in templates through "locale" variable
- locales can be changed before rendering using setLocale
- for now, all locales translations are loaded on init, and stay in cache. A more complex cache system may be needed in the future (e.g. keeping only most used and load others from files when needed).
This commit is contained in:
parent
40e764cab5
commit
c6ea8e7dbe
1 changed files with 53 additions and 3 deletions
2
setup.py
2
setup.py
|
|
@ -304,6 +304,6 @@ setup(name=NAME,
|
|||
],
|
||||
scripts=['frontends/src/jp/jp', 'frontends/src/primitivus/primitivus', ],
|
||||
zip_safe=False,
|
||||
install_requires=['twisted >= 15.2.0', 'wokkel >= 0.7.1', 'progressbar', 'urwid >= 1.2.0', 'urwid-satext >= 0.6.1', 'mutagen', 'pillow', 'lxml >= 3.1.0', 'pyxdg', 'markdown', 'html2text', 'pycrypto >= 2.6.1', 'python-potr', 'PyOpenSSL', 'service_identity', 'shortuuid'],
|
||||
install_requires=['twisted >= 15.2.0', 'wokkel >= 0.7.1', 'progressbar', 'urwid >= 1.2.0', 'urwid-satext >= 0.6.1', 'mutagen', 'pillow', 'lxml >= 3.1.0', 'pyxdg', 'markdown', 'html2text', 'pycrypto >= 2.6.1', 'python-potr', 'PyOpenSSL', 'service_identity', 'shortuuid', 'babel'],
|
||||
cmdclass={'install': CustomInstall},
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue