Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2020-04-07 23:25:49 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-04-07 23:25:49 +0300
commit968619d03626c7e4d92d4cb383ac304b72595af3 (patch)
treefe9299f45a521c27f7241226fc0661654df0c2a6 /source/blender/makesrna/intern/rna_userdef.c
parent53981c7fb6fdd9973e40f81f867f25d10540c1d1 (diff)
UI: Language Selection Changes
Removal of 'Translation' checkbox. Enable translation options when selecting non-English languages. Differential Revision: https://developer.blender.org/D7210 Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index f52307355c2..514d7428ff8 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -307,14 +307,27 @@ static void rna_userdef_screen_update_header_default(Main *bmain, Scene *scene,
USERDEF_TAG_DIRTY;
}
+static void rna_userdef_font_update(Main *UNUSED(bmain),
+ Scene *UNUSED(scene),
+ PointerRNA *UNUSED(ptr))
+{
+ BLF_cache_clear();
+ UI_reinit_font();
+}
+
static void rna_userdef_language_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *UNUSED(ptr))
{
- BLF_cache_clear();
BLT_lang_set(NULL);
- UI_reinit_font();
- USERDEF_TAG_DIRTY;
+
+ const char *uilng = BLT_lang_get();
+ if (STREQ(uilng, "en_US")) {
+ U.transopts &= ~(USER_TR_IFACE | USER_TR_TOOLTIPS | USER_TR_NEWDATANAME);
+ }
+ else {
+ U.transopts |= (USER_TR_IFACE | USER_TR_TOOLTIPS | USER_TR_NEWDATANAME);
+ }
}
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain),
@@ -4716,21 +4729,15 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui");
RNA_def_property_ui_text(prop, "Interface Font", "Path to interface font");
- RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
+ RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
prop = RNA_def_property(srna, "font_path_ui_mono", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "font_path_ui_mono");
RNA_def_property_ui_text(prop, "Mono-space Font", "Path to interface mono-space Font");
- RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
+ RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_font_update");
/* Language. */
- prop = RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
- RNA_def_property_ui_text(
- prop, "Translate UI", "Enable UI translation and use international fonts");
- RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
-
prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_language_default_items);
# ifdef WITH_INTERNATIONAL