def update_translations(include_plugins=False):
 translations_folder = os.path.join(current_app.root_path, 'translations')
 source_file = os.path.join(translations_folder, 'messages.pot')
 subprocess.call(['pybabel', 'extract', '-F', 'babel.cfg', '-k', 'lazy_gettext', '-o', source_file, '.'])
 subprocess.call(['pybabel', 'update', '-i', source_file, '-d', translations_folder])
 if include_plugins:
  for plugin in plugin_manager.all_plugins:
   update_plugin_translations(plugin)

def update_translations ( include_plugins = False ) : translations_folder = os . path . join ( current_app . root_path , 'translations' ) source_file = os . path . join ( translations_folder , 'messages.pot' ) subprocess . call ( [ 'pybabel' , 'extract' , '-F' , 'babel.cfg' , '-k' , 'lazy_gettext' , '-o' , source_file , '.' ] ) subprocess . call ( [ 'pybabel' , 'update' , '-i' , source_file , '-d' , translations_folder ] ) if include_plugins : for plugin in plugin_manager . all_plugins : update_plugin_translations ( plugin )
update translations from a source and target file for a given language .