From fb2f5b3a6417bcbc4221d0ec54a5022379607ccc Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 23 Sep 2025 17:23:25 +0200 Subject: [PATCH] I18n: Translate dynamic enum items from glTF exporter These dynamic enum items cannot be extracted automatically, so mark them manually. Reported by Ye Gui in #43295. --- .../addons_core/io_scene_gltf2/__init__.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/addons_core/io_scene_gltf2/__init__.py b/scripts/addons_core/io_scene_gltf2/__init__.py index 7ca3001b15b..9e057c8cdd9 100755 --- a/scripts/addons_core/io_scene_gltf2/__init__.py +++ b/scripts/addons_core/io_scene_gltf2/__init__.py @@ -56,6 +56,7 @@ from bpy.props import (StringProperty, CollectionProperty) from bpy.types import Operator from bpy_extras.io_utils import ImportHelper, ExportHelper, poll_file_object_drop +from bpy.app.translations import pgettext_n as n_ # @@ -136,20 +137,20 @@ def on_export_action_filter_changed(self, context): def get_format_items(scene, context): - items = (('GLB', 'glTF Binary (.glb)', - 'Exports a single file, with all data packed in binary form. ' - 'Most efficient and portable, but more difficult to edit later'), - ('GLTF_SEPARATE', 'glTF Separate (.gltf + .bin + textures)', - 'Exports multiple files, with separate JSON, binary and texture data. ' - 'Easiest to edit later')) + items = (('GLB', n_('glTF Binary (.glb)'), + n_('Exports a single file, with all data packed in binary form. ' + 'Most efficient and portable, but more difficult to edit later')), + ('GLTF_SEPARATE', n_('glTF Separate (.gltf + .bin + textures)'), + n_('Exports multiple files, with separate JSON, binary and texture data. ' + 'Easiest to edit later'))) addon_preferences = bpy.context.preferences.addons['io_scene_gltf2'].preferences if addon_preferences and addon_preferences.allow_embedded_format: # At initialization, the preferences are not yet loaded # The second line check is needed until the PR is merge in Blender, for github CI tests - items += (('GLTF_EMBEDDED', 'glTF Embedded (.gltf)', - 'Exports a single file, with all data packed in JSON. ' - 'Less efficient than binary, but easier to edit later' + items += (('GLTF_EMBEDDED', n_('glTF Embedded (.gltf)'), + n_('Exports a single file, with all data packed in JSON. ' + 'Less efficient than binary, but easier to edit later') ),) return items