diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..0fd7d242 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +ignore = E203, E266, E501, W503, F403, F401 +max-line-length = 200 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bcfff0c0..ea053cbd 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -84,3 +84,9 @@ jobs: - name: Check formatting with clang-format run: cd source && make clean && make check-style + + - name: Check python formatting with black + run: black --check Translations + + - name: Check python with flake8 + run: flake8 Translations diff --git a/Dockerfile b/Dockerfile index 79607ea0..e9c1aa57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,24 +2,28 @@ FROM ubuntu:20.04 LABEL maintainer="Ben V. Brown " WORKDIR /build -# Setup the ARM GCC toolchain - -# Install any needed packages specified in requirements.txt -RUN apt-get update && \ - apt-get install -y \ +# Add extra mirrors for options +RUN echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal main restricted universe multiverse" > /etc/apt/sources.list && \ + echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \ + echo "deb mirror://mirrors.ubuntu.com/mirrors.txt focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \ + DEBIAN_FRONTEND=noninteractive apt-get update +# Install dependencies to build the firmware +RUN apt-get install -y \ make \ bzip2 \ git \ python3 \ python3-pip \ - wget && \ + wget --no-install-recommends && \ apt-get clean RUN python3 -m pip install bdflib -RUN wget -qO- https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 | tar -xj -RUN wget -qO- https://github.com/Ralim/nuclei-compiler/releases/download/2020.08/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2 | tar -xj +# Download the two compilers +RUN wget -qO- "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" | tar -xj +# This is the same as the one from Nuclei, just mirrored on Github as their download server is horrifically slow +RUN wget -qO- "https://github.com/Ralim/nuclei-compiler/releases/download/2020.08/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2" | tar -xj # Add compiler to the path -ENV PATH "/build/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH" +ENV PATH "/build/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH" ENV PATH "/build/gcc/bin/:$PATH" COPY . /build/source COPY ./ci /build/ci diff --git a/Translations/TranslationEditor.html b/Translations/TranslationEditor.html index d6c7cf8d..6f0ee320 100644 --- a/Translations/TranslationEditor.html +++ b/Translations/TranslationEditor.html @@ -3,7 +3,7 @@ - TS100 Translation Editor + IronOS Translation Editor @@ -191,11 +191,67 @@ delim = " and "; } return str; + }, + + getWholeScreenMessageMaxLen: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var maxLen; + if (this.isSmall(v)) { + maxLen = defMap[id].maxLen2 || 16; + } else { + maxLen = defMap[id].maxLen || 8; + } + return maxLen; + }, + + validateWholeScreenMessage: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var maxLen = this.getWholeScreenMessageMaxLen(valMap, id, prop); + if (this.isSmall(v)) { + if (v[0].length === 0) { + return "invalid"; + } else if (Math.max(v[0].length, v[1].length) > maxLen) { + return "invalid"; + } + } else { + if (v.length > maxLen) { + return "invalid"; + } + } + }, + + constraintWholeScreenMessage: function(valMap, id, prop) { + return "len <= " + this.getWholeScreenMessageMaxLen(valMap, id, prop); + }, + + isSmall: function(v) { + return v instanceof Array; + }, + + convertToLarge: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var message = v[0] + (v[1] !== "" ? " " + v[1] : ""); + if (prop) { + valMap[id][prop] = message; + } else { + valMap[id] = message; + } + }, + + convertToSmall: function(valMap, id, prop) { + var v = prop ? valMap[id][prop] : valMap[id]; + var message = [ v, "" ]; + if (prop) { + valMap[id][prop] = message; + } else { + valMap[id] = message; + } } } }); app.def = def; copyArrayToMap(app.def.messages, defMap); + copyArrayToMap(app.def.messagesWarn, defMap); copyArrayToMap(app.def.characters, defMap); copyArrayToMap(app.def.menuGroups, defMap); copyArrayToMap(app.def.menuOptions, defMap); @@ -208,7 +264,7 @@
-

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

+

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

@@ -273,6 +329,27 @@
Referent Language
+

Warning Messages

+ + + + + +
{{message.id}}
+
{{constraintWholeScreenMessage(current.messagesWarn, message.id)}}
+
{{referent.messagesWarn[message.id]}}
+
{{message.note}}
+
+ + + +
+
+ + +
+
+

Characters

@@ -287,13 +364,21 @@

Menu Groups

- +
{{menu.id}}
Menu Name
-
{{constraintString(menu)}}
+
{{constraintWholeScreenMessage(current.menuGroups, menu.id, 'text2')}}
{{referent.menuGroups[menu.id].text2}}
-
+
+ + + +
+
+ + +
Description
{{referent.menuGroups[menu.id].desc}}
@@ -303,14 +388,22 @@

Menu Options

- +
{{menu.id}}
-
Menu Name (Double-Line)
-
{{constraintString(menu)}}
+
Menu Name
+
{{constraintWholeScreenMessage(current.menuOptions, menu.id, 'text2')}}
{{referent.menuOptions[menu.id].text2}}
-
+
+ + + +
+
+ + +
Description
{{referent.menuOptions[menu.id].desc}}
@@ -326,4 +419,4 @@ - \ No newline at end of file + diff --git a/Translations/make_translation.py b/Translations/make_translation.py index af5c51e5..66cf642c 100755 --- a/Translations/make_translation.py +++ b/Translations/make_translation.py @@ -65,11 +65,15 @@ def validate_langcode_matches_content(filename: str, content: dict) -> None: # ...cause they should be the same! if lang_code != lang_code_from_json: - raise ValueError(f"Invalid languageCode {lang_code_from_json} in file {filename}") + raise ValueError( + f"Invalid languageCode {lang_code_from_json} in file {filename}" + ) def write_start(f: TextIO): - f.write("// WARNING: THIS FILE WAS AUTO GENERATED BY make_translation.py. PLEASE DO NOT EDIT.\n") + f.write( + "// WARNING: THIS FILE WAS AUTO GENERATED BY make_translation.py. PLEASE DO NOT EDIT.\n" + ) f.write("\n") f.write('#include "Translation.h"\n') @@ -89,7 +93,7 @@ def get_constants() -> List[str]: ("SymbolVolts", "V"), ("SymbolDC", "DC"), ("SymbolCellCount", "S"), - ("SymbolVersionNumber", buildVersion) + ("SymbolVersionNumber", buildVersion), ] @@ -107,7 +111,7 @@ def get_debug_menu() -> List[str]: "Vin ", "PCB ", "PWR ", - "Max " + "Max ", ] @@ -127,6 +131,15 @@ def get_letter_counts(defs: dict, lang: dict) -> List[str]: else: text_list.append(obj[eid]) + obj = lang["messagesWarn"] + for mod in defs["messagesWarn"]: + eid = mod["id"] + if isinstance(obj[eid], list): + text_list.append(obj[eid][0]) + text_list.append(obj[eid][1]) + else: + text_list.append(obj[eid]) + obj = lang["characters"] for mod in defs["characters"]: @@ -136,14 +149,20 @@ def get_letter_counts(defs: dict, lang: dict) -> List[str]: obj = lang["menuOptions"] for mod in defs["menuOptions"]: eid = mod["id"] - text_list.append(obj[eid]["text2"][0]) - text_list.append(obj[eid]["text2"][1]) + if isinstance(obj[eid]["text2"], list): + text_list.append(obj[eid]["text2"][0]) + text_list.append(obj[eid]["text2"][1]) + else: + text_list.append(obj[eid]["text2"]) obj = lang["menuGroups"] for mod in defs["menuGroups"]: eid = mod["id"] - text_list.append(obj[eid]["text2"][0]) - text_list.append(obj[eid]["text2"][1]) + if isinstance(obj[eid]["text2"], list): + text_list.append(obj[eid]["text2"][0]) + text_list.append(obj[eid]["text2"][1]) + else: + text_list.append(obj[eid]["text2"]) obj = lang["menuGroups"] for mod in defs["menuGroups"]: @@ -225,7 +244,7 @@ def get_chars_from_font_index(index: int) -> str: # the chars take 2 bytes. To do this, we use \xF1 to \xFF as lead bytes # to designate double-byte chars, and leave the remaining as single-byte # chars. - # + # # For the sake of sanity, \x00 always means the end of string, so we skip # \xF1\x00 and others in the mapping. # @@ -281,15 +300,21 @@ def get_font_map_and_table(text_list: List[str]) -> Tuple[str, Dict[str, str]]: # do not need to be in the small font table to save space. # We assume all symbols not in the font table to be a CJK char. # We also enforce that numbers are first. - ordered_normal_sym_list: List[str] = forced_first_symbols + [x for x in text_list if x not in forced_first_symbols and x in font_table] - ordered_cjk_sym_list: List[str] = [x for x in text_list if x not in forced_first_symbols and x not in font_table] + ordered_normal_sym_list: List[str] = forced_first_symbols + [ + x for x in text_list if x not in forced_first_symbols and x in font_table + ] + ordered_cjk_sym_list: List[str] = [ + x for x in text_list if x not in forced_first_symbols and x not in font_table + ] total_symbol_count = len(ordered_normal_sym_list) + len(ordered_cjk_sym_list) # \x00 is for NULL termination and \x01 is for newline, so the maximum # number of symbols allowed is as follow (see also the comments in # `get_chars_from_font_index`): if total_symbol_count > (0x10 * 0xFF - 15) - 2: # 4063 - logging.error(f"Error, too many used symbols for this version (total {total_symbol_count})") + logging.error( + f"Error, too many used symbols for this version (total {total_symbol_count})" + ) sys.exit(1) logging.info(f"Generating fonts for {total_symbol_count} symbols") @@ -323,7 +348,9 @@ def get_font_map_and_table(text_list: List[str]) -> Tuple[str, Dict[str, str]]: sys.exit(1) font_table_strings.append(f"{font_line}//{symbol_map[sym]} -> {sym}") # No data to add to the small font table - font_small_table_strings.append(f"// {symbol_map[sym]} -> {sym}") + font_small_table_strings.append( + f"// {symbol_map[sym]} -> {sym}" + ) output_table = "const uint8_t USER_FONT_12[] = {\n" for line in font_table_strings: @@ -378,7 +405,9 @@ def write_language(lang: dict, defs: dict, f: TextIO) -> None: if "feature" in mod: f.write(f"#ifdef {mod['feature']}\n") f.write(f" /* [{index:02d}] {eid.ljust(max_len)[:max_len]} */ ") - f.write(f"\"{convert_string(symbol_conversion_table, obj[eid]['desc'])}\",//{obj[eid]['desc']} \n") + f.write( + f"\"{convert_string(symbol_conversion_table, obj[eid]['desc'])}\",//{obj[eid]['desc']} \n" + ) if "feature" in mod: f.write("#endif\n") @@ -403,19 +432,40 @@ def write_language(lang: dict, defs: dict, f: TextIO) -> None: f.write("\n") + obj = lang["messagesWarn"] + + for mod in defs["messagesWarn"]: + eid = mod["id"] + if isinstance(obj[eid], list): + if not obj[eid][1]: + source_text = obj[eid][0] + else: + source_text = obj[eid][0] + "\n" + obj[eid][1] + else: + source_text = "\n" + obj[eid] + translated_text = convert_string(symbol_conversion_table, source_text) + source_text = source_text.replace("\n", "_") + f.write(f'const char* {eid} = "{translated_text}";//{source_text} \n') + + f.write("\n") + # ----- Writing Characters obj = lang["characters"] for mod in defs["characters"]: eid: str = mod["id"] - f.write(f'const char* {eid} = "{convert_string(symbol_conversion_table, obj[eid])}";//{obj[eid]} \n') + f.write( + f'const char* {eid} = "{convert_string(symbol_conversion_table, obj[eid])}";//{obj[eid]} \n' + ) f.write("\n") # Write out firmware constant options constants = get_constants() for x in constants: - f.write(f'const char* {x[0]} = "{convert_string(symbol_conversion_table, x[1])}";//{x[1]} \n') + f.write( + f'const char* {x[0]} = "{convert_string(symbol_conversion_table, x[1])}";//{x[1]} \n' + ) f.write("\n") # Debug Menu @@ -427,16 +477,25 @@ def write_language(lang: dict, defs: dict, f: TextIO) -> None: # ----- Writing SettingsDescriptions obj = lang["menuOptions"] - f.write("const char* SettingsShortNames[][2] = {\n") + f.write("const char* SettingsShortNames[] = {\n") max_len = 25 index = 0 for mod in defs["menuOptions"]: eid = mod["id"] + if isinstance(obj[eid]["text2"], list): + if not obj[eid]["text2"][1]: + source_text = obj[eid]["text2"][0] + else: + source_text = obj[eid]["text2"][0] + "\n" + obj[eid]["text2"][1] + else: + source_text = "\n" + obj[eid]["text2"] if "feature" in mod: f.write(f"#ifdef {mod['feature']}\n") f.write(f" /* [{index:02d}] {eid.ljust(max_len)[:max_len]} */ ") - f.write(f'{{ "{convert_string(symbol_conversion_table, (obj[eid]["text2"][0]))}", "{convert_string(symbol_conversion_table, (obj[eid]["text2"][1]))}" }},//{obj[eid]["text2"]} \n') + f.write( + f'{{ "{convert_string(symbol_conversion_table, source_text)}" }},//{obj[eid]["text2"]} \n' + ) if "feature" in mod: f.write("#endif\n") @@ -451,9 +510,17 @@ def write_language(lang: dict, defs: dict, f: TextIO) -> None: max_len = 25 for mod in defs["menuGroups"]: eid = mod["id"] + if isinstance(obj[eid]["text2"], list): + if not obj[eid]["text2"][1]: + source_text = obj[eid]["text2"][0] + else: + source_text = obj[eid]["text2"][0] + "\n" + obj[eid]["text2"][1] + else: + source_text = "\n" + obj[eid]["text2"] f.write(f" /* {eid.ljust(max_len)[:max_len]} */ ") - txt = f'{obj[eid]["text2"][0]}\\n{obj[eid]["text2"][1]}' - f.write(f'"{convert_string(symbol_conversion_table, txt)}",//{obj[eid]["text2"]} \n') + f.write( + f'"{convert_string(symbol_conversion_table, source_text)}",//{obj[eid]["text2"]} \n' + ) f.write("};\n\n") @@ -465,19 +532,25 @@ def write_language(lang: dict, defs: dict, f: TextIO) -> None: for mod in defs["menuGroups"]: eid = mod["id"] f.write(f" /* {eid.ljust(max_len)[:max_len]} */ ") - f.write(f"\"{convert_string(symbol_conversion_table, (obj[eid]['desc']))}\",//{obj[eid]['desc']} \n") + f.write( + f"\"{convert_string(symbol_conversion_table, (obj[eid]['desc']))}\",//{obj[eid]['desc']} \n" + ) f.write("};\n\n") - f.write(f"const bool HasFahrenheit = {('true' if lang.get('tempUnitFahrenheit', True) else 'false')};\n") + f.write( + f"const bool HasFahrenheit = {('true' if lang.get('tempUnitFahrenheit', True) else 'false')};\n" + ) f.write("\n// Verify SettingsItemIndex values:\n") for i, mod in enumerate(defs["menuOptions"]): eid = mod["id"] - f.write(f"static_assert(static_cast(SettingsItemIndex::{eid}) == {i});\n") + f.write( + f"static_assert(static_cast(SettingsItemIndex::{eid}) == {i});\n" + ) def read_version() -> str: - with open(HERE.parent / 'source' / 'version.h') as version_file: + with open(HERE.parent / "source" / "version.h") as version_file: for line in version_file: if re.findall(r"^.*(?<=(#define)).*(?<=(BUILD_VERSION))", line): line = re.findall(r"\"(.+?)\"", line) @@ -493,13 +566,10 @@ def read_version() -> str: def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser() - parser.add_argument("--output", "-o", - help="Target file", - type=argparse.FileType("w"), - required=True - ) - parser.add_argument("languageCode", - help="Language to generate") + parser.add_argument( + "--output", "-o", help="Target file", type=argparse.FileType("w"), required=True + ) + parser.add_argument("languageCode", help="Language to generate") return parser.parse_args() diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index b85eb44e..6b5e3a35 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -21,11 +21,25 @@ "TipDisconnectedString": "ПРЕКЪСНАТ ВРЪХ", "SolderingAdvancedPowerPrompt": "Захранване: ", "OffString": "Изкл.", - "ResetOKMessage": "Нулиране завършено", - "YourGainMessage": "Усилване:", - "SettingsResetMessage": "Настройките бяха\nнулирани!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "YourGainMessage": "Усилване:" + }, + "messagesWarn": { + "ResetOKMessage": [ + "Нулиране", + "завършено" + ], + "SettingsResetMessage": [ + "Настройките бяха", + "нулирани!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +51,7 @@ "SettingFastChar": "F", "SettingSlowChar": "S", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index 7c5b9202..8aed567d 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "HROT NEPŘIPOJEN", "SolderingAdvancedPowerPrompt": "Ohřev: ", "OffString": "Vyp", + "YourGainMessage": "Zisk:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Zisk:", - "SettingsResetMessage": "Tov. nas. obnov.", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Tov. nas. obnov.", + "" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "R", "SettingSlowChar": "P", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index aaabb17b..ea13608b 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "TIP DISCONNECTED", "SolderingAdvancedPowerPrompt": "Power: ", "OffString": "Off", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "F", "SettingSlowChar": "S", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "L", "SettingStartSleepChar": "D", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index f1caf983..1226dfad 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -22,11 +22,22 @@ "TipDisconnectedString": "Spitze fehlt", "SolderingAdvancedPowerPrompt": "Leistung: ", "OffString": "Aus", - "NoAccelerometerMessage": "Kein Bewegungssensor\nerkannt!", - "NoPowerDeliveryMessage": "Kein USB-PD IC\nerkannt!", + "YourGainMessage": "Dein Faktor:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Dein Faktor:", - "SettingsResetMessage": "Einstellungen\nzurückgesetzt!", + "SettingsResetMessage": [ + "Einstellungen", + "zurückgesetzt!" + ], + "NoAccelerometerMessage": [ + "Kein Bewegungssensor", + "erkannt!" + ], + "NoPowerDeliveryMessage": [ + "Kein USB-PD IC", + "erkannt!" + ], "LockingKeysString": "GESPERRT", "UnlockingKeysString": "ENTSPERRT", "WarningKeysLockedString": "!GESPERRT!" diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index 4c22d999..51d79ea0 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -22,11 +22,22 @@ "TipDisconnectedString": "NO TIP", "SolderingAdvancedPowerPrompt": "Power: ", "OffString": "Off", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": "LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -38,7 +49,7 @@ "SettingFastChar": "F", "SettingSlowChar": "S", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "S", "SettingStartSleepChar": "Z", "SettingStartSleepOffChar": "R", diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index 9dfd17f4..f4ff297e 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -21,11 +21,23 @@ "TipDisconnectedString": "NO HAY PUNTA", "SolderingAdvancedPowerPrompt": "Potencia: ", "OffString": " No", - "ResetOKMessage": "Hecho. ", "YourGainMessage": "Gananc.:", - "SettingsResetMessage": "Ajustes borrados", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": "Ajustes borrados" + }, + "messagesWarn": { + "ResetOKMessage": "Hecho.", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +49,7 @@ "SettingFastChar": "R", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "S", "SettingStartSleepChar": "R", "SettingStartSleepOffChar": "F", diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index 0949389b..d263d7ec 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "KÄRKI ON IRTI", "SolderingAdvancedPowerPrompt": "Teho: ", "OffString": "OFF", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "N", "SettingSlowChar": "H", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index 9a388e26..3d171913 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "PANNE DÉBRANCHÉE", "SolderingAdvancedPowerPrompt": "Puissance : ", "OffString": "Off", + "YourGainMessage": "Gain : " + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Gain : ", - "SettingsResetMessage": "Réglage réinit. !", - "NoAccelerometerMessage": "Accéléromètre\nnon détecté !", - "NoPowerDeliveryMessage": "Pas d'USB-PD\ndétecté !", + "SettingsResetMessage": [ + "Réglage", + "réinit. !" + ], + "NoAccelerometerMessage": [ + "Accéléromètre", + "non détecté !" + ], + "NoPowerDeliveryMessage": [ + "Pas d'USB-PD", + "détecté !" + ], "LockingKeysString": "VERROUIL", "UnlockingKeysString": "DEVERROU", "WarningKeysLockedString": "! VERR. !" @@ -37,7 +48,7 @@ "SettingFastChar": "R", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"D", + "SettingOffChar": "D", "SettingStartSolderingChar": "A", "SettingStartSleepChar": "V", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index f1e82a41..28816082 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "VRH NIJE SPOJEN!", "SolderingAdvancedPowerPrompt": "Snaga: ", "OffString": "Off", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "B", "SettingSlowChar": "S", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index d0048e19..26f2e21d 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -21,11 +21,25 @@ "TipDisconnectedString": "PÁKA LEVÉVE", "SolderingAdvancedPowerPrompt": "Telj: ", "OffString": "Ki", - "ResetOKMessage": "Törlés OK", - "YourGainMessage": "Erősítés:", - "SettingsResetMessage": "Beállítások\ntörölve!", - "NoAccelerometerMessage": "Nincs gyorsulásmérő!", - "NoPowerDeliveryMessage": "Nincs USB-PD IC!", + "YourGainMessage": "Erősítés:" + }, + "messagesWarn": { + "ResetOKMessage": [ + "Törlés OK", + "" + ], + "SettingsResetMessage": [ + "Beállítások", + "törölve!" + ], + "NoAccelerometerMessage": [ + "Nincs", + "gyorsulásmérő!" + ], + "NoPowerDeliveryMessage": [ + "Nincs USB-PD IC!", + "" + ], "LockingKeysString": "LEZÁRVA", "UnlockingKeysString": "FELOLDVA", "WarningKeysLockedString": "!LEZÁRVA!" @@ -37,7 +51,7 @@ "SettingFastChar": "G", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"0", + "SettingOffChar": "0", "SettingStartSolderingChar": "F", "SettingStartSleepChar": "Z", "SettingStartSleepOffChar": "S", diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index 403f56bd..7e090e82 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "PUNTA ASSENTE", "SolderingAdvancedPowerPrompt": "Potenz:", "OffString": "OFF", + "YourGainMessage": "Guad.: " + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Guad.: ", - "SettingsResetMessage": "Reset effettuato", - "NoAccelerometerMessage": "Accelerometro\nnon rilevato", - "NoPowerDeliveryMessage": "USB-PD non\ndisponibile", + "SettingsResetMessage": [ + "Reset effettuato", + "" + ], + "NoAccelerometerMessage": [ + "Accelerometro", + "non rilevato" + ], + "NoPowerDeliveryMessage": [ + "USB-PD non", + "disponibile" + ], "LockingKeysString": "Blocc.", "UnlockingKeysString": "Sblocc.", "WarningKeysLockedString": "BLOCCATO" @@ -37,7 +48,7 @@ "SettingFastChar": "V", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "S", "SettingStartSleepChar": "R", "SettingStartSleepOffChar": "A", diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index b19e8656..ae84c9d3 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -21,11 +21,25 @@ "TipDisconnectedString": "NĖRA ANTGALIO", "SolderingAdvancedPowerPrompt": "Galia: ", "OffString": "Išj", - "ResetOKMessage": "Atstatytas OK", - "YourGainMessage": "Greitis:", - "SettingsResetMessage": "Nust. atstatyti!", - "NoAccelerometerMessage": "Nerastas\nakselerometras!", - "NoPowerDeliveryMessage": "Nerastas\nUSB-PD IC !", + "YourGainMessage": "Greitis:" + }, + "messagesWarn": { + "ResetOKMessage": [ + "Atstatytas OK", + "" + ], + "SettingsResetMessage": [ + "Nust. atstatyti!", + "" + ], + "NoAccelerometerMessage": [ + "Nerastas", + "akselerometras!" + ], + "NoPowerDeliveryMessage": [ + "Nerastas", + "USB-PD IC !" + ], "LockingKeysString": " UŽRAKIN", "UnlockingKeysString": "ATRAKIN", "WarningKeysLockedString": "!UŽRAK!" @@ -37,7 +51,7 @@ "SettingFastChar": "G", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"I", + "SettingOffChar": "I", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "M", "SettingStartSleepOffChar": "K", diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index 768e81b2..72f34da5 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -21,14 +21,34 @@ "TipDisconnectedString": "PUNT LOSGEKOPPELT", "SolderingAdvancedPowerPrompt": "Vermogen: ", "OffString": "Uit", + "YourGainMessage": "Niveau:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Niveau:", - "SettingsResetMessage": "Instellingen zijn\ngereset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", - "LockingKeysString": " GEBLOKKEERD", - "UnlockingKeysString": "GEDEBLOKKEERD", - "WarningKeysLockedString": "!GEBLOKKEERD!" + "SettingsResetMessage": [ + "Instellingen", + "zijn gereset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], + "LockingKeysString": [ + " GEBLOKKEERD", + "" + ], + "UnlockingKeysString": [ + "GEDEBLOKKEERD", + "" + ], + "WarningKeysLockedString": [ + "!GEBLOKKEERD!", + "" + ] }, "characters": { "SettingRightChar": "R", @@ -37,7 +57,7 @@ "SettingFastChar": "F", "SettingSlowChar": "S", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index debd456c..e4c0c10c 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "Punt ONTKOPPELD", "SolderingAdvancedPowerPrompt": "Vermogen: ", "OffString": "Uit", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "S", "SettingSlowChar": "T", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "T", "SettingStartSleepChar": "S", "SettingStartSleepOffChar": "O", diff --git a/Translations/translation_NO.json b/Translations/translation_NO.json index 987aa49f..6f5ef113 100644 --- a/Translations/translation_NO.json +++ b/Translations/translation_NO.json @@ -21,11 +21,22 @@ "TipDisconnectedString": "SPISS FRAKOBLET", "SolderingAdvancedPowerPrompt": "Effekt: ", "OffString": "Av", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "Settings were\nreset!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": [ + "Settings were", + "reset!" + ], + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -37,7 +48,7 @@ "SettingFastChar": "H", "SettingSlowChar": "L", "SettingMediumChar": "M", - "SettingOffChar":"O", + "SettingOffChar": "O", "SettingStartSolderingChar": "L", "SettingStartSleepChar": "D", "SettingStartSleepOffChar": "O", @@ -105,7 +116,7 @@ }, "SleepTimeout": { "text2": [ - "", + "DTid", "" ], "desc": "Tid før dvale " }, "SleepTemperature": { - "text2": [ - "", - "待機温度" - ], + "text2": "待機温度", "desc": "喺待機模式時嘅辣雞咀温度" }, "SleepTimeout": { - "text2": [ - "", - "待機延時" - ], + "text2": "待機延時", "desc": "自動進入待機模式前嘅閒置等候時間 " }, "ShutdownTimeout": { - "text2": [ - "", - "自動熄機" - ], + "text2": "自動熄機", "desc": "自動熄機前嘅閒置等候時間 " }, "MotionSensitivity": { - "text2": [ - "", - "動作敏感度" - ], + "text2": "動作敏感度", "desc": "0=停用 | 1=最低敏感度 | ... | 9=最高敏感度" }, "TemperatureUnit": { - "text2": [ - "", - "温度單位" - ], + "text2": "温度單位", "desc": "C=攝氏 | F=華氏" }, "AdvancedIdle": { - "text2": [ - "", - "詳細閒置畫面" - ], + "text2": "詳細閒置畫面", "desc": "喺閒置畫面以英文細字顯示詳細嘅資料" }, "DisplayRotation": { - "text2": [ - "", - "畫面方向" - ], + "text2": "畫面方向", "desc": "A=自動 | L=使用左手 | R=使用右手" }, "BoostTemperature": { - "text2": [ - "", - "增熱温度" - ], + "text2": "增熱温度", "desc": "喺增熱模式時使用嘅温度" }, "AutoStart": { - "text2": [ - "", - "自動啓用" - ], + "text2": "自動啓用", "desc": "開機時自動啓用 <無=停用 | 焊=焊接模式 | 待=待機模式 | 室=室温待機>" }, "CooldownBlink": { - "text2": [ - "", - "降温時閃爍" - ], + "text2": "降温時閃爍", "desc": "停止加熱之後,當辣雞咀仲係熱嗰陣閃爍畫面" }, "TemperatureCalibration": { - "text2": [ - "", - "温度校正?" - ], + "text2": "温度校正?", "desc": "開始校正辣雞咀温度位移" }, "SettingsReset": { - "text2": [ - "", - "全部重設?" - ], + "text2": "全部重設?", "desc": "將所有設定重設到預設值" }, "VoltageCalibration": { - "text2": [ - "", - "輸入電壓校正?" - ], + "text2": "輸入電壓校正?", "desc": "開始校正VIN輸入電壓 <長撳以退出>" }, "AdvancedSoldering": { - "text2": [ - "", - "詳細焊接畫面" - ], + "text2": "詳細焊接畫面", "desc": "喺焊接模式畫面以英文細字顯示詳細嘅資料" }, "ScrollingSpeed": { - "text2": [ - "", - "捲動速度" - ], + "text2": "捲動速度", "desc": "解說文字嘅捲動速度" }, "QCMaxVoltage": { - "text2": [ - "", - "QC電壓" - ], + "text2": "QC電壓", "desc": "使用QC電源時請求嘅最高目標電壓" }, "PowerLimit": { - "text2": [ - "", - "功率限制" - ], + "text2": "功率限制", "desc": "限制辣雞可用嘅最大功率 " }, "ReverseButtonTempChange": { - "text2": [ - "", - "反轉加減掣" - ], + "text2": "反轉加減掣", "desc": "反轉調校温度時加減掣嘅方向" }, "TempChangeShortStep": { - "text2": [ - "", - "温度調整 短" - ], + "text2": "温度調整 短", "desc": "調校温度時短撳一下嘅温度變幅" }, "TempChangeLongStep": { - "text2": [ - "", - "温度調整 長" - ], + "text2": "温度調整 長", "desc": "調校温度時長撳嘅温度變幅" }, "PowerPulsePower": { - "text2": [ - "", - "電源脈衝" - ], + "text2": "電源脈衝", "desc": "為保持電源喚醒而通電所用嘅功率 " }, "HallEffSensitivity": { - "text2": [ - "", - "磁場敏感度" - ], + "text2": "磁場敏感度", "desc": "磁場感應器用嚟啓動待機模式嘅敏感度 <關=停用 | 低=最低敏感度 | 中=中等敏感度 | 高=最高敏感度>" }, "LockingMode": { - "text2": [ - "", - "撳掣鎖定" - ], + "text2": "撳掣鎖定", "desc": "喺焊接模式時,同時長撳兩粒掣啓用撳掣鎖定 <無=停用 | 增=鎖定增熱模式 | 全=鎖定全部>" }, "MinVolCell": { - "text2": [ - "", - "最低電壓" - ], + "text2": "最低電壓", "desc": "每粒電池嘅最低可用電壓 <伏特> <3S: 3.0V - 3.7V, 4/5/6S: 2.4V - 3.7V>" }, "AnimLoop": { - "text2": [ - "", - "動畫循環" - ], + "text2": "動畫循環", "desc": "循環顯示功能表圖示動畫" }, "AnimSpeed": { - "text2": [ - "", - "動畫速度" - ], + "text2": "動畫速度", "desc": "功能表圖示動畫嘅速度 <關=不顯示動畫 | 慢=慢速 | 中=中速 | 快=快速>" }, "PowerPulseWait": { - "text2": [ - "", - "電源脈衝間隔" - ], + "text2": "電源脈衝間隔", "desc": "為保持電源喚醒,每次通電之間嘅間隔時間 " }, "PowerPulseDuration": { - "text2": [ - "", - "電源脈衝時長" - ], + "text2": "電源脈衝時長", "desc": "為保持電源喚醒,每次通電脈衝嘅時間長度 " } } diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index 875d2f18..c5ef684c 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -22,11 +22,19 @@ "TipDisconnectedString": "NO TIP", "SolderingAdvancedPowerPrompt": "Power: ", "OffString": "關", + "YourGainMessage": "Your gain:" + }, + "messagesWarn": { "ResetOKMessage": "已重設!", - "YourGainMessage": "Your gain:", - "SettingsResetMessage": "\n設定已被重設!", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "SettingsResetMessage": "設定已被重設!", + "NoAccelerometerMessage": [ + "No accelerometer", + "detected!" + ], + "NoPowerDeliveryMessage": [ + "No USB-PD IC", + "detected!" + ], "LockingKeysString": "已鎖定", "UnlockingKeysString": "已解除鎖定", "WarningKeysLockedString": "!按鍵鎖定!" @@ -38,7 +46,7 @@ "SettingFastChar": "快", "SettingSlowChar": "慢", "SettingMediumChar": "中", - "SettingOffChar":"關", + "SettingOffChar": "關", "SettingStartSolderingChar": "焊", "SettingStartSleepChar": "待", "SettingStartSleepOffChar": "室", @@ -54,243 +62,141 @@ }, "menuGroups": { "PowerMenu": { - "text2": [ - "", - "電源設定" - ], + "text2": "電源設定", "desc": "電源設定" }, "SolderingMenu": { - "text2": [ - "", - "焊接設定" - ], + "text2": "焊接設定", "desc": "焊接設定" }, "PowerSavingMenu": { - "text2": [ - "", - "待機設定" - ], + "text2": "待機設定", "desc": "自動待機省電設定" }, "UIMenu": { - "text2": [ - "", - "使用者介面" - ], + "text2": "使用者介面", "desc": "使用者介面設定" }, "AdvancedMenu": { - "text2": [ - "", - "進階設定" - ], + "text2": "進階設定", "desc": "進階設定" } }, "menuOptions": { "DCInCutoff": { - "text2": [ - "", - "電源" - ], + "text2": "電源", "desc": "輸入電源;設定自動停機電壓 " }, "SleepTemperature": { - "text2": [ - "", - "待機溫度" - ], + "text2": "待機溫度", "desc": "於待機模式時的鉻鐵頭溫度" }, "SleepTimeout": { - "text2": [ - "", - "待機延時" - ], + "text2": "待機延時", "desc": "自動進入待機模式前的閒置等候時間 " }, "ShutdownTimeout": { - "text2": [ - "", - "自動關機" - ], + "text2": "自動關機", "desc": "自動關機前的閒置等候時間 " }, "MotionSensitivity": { - "text2": [ - "", - "動作敏感度" - ], + "text2": "動作敏感度", "desc": "0=停用 | 1=最低敏感度 | ... | 9=最高敏感度" }, "TemperatureUnit": { - "text2": [ - "", - "溫標" - ], + "text2": "溫標", "desc": "C=攝氏 | F=華氏" }, "AdvancedIdle": { - "text2": [ - "", - "詳細閒置畫面" - ], + "text2": "詳細閒置畫面", "desc": "於閒置畫面以英文小字型顯示詳細資料" }, "DisplayRotation": { - "text2": [ - "", - "畫面方向" - ], + "text2": "畫面方向", "desc": "A=自動 | L=使用左手 | R=使用右手" }, "BoostTemperature": { - "text2": [ - "", - "增熱溫度" - ], + "text2": "增熱溫度", "desc": "於增熱模式時使用的溫度" }, "AutoStart": { - "text2": [ - "", - "自動啟用" - ], + "text2": "自動啟用", "desc": "開機時自動啟用 <無=停用 | 焊=焊接模式 | 待=待機模式 | 室=室溫待機>" }, "CooldownBlink": { - "text2": [ - "", - "降溫時閃爍" - ], + "text2": "降溫時閃爍", "desc": "停止加熱之後,當鉻鐵頭仍處於高溫時閃爍畫面" }, "TemperatureCalibration": { - "text2": [ - "", - "溫度校正?" - ], + "text2": "溫度校正?", "desc": "開始校正鉻鐵頭溫度位移" }, "SettingsReset": { - "text2": [ - "", - "全部重設?" - ], + "text2": "全部重設?", "desc": "將所有設定重設到預設值" }, "VoltageCalibration": { - "text2": [ - "", - "輸入電壓校正?" - ], + "text2": "輸入電壓校正?", "desc": "開始校正VIN輸入電壓 <長按以退出>" }, "AdvancedSoldering": { - "text2": [ - "", - "詳細焊接畫面" - ], + "text2": "詳細焊接畫面", "desc": "於焊接模式畫面以英文小字型顯示詳細資料" }, "ScrollingSpeed": { - "text2": [ - "", - "捲動速度" - ], + "text2": "捲動速度", "desc": "解說文字的捲動速度" }, "QCMaxVoltage": { - "text2": [ - "", - "QC電壓" - ], + "text2": "QC電壓", "desc": "使用QC電源時請求的最高目標電壓" }, "PowerLimit": { - "text2": [ - "", - "功率限制" - ], + "text2": "功率限制", "desc": "限制鉻鐵可用的最大功率 " }, "ReverseButtonTempChange": { - "text2": [ - "", - "調換加減鍵" - ], + "text2": "調換加減鍵", "desc": "調校溫度時調換加減鍵的方向" }, "TempChangeShortStep": { - "text2": [ - "", - "溫度調整 短" - ], + "text2": "溫度調整 短", "desc": "調校溫度時短按一下的溫度變幅" }, "TempChangeLongStep": { - "text2": [ - "", - "溫度調整 長" - ], + "text2": "溫度調整 長", "desc": "調校溫度時長按按鍵的溫度變幅" }, "PowerPulsePower": { - "text2": [ - "", - "電源脈衝" - ], + "text2": "電源脈衝", "desc": "為保持電源喚醒而通電所用的功率 " }, "HallEffSensitivity": { - "text2": [ - "", - "磁場敏感度" - ], + "text2": "磁場敏感度", "desc": "磁場感應器用作啟動待機模式的敏感度 <關=停用 | 低=最低敏感度 | 中=中等敏感度 | 高=最高敏感度>" }, "LockingMode": { - "text2": [ - "", - "按鍵鎖定" - ], + "text2": "按鍵鎖定", "desc": "於焊接模式時,同時長按兩個按鍵啟用按鍵鎖定 <無=停用 | 增=鎖定增熱模式 | 全=鎖定全部>" }, "MinVolCell": { - "text2": [ - "", - "最低電壓" - ], + "text2": "最低電壓", "desc": "每顆電池的最低可用電壓 <伏特> <3S: 3.0V - 3.7V, 4/5/6S: 2.4V - 3.7V>" }, "AnimLoop": { - "text2": [ - "", - "動畫循環" - ], + "text2": "動畫循環", "desc": "循環顯示功能表圖示動畫" }, "AnimSpeed": { - "text2": [ - "", - "動畫速度" - ], + "text2": "動畫速度", "desc": "功能表圖示動畫的速度 <關=不顯示動畫 | 慢=慢速 | 中=中速 | 快=快速>" }, "PowerPulseWait": { - "text2": [ - "", - "電源脈衝間隔" - ], + "text2": "電源脈衝間隔", "desc": "為保持電源喚醒,每次通電之間的間隔時間 " }, "PowerPulseDuration": { - "text2": [ - "", - "電源脈衝時長" - ], + "text2": "電源脈衝時長", "desc": "為保持電源喚醒,每次通電脈衝的時間長度 " } } diff --git a/Translations/translations_def.js b/Translations/translations_def.js index b8d4aa5d..b4b01eb8 100644 --- a/Translations/translations_def.js +++ b/Translations/translations_def.js @@ -81,44 +81,33 @@ var def = "id": "OffString", "maxLen": 3 }, - { - "id": "ResetOKMessage", - "maxLen": 8 - }, { "id": "YourGainMessage", "maxLen": 8, "default": "Your Gain" + } + ], + "messagesWarn": [ + { + "id": "ResetOKMessage" }, { - "id": "SettingsResetMessage", - "maxLen": 16, - "default": "Settings were\nreset!" + "id": "SettingsResetMessage" }, { - "id": "NoAccelerometerMessage", - "maxLen": 16, - "default": "No accelerometer\ndetected!" + "id": "NoAccelerometerMessage" }, { - "id": "NoPowerDeliveryMessage", - "maxLen": 16, - "default": "No USB-PD IC\ndetected!" + "id": "NoPowerDeliveryMessage" }, { - "id": "LockingKeysString", - "maxLen": 8, - "default": "LOCKING" + "id": "LockingKeysString" }, { - "id": "UnlockingKeysString", - "maxLen": 8, - "default": "UNLOCK" + "id": "UnlockingKeysString" }, { - "id": "WarningKeysLockedString", - "maxLen": 8, - "default": "LOCKED!" + "id": "WarningKeysLockedString" } ], "characters": [ @@ -206,23 +195,28 @@ var def = "menuGroups": [ { "id": "PowerMenu", - "maxLen": 11 + "maxLen": 5, + "maxLen2": 11 }, { "id": "SolderingMenu", - "maxLen": 11 + "maxLen": 5, + "maxLen2": 11 }, { "id": "PowerSavingMenu", - "maxLen": 11 + "maxLen": 5, + "maxLen2": 11 }, { "id": "UIMenu", - "maxLen": 11 + "maxLen": 5, + "maxLen2": 11 }, { "id": "AdvancedMenu", - "maxLen": 11 + "maxLen": 5, + "maxLen2": 11 } ], "menuOptions": [ diff --git a/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 b/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 new file mode 100644 index 00000000..ebc9ecaf --- /dev/null +++ b/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5 @@ -0,0 +1 @@ +8312c4c91799885f222f663fc81f9a31 gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 diff --git a/ci/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2.md5 b/ci/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2.md5 deleted file mode 100644 index a165cc93..00000000 --- a/ci/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2.md5 +++ /dev/null @@ -1 +0,0 @@ -2b9eeccc33470f9d3cda26983b9d2dc6 gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 diff --git a/setup.sh b/setup.sh index 713636c4..8ac5edfe 100644 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ set -e # Setup shell file to setup the environment on an ubuntu machine sudo apt-get update && sudo apt-get install -y make bzip2 git python3 python3-pip wget -python3 -m pip install bdflib +python3 -m pip install bdflib black flake8 sudo mkdir -p /build cd /build @@ -12,25 +12,27 @@ cd /build MDPATH=${GITHUB_WORKSPACE:-/build/source/} sudo mkdir -p /build/cache cd /build/cache/ -if md5sum -c $MDPATH/ci/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2.md5; then +if md5sum -c $MDPATH/ci/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2.md5; then echo "Good MD5 ARM" else echo "ARM MD5 Mismatch, downloading fresh" - sudo wget -q https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -O gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 + sudo wget -q "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" -O gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 + rm -rf $MDPATH/ci/gcc-arm*.bz2 || true fi if md5sum -c $MDPATH/ci/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2.md5; then echo "Good MD5 RISCV" else echo "RISCV MD5 Mismatch, downloading fresh" - sudo wget -q https://github.com/Ralim/nuclei-compiler/releases/download/2020.08/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2 -O nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2 + sudo wget -q "https://github.com/Ralim/nuclei-compiler/releases/download/2020.08/nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2" -O nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2 + rm -rf $MDPATH/ci/nuclei*.bz2 || true fi echo "Extracting compilers" -sudo tar -xj -f gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -C /build/ +sudo tar -xj -f gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /build/ sudo tar -xj -f nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2 -C /build/ echo "Link into PATH" -sudo ln -s /build/gcc-arm-none-eabi-9-2020-q2-update/bin/* /usr/local/bin +sudo ln -s /build/gcc-arm-none-eabi-10-2020-q4-major/bin/* /usr/local/bin sudo ln -s /build/gcc/bin/* /usr/local/bin diff --git a/source/Core/Drivers/OLED.cpp b/source/Core/Drivers/OLED.cpp index 8aa8ae8a..479a5523 100644 --- a/source/Core/Drivers/OLED.cpp +++ b/source/Core/Drivers/OLED.cpp @@ -267,6 +267,26 @@ void OLED::print(const char *const str, FontStyle fontStyle) { } } +/** + * Prints a static string message designed to use the whole screen, starting + * from the top-left corner. + * + * If the message starts with a newline (`\\x01`), the string starting from + * after the newline is printed in the large font. Otherwise, the message + * is printed in the small font. + * + * @param string The string message to be printed + */ +void OLED::printWholeScreen(const char *string) { + setCursor(0, 0); + if (string[0] == '\x01') { + // Empty first line means that this uses large font (for CJK). + OLED::print(string + 1, FontStyle::LARGE); + } else { + OLED::print(string, FontStyle::SMALL); + } +} + inline void stripLeaderZeros(char *buffer, uint8_t places) { // Removing the leading zero's by swapping them to SymbolSpace // Stop 1 short so that we dont blank entire number if its zero diff --git a/source/Core/Drivers/OLED.hpp b/source/Core/Drivers/OLED.hpp index 458f74ef..9332c4ee 100644 --- a/source/Core/Drivers/OLED.hpp +++ b/source/Core/Drivers/OLED.hpp @@ -55,6 +55,7 @@ public: static bool getRotation() { return inLeftHandedMode; } static int16_t getCursorX() { return cursor_x; } static void print(const char *string, FontStyle fontStyle); // Draw a string to the current location, with selected font + static void printWholeScreen(const char *string); // Set the cursor location by pixels static void setCursor(int16_t x, int16_t y) { cursor_x = x; diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 5df7b817..69c96a34 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -12,9 +12,9 @@ extern const uint8_t USER_FONT_12[]; extern const uint8_t USER_FONT_6x8[]; extern const bool HasFahrenheit; -extern const char *SettingsShortNames[33][2]; -extern const char *SettingsDescriptions[33]; -extern const char *SettingsMenuEntries[5]; +extern const char *SettingsShortNames[]; +extern const char *SettingsDescriptions[]; +extern const char *SettingsMenuEntries[]; extern const char *SettingsCalibrationDone; extern const char *SettingsCalibrationWarning; @@ -35,8 +35,9 @@ extern const char *IdleSetString; extern const char *TipDisconnectedString; extern const char *SolderingAdvancedPowerPrompt; extern const char *OffString; -extern const char *ResetOKMessage; extern const char *YourGainMessage; + +extern const char *ResetOKMessage; extern const char *SettingsResetMessage; extern const char *NoAccelerometerMessage; extern const char *NoPowerDeliveryMessage; diff --git a/source/Core/Inc/gui.hpp b/source/Core/Inc/gui.hpp index 0ddd9365..45e9f288 100644 --- a/source/Core/Inc/gui.hpp +++ b/source/Core/Inc/gui.hpp @@ -29,6 +29,7 @@ typedef struct { void enterSettingsMenu(); void GUIDelay(); +void warnUser(const char *warning, const int timeout); extern const menuitem rootSettingsMenu[]; #endif /* GUI_HPP_ */ diff --git a/source/Core/Src/gui.cpp b/source/Core/Src/gui.cpp index 779efc79..55253c91 100644 --- a/source/Core/Src/gui.cpp +++ b/source/Core/Src/gui.cpp @@ -237,20 +237,6 @@ const menuitem advancedMenu[] = { {nullptr, nullptr, nullptr} // end of menu marker. DO NOT REMOVE }; -static void printShortDescriptionDoubleLine(SettingsItemIndex settingsItemIndex) { - uint8_t shortDescIndex = static_cast(settingsItemIndex); - if (SettingsShortNames[shortDescIndex][0][0] == '\x00') { - // Empty first line means that this uses large font (for CJK). - OLED::setCursor(0, 0); - OLED::print(SettingsShortNames[shortDescIndex][1], FontStyle::LARGE); - } else { - OLED::setCursor(0, 0); - OLED::print(SettingsShortNames[shortDescIndex][0], FontStyle::SMALL); - OLED::setCursor(0, 8); - OLED::print(SettingsShortNames[shortDescIndex][1], FontStyle::SMALL); - } -} - /** * Prints two small lines (or one line for CJK) of short description for * setting items and prepares cursor after it. @@ -260,7 +246,8 @@ static void printShortDescriptionDoubleLine(SettingsItemIndex settingsItemIndex) */ static void printShortDescription(SettingsItemIndex settingsItemIndex, uint16_t cursorCharPosition) { // print short description (default single line, explicit double line) - printShortDescriptionDoubleLine(settingsItemIndex); + uint8_t shortDescIndex = static_cast(settingsItemIndex); + OLED::printWholeScreen(SettingsShortNames[shortDescIndex]); // prepare cursor for value // make room for scroll indicator @@ -724,13 +711,7 @@ static bool settings_displayCoolingBlinkEnabled(void) { static bool settings_setResetSettings(void) { if (userConfirmation(SettingsResetWarning)) { resetSettings(); - - OLED::clearScreen(); - OLED::setCursor(0, 0); - OLED::print(ResetOKMessage, FontStyle::LARGE); - OLED::refresh(); - - waitForButtonPressOrTimeout(2000); // 2 second timeout + warnUser(ResetOKMessage, 2 * TICKS_SECOND); } return false; } @@ -814,7 +795,7 @@ static bool settings_setCalibrateVIN(void) { OLED::setCursor(0, 0); OLED::printNumber(systemSettings.voltageDiv, 3, FontStyle::LARGE); OLED::refresh(); - waitForButtonPressOrTimeout(1000); + waitForButtonPressOrTimeout(1 * TICKS_SECOND); return false; case BUTTON_NONE: default: @@ -1014,18 +995,8 @@ static bool animOpenState = false; static void displayMenu(size_t index) { // Call into the menu - const char *textPtr = SettingsMenuEntries[index]; - FontStyle font; - if (textPtr[0] == '\x01') { // `\x01` is used as newline. - // Empty first line means that this uses large font (for CJK). - font = FontStyle::LARGE; - textPtr++; - } else { - font = FontStyle::SMALL; - } - OLED::setCursor(0, 0); // Draw title - OLED::print(textPtr, font); + OLED::printWholeScreen(SettingsMenuEntries[index]); // Draw symbol // 16 pixel wide image // 2 pixel wide scrolling indicator diff --git a/source/Core/Threads/GUIThread.cpp b/source/Core/Threads/GUIThread.cpp index df2649a5..5fb5c7ad 100644 --- a/source/Core/Threads/GUIThread.cpp +++ b/source/Core/Threads/GUIThread.cpp @@ -43,10 +43,10 @@ static uint16_t min(uint16_t a, uint16_t b) { else return a; } -void warnUser(const char *warning, const FontStyle font, const int timeout) { + +void warnUser(const char *warning, const int timeout) { OLED::clearScreen(); - OLED::setCursor(0, 0); - OLED::print(warning, font); + OLED::printWholeScreen(warning); OLED::refresh(); waitForButtonPressOrTimeout(timeout); } @@ -462,7 +462,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) { case BUTTON_BOTH_LONG: // Unlock buttons buttonsLocked = false; - warnUser(UnlockingKeysString, FontStyle::LARGE, TICKS_SECOND); + warnUser(UnlockingKeysString, TICKS_SECOND); break; case BUTTON_F_LONG: // if boost mode is enabled turn it on @@ -476,7 +476,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) { case BUTTON_F_SHORT: case BUTTON_B_SHORT: // Do nothing and display a lock warming - warnUser(WarningKeysLockedString, FontStyle::LARGE, TICKS_SECOND / 2); + warnUser(WarningKeysLockedString, TICKS_SECOND / 2); break; default: break; @@ -511,7 +511,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) { if (systemSettings.lockingMode != 0) { // Lock buttons buttonsLocked = true; - warnUser(LockingKeysString, FontStyle::LARGE, TICKS_SECOND); + warnUser(LockingKeysString, TICKS_SECOND); } break; default: @@ -713,12 +713,7 @@ void showDebugMenu(void) { void showWarnings() { // Display alert if settings were reset if (settingsWereReset) { - if (SettingsResetMessage[0] == '\x01') { // `\x01` is used as newline. - // Empty first line means that this uses large font (for CJK). - warnUser(SettingsResetMessage + 1, FontStyle::LARGE, 10 * TICKS_SECOND); - } else { - warnUser(SettingsResetMessage, FontStyle::SMALL, 10 * TICKS_SECOND); - } + warnUser(SettingsResetMessage, 10 * TICKS_SECOND); } #ifndef NO_WARN_MISSING // We also want to alert if accel or pd is not detected / not responding @@ -732,7 +727,7 @@ void showWarnings() { if (systemSettings.accelMissingWarningCounter < 2) { systemSettings.accelMissingWarningCounter++; saveSettings(); - warnUser(NoAccelerometerMessage, FontStyle::SMALL, 10 * TICKS_SECOND); + warnUser(NoAccelerometerMessage, 10 * TICKS_SECOND); } } #ifdef POW_PD @@ -741,7 +736,7 @@ void showWarnings() { if (systemSettings.pdMissingWarningCounter < 2) { systemSettings.pdMissingWarningCounter++; saveSettings(); - warnUser(NoPowerDeliveryMessage, FontStyle::SMALL, 10 * TICKS_SECOND); + warnUser(NoPowerDeliveryMessage, 10 * TICKS_SECOND); } } #endif diff --git a/source/Makefile b/source/Makefile index 5a5c3070..008c05ed 100644 --- a/source/Makefile +++ b/source/Makefile @@ -316,7 +316,7 @@ $(OUT_OBJS_S): $(OUTPUT_DIR)/%.o: %.S Makefile @echo 'Building file: $<' @$(AS) -c $(AFLAGS) $< -o $@ -Core/Gen/Translation.%.cpp: ../Translations/translation_%.json Makefile ../Translations/make_translation.py ../Translations/translations_commons.js ../Translations/font_tables.py ../Translations/wqy-bitmapsong/wenquanyi_9pt.bdf +Core/Gen/Translation.%.cpp: ../Translations/translation_%.json Makefile ../Translations/make_translation.py ../Translations/translations_def.js ../Translations/font_tables.py ../Translations/wqy-bitmapsong/wenquanyi_9pt.bdf @test -d $(@D) || mkdir -p $(@D) @echo 'Generating translations for language $*' @python3 ../Translations/make_translation.py -o $(PWD)/$@ $*