mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-10-15 17:00:26 +00:00
i18n: undo the keys my extractor invented, and stop it inventing more
pisti87 read v18 and called it chaos. He was right, and it was mine.
Two defects in the extractor I added yesterday:
- It joined every string literal in a call argument, so a ternary became one
key. `cut ? "Paste (move)" : "Paste (copy)"` shipped as the single key
"Paste (move)Paste (copy)", and with it "Unblock Block",
"Unfav Favorite", "Other networksNetworks", "Batteryactivityon" and
"Stop sharing loc Share my loc". None of those strings exist anywhere in
the firmware. Literals are now grouped only when genuinely adjacent, which
is what the compiler concatenates, so both branches become their own key.
- It scanned raw source, comments included. That is how "Geblokkeerde
gebruikers" -- Dutch, appearing only inside a comment about how a long
translation degrades -- became a KEY in the Hungarian file. Comments are
stripped now, string literals preserved.
202 invented rows removed across the thirteen files. Only rows that were both
unknown to the extractor AND still untranslated were touched, so no
translator's work could be lost either way.
Also his: the curly quotes in the Hungarian credits render as boxes because no
bundled font carries U+201E/U+201D. Five values de-curled. And five strings he
found raw are wrapped: the Wi-Fi rescan and hidden-network rows, the update
check, and the downgrade prompt. The two Wi-Fi rows build their label at
runtime, since TR() returns a pointer and cannot join a glyph literal at
compile time.
Languages go to v19. v18 is deleted rather than left behind: it was only ever
correct for about a day and everything in it is superseded.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1ca1eab219
commit
cecede23be
+13
-6
@@ -5362,7 +5362,7 @@ static void versionCheckUpdateUi() {
|
||||
snprintf(b, sizeof b, TR("Firmware beta_%d\nCouldn't reach the update server"), my_n);
|
||||
lv_obj_set_style_text_color(s_update_about_lbl, lv_color_hex(COLOR_SUB), LV_PART_MAIN);
|
||||
} else {
|
||||
snprintf(b, sizeof b, "Firmware beta_%d\nChecking for updates over Wi-Fi…", my_n);
|
||||
snprintf(b, sizeof b, TR("Firmware beta_%d\nChecking for updates over Wi-Fi…"), my_n);
|
||||
lv_obj_set_style_text_color(s_update_about_lbl, lv_color_hex(COLOR_SUB), LV_PART_MAIN);
|
||||
}
|
||||
lv_label_set_text(s_update_about_lbl, b);
|
||||
@@ -5579,7 +5579,7 @@ static void otaPrevPickCb(lv_event_t* e) {
|
||||
s_ota_pending_n = v;
|
||||
otaPrevModalClose();
|
||||
char m[96];
|
||||
snprintf(m, sizeof m, "Install beta_%d?\nThis downgrades the firmware and reboots.", v);
|
||||
snprintf(m, sizeof m, TR("Install beta_%d?\nThis downgrades the firmware and reboots."), v);
|
||||
showConfirm(m, TR("Install"), otaConfirmInstallApply);
|
||||
}
|
||||
|
||||
@@ -14945,14 +14945,21 @@ static void wifiRebuildNetworkList() {
|
||||
|
||||
// Manual rescan (the scan is also kicked on open). Label flips while one runs.
|
||||
s_wifi_list_y += SC(6);
|
||||
wifiListRow(scanning_now ? LV_SYMBOL_REFRESH " Scanning\xE2\x80\xA6"
|
||||
: LV_SYMBOL_REFRESH " Scan again",
|
||||
// The glyph has to be joined at runtime: TR() returns a pointer, so it cannot
|
||||
// take part in the compiler's adjacent-string-literal concatenation.
|
||||
char wifi_rescan[48];
|
||||
snprintf(wifi_rescan, sizeof wifi_rescan, LV_SYMBOL_REFRESH " %s",
|
||||
scanning_now ? TR("Scanning\xE2\x80\xA6") : TR("Scan again"));
|
||||
wifiListRow(wifi_rescan,
|
||||
nullptr, lv_color_hex(scanning_now ? COLOR_SUB : COLOR_TEXT),
|
||||
scanning_now ? nullptr : wifiRefreshRowCb, nullptr);
|
||||
|
||||
// Hidden / manual network.
|
||||
s_wifi_list_y += SC(3);
|
||||
wifiListRow(LV_SYMBOL_PLUS " Other (hidden) network\xE2\x80\xA6", nullptr, lv_color_hex(COLOR_ACCENT), wifiHiddenRowCb, nullptr);
|
||||
char wifi_hidden[64];
|
||||
snprintf(wifi_hidden, sizeof wifi_hidden, LV_SYMBOL_PLUS " %s",
|
||||
TR("Other (hidden) network\xE2\x80\xA6"));
|
||||
wifiListRow(wifi_hidden, nullptr, lv_color_hex(COLOR_ACCENT), wifiHiddenRowCb, nullptr);
|
||||
lv_obj_set_height(s_wifi_list_cont, s_wifi_list_y + SC(2)); // grow the card to fit
|
||||
navMarkDirty();
|
||||
}
|
||||
@@ -22883,7 +22890,7 @@ static void discoverBuildFeed() {
|
||||
else if (buf[q - 1] == '\n') buf[q - 1] = '\0';
|
||||
lv_label_set_text(s_discover_feed, buf);
|
||||
if (s_discover_status)
|
||||
lv_label_set_text_fmt(s_discover_status, TR("%s \xC2\xB7 %d nearby (%d rpt, %d comp)"), s_discover_scanning ? "Scanning\xE2\x80\xA6" : "Paused", (int)m, rpt, comp);
|
||||
lv_label_set_text_fmt(s_discover_status, TR("%s \xC2\xB7 %d nearby (%d rpt, %d comp)"), s_discover_scanning ? TR("Scanning\xE2\x80\xA6") : TR("Paused"), (int)m, rpt, comp);
|
||||
}
|
||||
|
||||
// Sweep interval, backing off. A probe is not one packet: it is our zero-hop
|
||||
|
||||
Reference in New Issue
Block a user