diff --git a/Translation Editor/TranslationEditor.html b/Translation Editor/TranslationEditor.html index 5b8507c0..d6c7cf8d 100644 --- a/Translation Editor/TranslationEditor.html +++ b/Translation Editor/TranslationEditor.html @@ -1,353 +1,329 @@ - - - - - - TS100 Translation Editor - - - - - - - - - -
-

TS100 Translation Editor - {{ current.languageLocalName }} [{{current.languageCode}}]

- - - - - - - - - - - - - - - - - - - - - -
Referent Language - - {{ referent.languageLocalName }} [{{referent.languageCode}}] -
Current Language - - {{ current.languageLocalName }} [{{current.languageCode}}] -
Local Language Code
Local Language Name
Font table to use - -
- -
- - - -
-

Obsolete

- - - - - -
{{entry.id}}
{{entry.value}}
-
- -

Messages and Strings

- - - - - -
{{message.id}}
-
{{constraintString(message)}}
-
{{referent.messages[message.id]}}
-
{{message.note}}
-
-
- -

Characters

- - - - - -
{{char.id}}
-
{{constraintString(char)}}
-
{{referent.characters[char.id]}}
-
-
- -

Menu Groups

- - - - - -
{{menu.id}}
-
Menu Name
-
{{constraintString(menu)}}
-
{{referent.menuGroups[menu.id].text2}}
-
-
Description
-
{{referent.menuGroups[menu.id].desc}}
-
-
- -

Menu Options

- - - - - - - - - -
Menu Type - -
{{menu.id}}
-
-
Menu Name (Single-Line)
-
{{constraintString(menu, current.menuDouble)}}
-
{{referent.menuOptions[menu.id].text}}
-
-
-
-
Menu Name (Double-Line)
-
{{constraintString(menu, current.menuDouble)}}
-
{{referent.menuOptions[menu.id].text2}}
-
-
-
Description
-
{{referent.menuOptions[menu.id].desc}}
-
-
- - -
-
- + + + + + + TS100 Translation Editor + + + + + + + + + +
+

TS100 Translation Editor - {{ current.languageLocalName }} [{{current.languageCode}}]

+ + + + + + + + + + + + + + + + + + + + + +
Referent Language + + {{ referent.languageLocalName }} [{{referent.languageCode}}] +
Current Language + + {{ current.languageLocalName }} [{{current.languageCode}}] +
Local Language Code
Local Language Name
Font table to use + +
+ +
+ + + +
+

Obsolete

+ + + + + +
{{entry.id}}
{{entry.value}}
+
+ +

Messages and Strings

+ + + + + +
{{message.id}}
+
{{constraintString(message)}}
+
{{referent.messages[message.id]}}
+
{{message.note}}
+
+
+ +

Characters

+ + + + + +
{{char.id}}
+
{{constraintString(char)}}
+
{{referent.characters[char.id]}}
+
+
+ +

Menu Groups

+ + + + + +
{{menu.id}}
+
Menu Name
+
{{constraintString(menu)}}
+
{{referent.menuGroups[menu.id].text2}}
+
+
Description
+
{{referent.menuGroups[menu.id].desc}}
+
+
+ +

Menu Options

+ + + + + +
{{menu.id}}
+
+
Menu Name (Double-Line)
+
{{constraintString(menu)}}
+
{{referent.menuOptions[menu.id].text2}}
+
+
+
Description
+
{{referent.menuOptions[menu.id].desc}}
+
+
+ + +
+
+ \ No newline at end of file diff --git a/Translation Editor/TranslationsParser.html b/Translation Editor/TranslationsParser.html index 22991740..d47e5218 100644 --- a/Translation Editor/TranslationsParser.html +++ b/Translation Editor/TranslationsParser.html @@ -1,325 +1,322 @@ - - - - - - TS100 Translation Parser - - - - - - - - - -
-

TS100 Translation Parser

- - - - - -
Translation.cpp - -
- -
-
- - -
-
- -
- + + + + + + TS100 Translation Parser + + + + + + + + + +
+

TS100 Translation Parser

+ + + + + +
Translation.cpp + +
+ +
+
+ + +
+
+ +
+ \ No newline at end of file diff --git a/Translation Editor/make_translation.py b/Translation Editor/make_translation.py index 7757b29e..1bebe57c 100755 --- a/Translation Editor/make_translation.py +++ b/Translation Editor/make_translation.py @@ -167,11 +167,8 @@ def getLetterCounts(defs, lang): obj = lang['menuOptions'] for mod in defs['menuOptions']: eid = mod['id'] - if lang['menuDouble']: - textList.append(obj[eid]['text2'][0]) - textList.append(obj[eid]['text2'][1]) - else: - textList.append(obj[eid]['text']) + textList.append(obj[eid]['text2'][0]) + textList.append(obj[eid]['text2'][1]) obj = lang['menuGroups'] for mod in defs['menuGroups']: @@ -369,14 +366,6 @@ def writeLanguage(languageCode, defs, f): c) + "\"," + "//{} \n".format(c))) f.write(to_unicode("};\n\n")) - # ----- Menu Options - - # Menu type - f.write( - to_unicode( - "const enum ShortNameType SettingsShortNameType = SHORT_NAME_" + - ("DOUBLE" if lang['menuDouble'] else "SINGLE") + "_LINE;\n")) - # ----- Writing SettingsDescriptions obj = lang['menuOptions'] f.write(to_unicode("const char* SettingsShortNames[][2] = {\n")) @@ -388,19 +377,14 @@ def writeLanguage(languageCode, defs, f): if 'feature' in mod: f.write(to_unicode("#ifdef " + mod['feature'] + "\n")) f.write(to_unicode(" /* ["+"{:02d}".format(index)+"] " + eid.ljust(maxLen)[:maxLen] + " */ ")) - if lang['menuDouble']: - f.write( - to_unicode( - "{ \"" + - convStr(symbolConversionTable, (obj[eid]['text2'][0])) + - "\", \"" + - convStr(symbolConversionTable, (obj[eid]['text2'][1])) + - "\" }," + "//{} \n".format(obj[eid]['text2']))) - else: - f.write( - to_unicode("{ \"" + - convStr(symbolConversionTable, (obj[eid]['text'])) + - "\" }," + "//{} \n".format(obj[eid]['text']))) + f.write( + to_unicode( + "{ \"" + + convStr(symbolConversionTable, (obj[eid]['text2'][0])) + + "\", \"" + + convStr(symbolConversionTable, (obj[eid]['text2'][1])) + + "\" }," + "//{} \n".format(obj[eid]['text2']))) + if 'feature' in mod: f.write(to_unicode("#endif\n")) index = index + 1 diff --git a/workspace/TS100/Core/Inc/Translation.h b/workspace/TS100/Core/Inc/Translation.h index 614ea12f..b0ef244b 100644 --- a/workspace/TS100/Core/Inc/Translation.h +++ b/workspace/TS100/Core/Inc/Translation.h @@ -9,16 +9,12 @@ #define TRANSLATION_H_ #include "unit.h" #include "stdint.h" -enum ShortNameType { - SHORT_NAME_SINGLE_LINE = 1, SHORT_NAME_DOUBLE_LINE = 2, -}; extern const uint8_t USER_FONT_12[]; extern const uint8_t USER_FONT_6x8[]; /* * When SettingsShortNameType is SHORT_NAME_SINGLE_LINE * use SettingsShortNames as SettingsShortNames[16][1].. second column undefined */ -extern const enum ShortNameType SettingsShortNameType; extern const char *SettingsShortNames[28][2]; extern const char *SettingsDescriptions[28]; extern const char *SettingsMenuEntries[4]; diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index 033e5b31..2431a7a9 100644 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -230,12 +230,6 @@ const menuitem advancedMenu[] = { { NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE }; -static void printShortDescriptionSingleLine(uint32_t shortDescIndex) { - OLED::setFont(0); - OLED::setCharCursor(0, 0); - OLED::print(SettingsShortNames[shortDescIndex][0]); -} - static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) { OLED::setFont(1); OLED::setCharCursor(0, 0); @@ -254,11 +248,7 @@ static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) { static void printShortDescription(uint32_t shortDescIndex, uint16_t cursorCharPosition) { // print short description (default single line, explicit double line) - if (SettingsShortNameType == SHORT_NAME_DOUBLE_LINE) { - printShortDescriptionDoubleLine(shortDescIndex); - } else { - printShortDescriptionSingleLine(shortDescIndex); - } + printShortDescriptionDoubleLine(shortDescIndex); // prepare cursor for value OLED::setFont(0);