I18n: Extract and disambiguate a few messages

Disambiguate
- "Thickness": use "Material" for EEVEE's thickness material setting.
- "Generated": use "Texture" for texture coordinates, "Image" for
  image source, keep default context for animation keyframe types.

Translate
- Split "Online access required to (check for|install) updates..."
  into 2x2 messages individually translatable.
- "Geometry" input in bake node.
- "New" for the Palette ID: extract it as part of the
   BLT_I18N_MSGID_MULTI_CTXT for "New".

Some issues reported by Gabriel Gazzán and Satoshi Yamasaki.

Pull Request: https://projects.blender.org/blender/blender/pulls/123404
This commit is contained in:
Damien Picard
2024-06-15 14:11:45 +02:00
committed by Gitea
parent 26cdf7e340
commit f739d4832e
10 changed files with 28 additions and 15 deletions

View File

@@ -33,6 +33,8 @@ from bpy.props import (
)
from bpy.app.translations import (
pgettext_iface as iface_,
pgettext_rpt as rpt_,
)
from . import (
@@ -1060,7 +1062,7 @@ def _repo_dir_and_index_get(repo_index, directory, report_fn):
return directory
def _extensions_maybe_online_action_poll_impl(cls, repo, action_text):
def _extensions_maybe_online_action_poll_impl(cls, repo, action):
if repo is not None:
if not repo.enabled:
@@ -1076,13 +1078,19 @@ def _extensions_maybe_online_action_poll_impl(cls, repo, action_text):
if online_access_required:
if not bpy.app.online_access:
cls.poll_message_set(
"Online access required to {:s}. {:s}".format(
action_text,
"Launch Blender without --offline-mode" if bpy.app.online_access_override else
"Enable online access in System preferences"
)
)
# Split message into sentences for i18n.
match action:
case 'CHECK_UPDATES':
message = rpt_("Online access required to check for updates.")
case 'INSTALL_UPDATES':
message = rpt_("Online access required to install updates.")
case _:
assert False, "Unreachable"
if bpy.app.online_access_override:
message += " " + rpt_("Launch Blender without --offline-mode")
else:
message += " " + rpt_("Enable online access in System preferences")
cls.poll_message_set(message)
return False
repos_all = extension_repos_read(use_active_only=False)
@@ -1290,7 +1298,7 @@ class EXTENSIONS_OT_repo_sync_all(Operator, _ExtCmdMixIn):
@classmethod
def poll(cls, context):
repo = getattr(context, "extension_repo", None)
return _extensions_maybe_online_action_poll_impl(cls, repo, "check for updates")
return _extensions_maybe_online_action_poll_impl(cls, repo, action='CHECK_UPDATES')
@classmethod
def description(cls, _context, props):
@@ -1485,7 +1493,7 @@ class EXTENSIONS_OT_package_upgrade_all(Operator, _ExtCmdMixIn):
cls.poll_message_set("Upgrade is not supported for local repositories")
return False
return _extensions_maybe_online_action_poll_impl(cls, repo, "install updates")
return _extensions_maybe_online_action_poll_impl(cls, repo, action='INSTALL_UPDATES')
@classmethod
def description(cls, _context, props):

View File

@@ -201,7 +201,6 @@ class EEVEE_MATERIAL_PT_volume(MaterialButtonsPanel, Panel):
class EEVEE_MATERIAL_PT_displacement(MaterialButtonsPanel, Panel):
bl_label = "Displacement"
bl_translation_context = i18n_contexts.id_id
bl_context = "material"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_EEVEE_NEXT'}
@@ -224,7 +223,7 @@ class EEVEE_MATERIAL_PT_displacement(MaterialButtonsPanel, Panel):
class EEVEE_MATERIAL_PT_thickness(MaterialButtonsPanel, Panel):
bl_label = "Thickness"
bl_translation_context = i18n_contexts.id_id
bl_translation_context = i18n_contexts.id_material
bl_context = "material"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE_NEXT'}