From 316652557204c0dc92ca8cae3a42432bf8bc78ed Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 23 Nov 2021 20:10:50 +0300 Subject: [PATCH] [themes] support for theme name localization --- apps/common/main/lib/controller/Themes.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 7e20b00c1..fe3f6a1a0 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -174,10 +174,13 @@ define([ } var parse_themes_object = function (obj) { + var curr_lang = Common.Locale.getCurrentLanguage(), + theme_label; if ( !!obj.themes && obj.themes instanceof Array ) { obj.themes.forEach(function (item) { if ( !!item.id ) { - themes_map[item.id] = {text: item.name, type: item.type}; + theme_label = !item.l10n || !item.l10n[curr_lang] ? item.name : item.l10n[curr_lang]; + themes_map[item.id] = {text: theme_label, type: item.type}; write_theme_css(create_colors_css(item.id, item.colors)); } else if ( typeof item == 'string' ) { @@ -186,7 +189,8 @@ define([ }); } else if ( obj.id ) { - themes_map[obj.id] = {text: obj.name, type: obj.type}; + theme_label = !obj.l10n || !obj.l10n[curr_lang] ? obj.name : obj.l10n[curr_lang]; + themes_map[obj.id] = {text: theme_label, type: obj.type}; write_theme_css( create_colors_css(obj.id, obj.colors) ); } }