[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:
parent
14ebc46e3a
commit
bafa90b716
|
@ -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})
|
modobj.write(cr, 1, [mid], {'state': 'installed', 'latest_version': ver})
|
||||||
cr.commit()
|
cr.commit()
|
||||||
# Update translations for all installed languages
|
# 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()
|
cr.commit()
|
||||||
|
|
||||||
package.state = 'installed'
|
package.state = 'installed'
|
||||||
|
|
|
@ -217,7 +217,7 @@ class configmanager(object):
|
||||||
group.add_option("--i18n-import", dest="translate_in",
|
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.")
|
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,
|
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",
|
group.add_option("--modules", dest="translate_modules",
|
||||||
help="specify modules to export. Use in combination with --i18n-export")
|
help="specify modules to export. Use in combination with --i18n-export")
|
||||||
group.add_option("--addons-path", dest="addons_path",
|
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),
|
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")
|
"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),
|
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")
|
"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),
|
die(opt.translate_out and (not opt.db_name),
|
||||||
"the i18n-export option cannot be used without the database (-d) option")
|
"the i18n-export option cannot be used without the database (-d) option")
|
||||||
|
|
Loading…
Reference in New Issue