Cleanup: I18n: remove operator categories from the translation files #107700
|
@ -384,7 +384,6 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
|
||||||
walk_keymap_hierarchy(lvl[3], msgsrc)
|
walk_keymap_hierarchy(lvl[3], msgsrc)
|
||||||
|
|
||||||
# Dump Messages
|
# Dump Messages
|
||||||
operator_categories = {}
|
|
||||||
|
|
||||||
def process_cls_list(cls_list):
|
def process_cls_list(cls_list):
|
||||||
if not cls_list:
|
if not cls_list:
|
||||||
|
@ -411,15 +410,6 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
|
||||||
bl_rna = bl_rna.base
|
bl_rna = bl_rna.base
|
||||||
return cls_id
|
return cls_id
|
||||||
|
|
||||||
def operator_category(cls):
|
|
||||||
"""Extract operators' categories, as displayed in 'search' space menu."""
|
|
||||||
# NOTE: keep in sync with C code in ui_searchbox_region_draw_cb__operator().
|
|
||||||
if issubclass(cls, bpy.types.OperatorProperties) and "_OT_" in cls.__name__:
|
|
||||||
cat_id = cls.__name__.split("_OT_")[0]
|
|
||||||
if cat_id not in operator_categories:
|
|
||||||
cat_str = cat_id.capitalize() + ":"
|
|
||||||
operator_categories[cat_id] = cat_str
|
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print(cls_list)
|
print(cls_list)
|
||||||
cls_list.sort(key=full_class_id)
|
cls_list.sort(key=full_class_id)
|
||||||
|
@ -431,7 +421,6 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
|
||||||
if (cls in blacklist_rna_class) or issubclass(cls, bpy.types.Operator):
|
if (cls in blacklist_rna_class) or issubclass(cls, bpy.types.Operator):
|
||||||
reports["rna_structs_skipped"].append(cls)
|
reports["rna_structs_skipped"].append(cls)
|
||||||
else:
|
else:
|
||||||
operator_category(cls)
|
|
||||||
walk_class(cls)
|
walk_class(cls)
|
||||||
# Recursively process subclasses.
|
# Recursively process subclasses.
|
||||||
process_cls_list(cls.__subclasses__())
|
process_cls_list(cls.__subclasses__())
|
||||||
|
@ -446,11 +435,6 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
|
||||||
# Parse everything (recursively parsing from bpy_struct "class"...).
|
# Parse everything (recursively parsing from bpy_struct "class"...).
|
||||||
process_cls_list(bpy.types.ID.__base__.__subclasses__())
|
process_cls_list(bpy.types.ID.__base__.__subclasses__())
|
||||||
|
|
||||||
# Finalize generated 'operator categories' messages.
|
|
||||||
for cat_str in operator_categories.values():
|
|
||||||
process_msg(msgs, bpy.app.translations.contexts.operator_default, cat_str, "Generated operator category",
|
|
||||||
reports, check_ctxt_rna, settings)
|
|
||||||
|
|
||||||
# Parse keymap preset preferences
|
# Parse keymap preset preferences
|
||||||
for preset_filename in sorted(
|
for preset_filename in sorted(
|
||||||
os.listdir(os.path.join(settings.PRESETS_DIR, "keyconfig"))):
|
os.listdir(os.path.join(settings.PRESETS_DIR, "keyconfig"))):
|
||||||
|
|
Loading…
Reference in New Issue