diff options
-rw-r--r-- | intern/cycles/blender/addon/operators.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/screen_play_rendered_anim.py | 12 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_output.py | 6 |
3 files changed, 16 insertions, 7 deletions
diff --git a/intern/cycles/blender/addon/operators.py b/intern/cycles/blender/addon/operators.py index 63c61c4799e..e75d3ab7549 100644 --- a/intern/cycles/blender/addon/operators.py +++ b/intern/cycles/blender/addon/operators.py @@ -20,6 +20,8 @@ import bpy from bpy.types import Operator from bpy.props import StringProperty +from bpy.app.translations import pgettext_tip as tip_ + class CYCLES_OT_use_shading_nodes(Operator): """Enable nodes on a material, world or light""" @@ -98,7 +100,8 @@ class CYCLES_OT_denoise_animation(Operator): if not os.path.isfile(filepath): scene.render.filepath = original_filepath - self.report({'ERROR'}, f"Frame '{filepath}' not found, animation must be complete.") + err_msg = tip_("Frame '%s' not found, animation must be complete") % filepath + self.report({'ERROR'}, err_msg) return {'CANCELLED'} scene.render.filepath = out_filepath diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index 3a7199120a6..3569b4d76f5 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -24,6 +24,8 @@ import bpy from bpy.types import Operator import os +from bpy.app.translations import pgettext_tip as tip_ + def guess_player_path(preset): import sys @@ -114,15 +116,17 @@ class PlayRenderedAnim(Operator): file = rd.frame_path(frame=scene.frame_start, preview=scene.use_preview_range) file = bpy.path.abspath(file) # expand '//' if not os.path.exists(file): - self.report({'WARNING'}, f"File {file!r} not found") + err_msg = tip_("File %s not found") % file + self.report({'WARNING'}, err_msg) path_valid = False # one last try for full range if we used preview range if scene.use_preview_range and not path_valid: file = rd.frame_path(frame=scene.frame_start, preview=False) file = bpy.path.abspath(file) # expand '//' + err_msg = tip_("File %s not found") % file if not os.path.exists(file): - self.report({'WARNING'}, f"File {file!r} not found") + self.report({'WARNING'}, err_msg) cmd = [player_path] # extra options, fps controls etc. @@ -179,10 +183,10 @@ class PlayRenderedAnim(Operator): try: subprocess.Popen(cmd, env=env_copy) except Exception as e: + err_msg = tip_("Couldn't run external animation player with command %s\n%s") % (cmd, e) self.report( {'ERROR'}, - "Couldn't run external animation player with command " - f"{cmd!r}\n{e!s}", + err_msg, ) return {'CANCELLED'} diff --git a/release/scripts/startup/bl_ui/properties_output.py b/release/scripts/startup/bl_ui/properties_output.py index 7a05f13b9f2..9a710fd9419 100644 --- a/release/scripts/startup/bl_ui/properties_output.py +++ b/release/scripts/startup/bl_ui/properties_output.py @@ -22,6 +22,8 @@ import bpy from bpy.types import Menu, Panel, UIList from bl_ui.utils import PresetPanel +from bpy.app.translations import pgettext_tip as tip_ + class RENDER_PT_presets(PresetPanel, Panel): bl_label = "Render Presets" @@ -81,10 +83,10 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel): custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60}) if custom_framerate is True: - fps_label_text = f"Custom ({fps_rate!r} fps)" + fps_label_text = tip_("Custom (%.4g fps)") % fps_rate show_framerate = True else: - fps_label_text = f"{fps_rate!r} fps" + fps_label_text = tip_("%.4g fps") % fps_rate show_framerate = (preset_label == "Custom") RENDER_PT_dimensions._frame_rate_args_prev = args |