diff --git a/Translation Editor/TranslationEditor.html b/Translation Editor/TranslationEditor.html index 35d50c8d..5b8507c0 100644 --- a/Translation Editor/TranslationEditor.html +++ b/Translation Editor/TranslationEditor.html @@ -48,6 +48,9 @@ } else if (id == "current-lang-file") { if (checkTranslationFile(file.name)) { app.current = json; + if (!app.current.cyrillicGlyphs){ + app.current.cyrillicGlyphs = false; + } app.meta.currentLoaded = true; } } @@ -238,6 +241,15 @@ Local Language Name + + Font table to use + + + +
diff --git a/Translation Editor/TranslationsParser.html b/Translation Editor/TranslationsParser.html index e34c0c69..22991740 100644 --- a/Translation Editor/TranslationsParser.html +++ b/Translation Editor/TranslationsParser.html @@ -84,6 +84,7 @@ if (!isDefined(lang)) { lang = { languageCode: langCode, + cyrillicGlyphs: false, messages: {}, characters: {}, menuDouble : false, @@ -97,6 +98,13 @@ continue; } + // Use Cyrillic glyphs + if (startsWith(line, "#define CYRILLIC_GLYPHS")) { + lang.cyrillicGlyphs = true; + entryIndex = 0; + continue; + } + // Menu type reMenuMode.lastIndex = 0; match = reMenuMode.exec(line); diff --git a/Translation Editor/make_translation.py b/Translation Editor/make_translation.py index ec289b4c..55f9a6bb 100644 --- a/Translation Editor/make_translation.py +++ b/Translation Editor/make_translation.py @@ -51,7 +51,7 @@ def readTranslations(jsonDir): langCodeFromJson = lang['languageCode'] except KeyError: langCodeFromJson = "(missing)" - + # ...cause they should be the same! if langCode != langCodeFromJson: raise ValueError("Invalid languageCode " + langCodeFromJson + " in file " + fileName) @@ -87,6 +87,14 @@ def writeLanguage(languageCode, defs, f): f.write(to_unicode("// ---- " + langName + " ----\n\n")) + try: + cyrillic = lang['cyrillicGlyphs'] + except KeyError: + cyrillic = False + + if cyrillic : + f.write(to_unicode("#define CYRILLIC_GLYPHS\n\n")) + # ----- Writing SettingsDescriptions obj = lang['menuOptions'] f.write(to_unicode("const char* SettingsDescriptions[] = {\n")) diff --git a/Translation Editor/translation_ru.json b/Translation Editor/translation_ru.json index 049b28d7..c1b7d023 100644 --- a/Translation Editor/translation_ru.json +++ b/Translation Editor/translation_ru.json @@ -228,5 +228,6 @@ "desc": "Power Wattage of the power adapter used" } }, - "languageLocalName": "Русский" + "languageLocalName": "Русский", + "cyrillicGlyphs": true } \ No newline at end of file diff --git a/workspace/TS100/inc/Font.h b/workspace/TS100/inc/Font.h index c7c6fa32..eaec78de 100644 --- a/workspace/TS100/inc/Font.h +++ b/workspace/TS100/inc/Font.h @@ -223,7 +223,7 @@ const uint8_t FONT_12[]={ 0x00,0x00,0x60,0xE0,0x80,0x10,0x18,0x8C,0xE4,0x60,0x00,0x00,0x00,0x00,0x00,0x81,0xE7,0x7E,0x1E,0x07,0x01,0x00,0x00,0x00, // ý c3 bd 0x00,0x00,0x03,0xFF,0xFF,0x1B,0x18,0x18,0xF8,0xF0,0x00,0x00,0x00,0x00,0x30,0x3F,0x3F,0x36,0x06,0x06,0x07,0x03,0x00,0x00, // þ c3 be 0x00,0x00,0x60,0xEC,0x8C,0x00,0x00,0x8C,0xEC,0x60,0x00,0x00,0x00,0x00,0x00,0x81,0xE7,0x7E,0x1E,0x07,0x01,0x00,0x00,0x00, // ÿ c3 bf -#ifdef LANG_RU +#ifdef CYRILLIC_GLYPHS /* Cyrillic Glyphs */ //V192 ---- PAGE U+0400-U+043F (UTF 0xD080-0xD0BF) ---- 0x00,0xFC,0xFC,0x8D,0x8F,0x8E,0x8C,0x8C,0x8C,0x0C,0x0C,0x00,0x00,0x3F,0x3F,0x31,0x31,0x31,0x31,0x31,0x31,0x30,0x30,0x00, // Ѐ d0 80 @@ -841,7 +841,7 @@ const uint8_t FONT_6x8[] = { 0x44, 0x48, 0x32, 0x11, 0x0c, 0x00, // 189: 'ý' U+00fd (utf-8: c3 bd) 0x7c, 0x28, 0x28, 0x10, 0x00, 0x00, // 190: 'þ' U+00fe (utf-8: c3 be) 0x44, 0x49, 0x30, 0x11, 0x0c, 0x00, // 191: 'ÿ' U+00ff (utf-8: c3 bf) -#ifdef LANG_RU +#ifdef CYRILLIC_GLYPHS /* Cyrillic */ // ---- PAGE U+0400-U+043F (UTF 0xD080-0xD0BF) ---- 0x7c, 0x55, 0x56, 0x44, 0x44, 0x00, // 192: 'Ѐ' U+0400 (utf-8: d0 80) diff --git a/workspace/TS100/src/Translation.cpp b/workspace/TS100/src/Translation.cpp index f52fe623..7339871b 100644 --- a/workspace/TS100/src/Translation.cpp +++ b/workspace/TS100/src/Translation.cpp @@ -1589,6 +1589,8 @@ const char* SettingsMenuEntriesDescriptions[4] = { #ifdef LANG_RU // ---- Русский ---- +#define CYRILLIC_GLYPHS + const char* SettingsDescriptions[] = { /* PowerSource */ "Источник питания. Установка напряжения отключения. ", /* SleepTemperature */ "Температура режима ожидания <С>",