I18n: fix printf-style format translation in release/scripts/startup
Many reports and a few labels used string formatting without explicitly calling tip_() or iface_(), so the untranslated message was used instead of the translated one, even when it was extracted. Differential Revision: https://developer.blender.org/D16405
This commit is contained in:
@@ -772,7 +772,7 @@ class WM_OT_operator_pie_enum(Operator):
|
||||
try:
|
||||
op_rna = op.get_rna_type()
|
||||
except KeyError:
|
||||
self.report({'ERROR'}, "Operator not found: bpy.ops.%s" % data_path)
|
||||
self.report({'ERROR'}, tip_("Operator not found: bpy.ops.%s") % data_path)
|
||||
return {'CANCELLED'}
|
||||
|
||||
def draw_cb(self, context):
|
||||
@@ -872,7 +872,7 @@ class WM_OT_context_collection_boolean_set(Operator):
|
||||
elif value_orig is False:
|
||||
pass
|
||||
else:
|
||||
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
|
||||
self.report({'WARNING'}, tip_("Non boolean value found: %s[ ].%s") %
|
||||
(data_path_iter, data_path_item))
|
||||
return {'CANCELLED'}
|
||||
|
||||
@@ -975,7 +975,7 @@ class WM_OT_context_modal_mouse(Operator):
|
||||
(item, ) = self._values.keys()
|
||||
header_text = header_text % eval("item.%s" % self.data_path_item)
|
||||
else:
|
||||
header_text = (self.header_text % delta) + " (delta)"
|
||||
header_text = (self.header_text % delta) + tip_(" (delta)")
|
||||
context.area.header_text_set(header_text)
|
||||
|
||||
elif 'LEFTMOUSE' == event_type:
|
||||
@@ -995,7 +995,7 @@ class WM_OT_context_modal_mouse(Operator):
|
||||
self._values_store(context)
|
||||
|
||||
if not self._values:
|
||||
self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" %
|
||||
self.report({'WARNING'}, tip_("Nothing to operate on: %s[ ].%s") %
|
||||
(self.data_path_iter, self.data_path_item))
|
||||
|
||||
return {'CANCELLED'}
|
||||
@@ -1133,7 +1133,7 @@ class WM_OT_path_open(Operator):
|
||||
filepath = os.path.normpath(filepath)
|
||||
|
||||
if not os.path.exists(filepath):
|
||||
self.report({'ERROR'}, "File '%s' not found" % filepath)
|
||||
self.report({'ERROR'}, tip_("File '%s' not found") % filepath)
|
||||
return {'CANCELLED'}
|
||||
|
||||
if sys.platform[:3] == "win":
|
||||
@@ -1204,7 +1204,7 @@ def _wm_doc_get_id(doc_id, *, do_url=True, url_prefix="", report=None):
|
||||
|
||||
if rna_class is None:
|
||||
if report is not None:
|
||||
report({'ERROR'}, iface_("Type \"%s\" can not be found") % class_name)
|
||||
report({'ERROR'}, tip_("Type \"%s\" can not be found") % class_name)
|
||||
return None
|
||||
|
||||
# Detect if this is a inherited member and use that name instead.
|
||||
@@ -1275,9 +1275,9 @@ class WM_OT_doc_view_manual(Operator):
|
||||
if url is None:
|
||||
self.report(
|
||||
{'WARNING'},
|
||||
"No reference available %r, "
|
||||
"Update info in 'rna_manual_reference.py' "
|
||||
"or callback to bpy.utils.manual_map()" %
|
||||
tip_("No reference available %r, "
|
||||
"Update info in 'rna_manual_reference.py' "
|
||||
"or callback to bpy.utils.manual_map()") %
|
||||
self.doc_id
|
||||
)
|
||||
return {'CANCELLED'}
|
||||
@@ -2156,7 +2156,7 @@ class WM_OT_tool_set_by_id(Operator):
|
||||
tool_settings.workspace_tool_type = 'FALLBACK'
|
||||
return {'FINISHED'}
|
||||
else:
|
||||
self.report({'WARNING'}, "Tool %r not found for space %r" % (self.name, space_type))
|
||||
self.report({'WARNING'}, tip_("Tool %r not found for space %r") % (self.name, space_type))
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
@@ -2943,7 +2943,7 @@ class WM_OT_batch_rename(Operator):
|
||||
row.prop(action, "op_remove", text="", icon='REMOVE')
|
||||
row.prop(action, "op_add", text="", icon='ADD')
|
||||
|
||||
layout.label(text=iface_("Rename %d %s") % (len(self._data[0]), self._data[2]))
|
||||
layout.label(text=iface_("Rename %d %s") % (len(self._data[0]), self._data[2]), translate=False)
|
||||
|
||||
def check(self, context):
|
||||
changed = False
|
||||
@@ -3083,7 +3083,7 @@ class WM_MT_splash_quick_setup(Menu):
|
||||
|
||||
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
|
||||
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
|
||||
sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version)
|
||||
sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version, translate=False)
|
||||
sub.operator("wm.save_userpref", text="Save New Settings")
|
||||
else:
|
||||
sub.label()
|
||||
|
||||
Reference in New Issue
Block a user