diff options
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/bl_extract_messages.py')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/bl_extract_messages.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index bfc111dd3c1..d7755532614 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -853,6 +853,25 @@ def dump_src_messages(msgs, reports, settings): dump_src_file(path, rel_path, msgs, reports, settings) +def dump_preset_messages(msgs, reports, settings): + files = [] + for dpath, _, fnames in os.walk(settings.PRESETS_DIR): + for fname in fnames: + if fname.startswith("_") or not fname.endswith(".py"): + continue + path = os.path.join(dpath, fname) + try: # can't always find the relative path (between drive letters on windows) + rel_path = os.path.relpath(path, settings.PRESETS_DIR) + except ValueError: + rel_path = path + files.append(rel_path) + for rel_path in files: + msgsrc, msgid = os.path.split(rel_path) + msgsrc = "Preset from " + msgsrc + msgid = bpy.path.display_name(msgid, title_case=False) + process_msg(msgs, settings.DEFAULT_CONTEXT, msgid, msgsrc, reports, None, settings) + + ##### Main functions! ##### def dump_messages(do_messages, do_checks, settings): bl_ver = "Blender " + bpy.app.version_string @@ -885,6 +904,9 @@ def dump_messages(do_messages, do_checks, settings): # Get strings from C source code. dump_src_messages(msgs, reports, settings) + # Get strings from presets. + dump_preset_messages(msgs, reports, settings) + # Get strings from addons' categories. for uid, label, tip in bpy.types.WindowManager.addon_filter.keywords['items']( bpy.context.window_manager, |