'Load local translations from *.po files, as a temporary solution
until we have established a valid session. This is meant only
for translating the login page and db management chrome, using
the browser\'s language.'

@http.route('/web/webclient/bootstrap_translations', type='json', auth='none')
def bootstrap_translations(self, mods):

    lang = request.lang.split('_')[0]
    translations_per_module = {}
    for addon_name in mods:
        if http.addons_manifest[addon_name].get('bootstrap'):
            addons_path = http.addons_manifest[addon_name]['addons_path']
            f_name = os.path.join(addons_path, addon_name, 'i18n', (lang + '.po'))
            if (not os.path.exists(f_name)):
                continue
            translations_per_module[addon_name] = {'messages': _local_web_translations(f_name)}
    return {'modules': translations_per_module, 'lang_parameters': None}
