I develop a translation helper page in my pyramid based application.
A new translation is saved in .po
and .mo
files via this:
po = polib.pofile(join(root, 'locale', lang, 'LC_MESSAGES', 'myapp.po'))
.....
po.save(join(root, 'locale', lang, 'LC_MESSAGES', 'myapp.po'))
po.save_as_mofile(join(root, 'locale', lang, 'LC_MESSAGES', 'myapp.mo'))
But the new translation does not take effect until I restart the application.
I need to reload the translation file right after the new translation file is saved without restarting the wsgi application.