Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
| Show First 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | for dpath, _, fnames in os.walk(settings.PRESETS_DIR): | ||||
| if fname.startswith("_") or not fname.endswith(".py"): | if fname.startswith("_") or not fname.endswith(".py"): | ||||
| continue | continue | ||||
| path = os.path.join(dpath, fname) | path = os.path.join(dpath, fname) | ||||
| try: # can't always find the relative path (between drive letters on windows) | try: # can't always find the relative path (between drive letters on windows) | ||||
| rel_path = os.path.relpath(path, settings.PRESETS_DIR) | rel_path = os.path.relpath(path, settings.PRESETS_DIR) | ||||
| except ValueError: | except ValueError: | ||||
| rel_path = path | rel_path = path | ||||
| files.append(rel_path) | files.append(rel_path) | ||||
| for rel_path in files: | for rel_path in sorted(files): | ||||
| msgsrc, msgid = os.path.split(rel_path) | msgsrc, msgid = os.path.split(rel_path) | ||||
| msgsrc = "Preset from " + msgsrc | msgsrc = "Preset from " + msgsrc | ||||
| msgid = bpy.path.display_name(msgid, title_case=False) | msgid = bpy.path.display_name(msgid, title_case=False) | ||||
| process_msg(msgs, settings.DEFAULT_CONTEXT, msgid, msgsrc, reports, None, settings) | process_msg(msgs, settings.DEFAULT_CONTEXT, msgid, msgsrc, reports, None, settings) | ||||
| ##### Main functions! ##### | ##### Main functions! ##### | ||||
| def dump_messages(do_messages, do_checks, settings): | def dump_messages(do_messages, do_checks, settings): | ||||
| ▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines | |||||