Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
| Show First 20 Lines • Show All 912 Lines • ▼ Show 20 Lines | def dump_messages(do_messages, do_checks, settings): | ||||
| dump_py_messages(msgs, reports, addons, settings) | dump_py_messages(msgs, reports, addons, settings) | ||||
| # Get strings from C source code. | # Get strings from C source code. | ||||
| dump_src_messages(msgs, reports, settings) | dump_src_messages(msgs, reports, settings) | ||||
| # Get strings from presets. | # Get strings from presets. | ||||
| dump_preset_messages(msgs, reports, settings) | dump_preset_messages(msgs, reports, settings) | ||||
| # Get strings from addons' bl_info. | |||||
| import addon_utils | |||||
| for module in addon_utils.modules(): | |||||
| bl_info = module.bl_info | |||||
| if module.bl_info['support'] != 'OFFICIAL': | |||||
| continue | |||||
| for prop in ('name', 'location', 'description'): | |||||
| process_msg(msgs, settings.DEFAULT_CONTEXT, module.bl_info[prop], "Add-ons " + module.bl_info['name'], reports, None, settings) | |||||
mont29: Would be a bit more specific here, something like this maybe?
`Add-on " + module.bl_info… | |||||
| # Get strings from addons' categories. | # Get strings from addons' categories. | ||||
| for uid, label, tip in bpy.types.WindowManager.addon_filter.keywords['items']( | for uid, label, tip in bpy.types.WindowManager.addon_filter.keywords['items']( | ||||
| bpy.context.window_manager, | bpy.context.window_manager, | ||||
| bpy.context, | bpy.context, | ||||
| ): | ): | ||||
| process_msg(msgs, settings.DEFAULT_CONTEXT, label, "Add-ons' categories", reports, None, settings) | process_msg(msgs, settings.DEFAULT_CONTEXT, label, "Add-ons' categories", reports, None, settings) | ||||
| if tip: | if tip: | ||||
| process_msg(msgs, settings.DEFAULT_CONTEXT, tip, "Add-ons' categories", reports, None, settings) | process_msg(msgs, settings.DEFAULT_CONTEXT, tip, "Add-ons' categories", reports, None, settings) | ||||
| ▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines | |||||
Would be a bit more specific here, something like this maybe?
Add-on " + module.bl_info['name'] + "info: " + prop