diff options
author | Damien Picard <pioverfour> | 2022-08-22 16:33:39 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-22 16:34:27 +0300 |
commit | 0b2be4fbc348c22fe4140ee8517892c44996da34 (patch) | |
tree | a3df504f4a8b907fc861478f8b8b76028ad1ac01 /release/scripts/startup | |
parent | 4ad471d67fee18516a09056c6794da1e84d58cd0 (diff) |
I18n: Fix lighting preferences error messages
While the current situation sort of works, a proper translation cannot
be achieved in every language. Separate messages for each lighting
type.
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index a42c38c64c2..8af36d0bca9 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -5,8 +5,11 @@ from bpy.types import ( Menu, Panel, ) -from bpy.app.translations import pgettext_iface as iface_ -from bpy.app.translations import contexts as i18n_contexts +from bpy.app.translations import ( + contexts as i18n_contexts, + pgettext_iface as iface_, + pgettext_tip as tip_, +) # ----------------------------------------------------------------------------- @@ -2090,7 +2093,10 @@ class StudioLightPanelMixin: for studio_light in lights: self.draw_studio_light(flow, studio_light) else: - layout.label(text=iface_("No custom %s configured") % self.bl_label) + layout.label(text=self.get_error_message()) + + def get_error_message(self): + return tip_("No custom %s configured") % self.bl_label def draw_studio_light(self, layout, studio_light): box = layout.box() @@ -2117,6 +2123,9 @@ class USERPREF_PT_studiolight_matcaps(StudioLightPanel, StudioLightPanelMixin, P layout.operator("preferences.studiolight_install", icon='IMPORT', text="Install...").type = 'MATCAP' layout.separator() + def get_error_message(self): + return tip_("No custom MatCaps configured") + class USERPREF_PT_studiolight_world(StudioLightPanel, StudioLightPanelMixin, Panel): bl_label = "HDRIs" @@ -2127,6 +2136,9 @@ class USERPREF_PT_studiolight_world(StudioLightPanel, StudioLightPanelMixin, Pan layout.operator("preferences.studiolight_install", icon='IMPORT', text="Install...").type = 'WORLD' layout.separator() + def get_error_message(self): + return tip_("No custom HDRIs configured") + class USERPREF_PT_studiolight_lights(StudioLightPanel, StudioLightPanelMixin, Panel): bl_label = "Studio Lights" @@ -2139,6 +2151,9 @@ class USERPREF_PT_studiolight_lights(StudioLightPanel, StudioLightPanelMixin, Pa op.filter_glob = ".sl" layout.separator() + def get_error_message(self): + return tip_("No custom Studio Lights configured") + class USERPREF_PT_studiolight_light_editor(StudioLightPanel, Panel): bl_label = "Editor" |