diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-25 18:26:56 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-25 18:26:56 +0300 |
commit | 787e2ddbd765609b6b0992585815c4d00e7419bf (patch) | |
tree | 810658da94b0cfcdfc6b02a8707fcedc3935f36a /release | |
parent | 24b47c00eaabe12b5262b59a185da154a477bd98 (diff) |
Fix T66065: Missing text in the UI translations files due to 'fstring' usages.
Am not even sure that it is possible to use fstrings at all when UI
translation is required (that is, is a sensible, reasonable way that
does not make things even more complicated than they already are), but
one thing is certain, this won't be trivial to get it working, so
definitively not a job for now.
Instead just do not use fstrings for UI translatable strings.
Diffstat (limited to 'release')
-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 |
2 files changed, 12 insertions, 6 deletions
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 |