[IMP] The command line option --i18n-overwrite can also be used when updating modules

bzr revid: olivier.ligot@groupes.be-20110209100845-ldgoxolfz98k3mnu
This commit is contained in:
Olivier Ligot 2011-02-09 11:08:45 +01:00
parent 14ebc46e3a
commit bafa90b716
2 changed files with 4 additions and 4 deletions

View File

@ -779,7 +779,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
modobj.write(cr, 1, [mid], {'state': 'installed', 'latest_version': ver})
cr.commit()
# Update translations for all installed languages
modobj.update_translations(cr, 1, [mid], None)
modobj.update_translations(cr, 1, [mid], None, {'overwrite': tools.config['overwrite_existing_translations']})
cr.commit()
package.state = 'installed'

View File

@ -217,7 +217,7 @@ class configmanager(object):
group.add_option("--i18n-import", dest="translate_in",
help="import a CSV or a PO file with translations and exit. The '-l' option is required.")
group.add_option("--i18n-overwrite", dest="overwrite_existing_translations", action="store_true", default=False,
help="overwrites existing translation terms on importing a CSV or a PO file.")
help="overwrites existing translation terms on updating a module or importing a CSV or a PO file.")
group.add_option("--modules", dest="translate_modules",
help="specify modules to export. Use in combination with --i18n-export")
group.add_option("--addons-path", dest="addons_path",
@ -264,8 +264,8 @@ class configmanager(object):
die(opt.translate_in and (not opt.language or not opt.db_name),
"the i18n-import option cannot be used without the language (-l) and the database (-d) options")
die(opt.overwrite_existing_translations and (not opt.translate_in),
"the i18n-overwrite option cannot be used without the i18n-import option")
die(opt.overwrite_existing_translations and not (opt.translate_in or opt.update),
"the i18n-overwrite option cannot be used without the i18n-import option or without the update option")
die(opt.translate_out and (not opt.db_name),
"the i18n-export option cannot be used without the database (-d) option")