def add_plugin_translations(plugin, translation):
 plugin_folder = os.path.join(current_app.config['PLUGINS_FOLDER'], plugin)
 translations_folder = os.path.join(plugin_folder, 'translations')
 source_file = os.path.join(translations_folder, 'messages.pot')
 subprocess.call(['pybabel', 'extract', '-F', 'babel.cfg', '-k', 'lazy_gettext', '-o', source_file, plugin_folder])
 subprocess.call(['pybabel', 'init', '-i', source_file, '-d', translations_folder, '-l', translation])

def add_plugin_translations ( plugin , translation ) : plugin_folder = os . path . join ( current_app . config [ 'PLUGINS_FOLDER' ] , plugin ) translations_folder = os . path . join ( plugin_folder , 'translations' ) source_file = os . path . join ( translations_folder , 'messages.pot' ) subprocess . call ( [ 'pybabel' , 'extract' , '-F' , 'babel.cfg' , '-k' , 'lazy_gettext' , '-o' , source_file , plugin_folder ] ) subprocess . call ( [ 'pybabel' , 'init' , '-i' , source_file , '-d' , translations_folder , '-l' , translation ] )
adds a new language to the plugin translations .