I18n: disambiguate and extract a few messages #111146

Merged
Bastien Montagne merged 3 commits from pioverfour/blender:dp_disambiguate into main 2023-09-04 16:16:36 +02:00
4 changed files with 5 additions and 1 deletions
Showing only changes of commit 24115db19d - Show all commits

View File

@ -10,6 +10,7 @@ from bpy.props import (
BoolProperty,
StringProperty,
)
from bpy.app.translations import contexts as i18n_contexts
def _lang_module_get(sc):
@ -126,6 +127,7 @@ class ConsoleLanguage(Operator):
language: StringProperty(
name="Language",
translation_context=i18n_contexts.editor_python_console,
maxlen=32,
)

View File

@ -124,6 +124,7 @@ const char *BLT_translate_do_new_dataname(const char *msgctxt, const char *msgid
#define BLT_I18NCONTEXT_ID_WORLD "World"
/* Editors-types contexts. */
#define BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE "Python console"
#define BLT_I18NCONTEXT_EDITOR_FILEBROWSER "File browser"
#define BLT_I18NCONTEXT_EDITOR_VIEW3D "View3D"
@ -196,6 +197,7 @@ typedef struct {
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "id_windowmanager"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WORKSPACE, "id_workspace"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_ID_WORLD, "id_world"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE, "editor_python_console"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_FILEBROWSER, "editor_filebrowser"), \

See comment where it's used, think this is not needed.

See comment where it's used, think this is not needed.
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_EDITOR_VIEW3D, "editor_view3d"), \
BLT_I18NCONTEXTS_ITEM(BLT_I18NCONTEXT_AMOUNT, "amount"), \

View File

@ -6615,6 +6615,7 @@ static void rna_def_space_console(BlenderRNA *brna)
prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE);
prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr);

View File

@ -5145,7 +5145,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop, "rna_lang_enum_properties_get_no_international", nullptr, nullptr);
# endif
RNA_def_property_ui_text(prop, "Language", "Language used for translation");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_WINDOWMANAGER);
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop = RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);