mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-10-23 21:32:33 +00:00
i18n: find the strings the audit could not see, and the apps it never checked
pisti87 reported a long list of text that stays English whatever the language, and said the strings were in his language file and still did not appear (#257). Both halves are true, and the reason is the audit. The extractor only ever recognised TR("literal"). Three very common shapes were therefore invisible: mk_row_btn("Reload tiles in view", cb) // helper TR()s its parameter for (auto& r : rows) TR(r.label) // literal lives in a local table TR(contactsSortOptName(m)) // helper returns one of several All three translate correctly at runtime, so the source looks properly wrapped. But the literal at the call site was never emitted as a key, so it never entered a .lang file, so no translator could ever supply it -- and adding it by hand did nothing, because the audit's key list is what the files are checked against. That is 51 strings across the map options sheet, the sort sheets, the contacts filters and the home launcher. The audit now understands all three, plus tr("...") in the Lua apps, and the newly visible keys are in all thirteen files as placeholders so translators can see them. 1017 keys, up from 966. Four strings were genuinely raw and are now wrapped: the reader's idle status, the Discover empty feed, the crash-report export button and Paste (move/copy). Lua apps had no way to translate anything at all, so every built-in was hard English regardless of the device language. wada.sys.tr() gives them the same table the interface uses; airtime 1.4 is the first to use it, with the `sys.tr or identity` fallback so it still runs on older firmware. Two more instances of the drift this issue is really about: - gen-lua-builtin.py read out/firmware/apps/, which nothing writes -- the deploy rsyncs deploy/apps/ straight to the VPS. So the mirror was stale and the two apps added in beta_68 were never baked in: boards that cannot reach the Store shipped without them. It reads the canonical directory now, and regenerates from the same pre-build hook as the language table. - Baking a row whose translation equals its key does nothing, since TR() returns the key on a miss. Skipping them takes the header from 1.11 MB to 939 KB and gives the V4 back 16 KB of flash, which matters at 89%. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a9cff6f113
commit
eb439c8baa
30 files changed
+2596
-1176
No files matched your search
@@ -20662,7 +20662,7 @@ static void fmOpenActions(const char* name, bool isdir) {
|
||||
#endif
|
||||
}
|
||||
if (s_fm_clip.active) {
|
||||
fmActionBtn(card, s_fm_clip.is_cut ? "Paste (move)" : "Paste (copy)", fmActPasteCb, 0x2D4A2D);
|
||||
fmActionBtn(card, s_fm_clip.is_cut ? TR("Paste (move)") : TR("Paste (copy)"), fmActPasteCb, 0x2D4A2D);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22414,7 +22414,8 @@ static void openReaderPage() {
|
||||
lv_obj_set_pos(s_reader_status, 6, top + 44);
|
||||
lv_obj_set_style_text_font(s_reader_status, &g_font_12, LV_PART_MAIN);
|
||||
lv_obj_set_style_text_color(s_reader_status, lv_color_hex(COLOR_SUB), LV_PART_MAIN);
|
||||
lv_label_set_text(s_reader_status, s_reader_msg[0] ? s_reader_msg : "On-device text browser \xc2\xb7 no proxy, no tracking");
|
||||
lv_label_set_text(s_reader_status, s_reader_msg[0] ? s_reader_msg
|
||||
: TR("On-device text browser \xc2\xb7 no proxy, no tracking"));
|
||||
// (Collapsed state shows the URL in the status-bar title zone — see readerSetAddrExpanded.)
|
||||
// --- Body: a vertical scroll container we fill with paragraph + link labels ---
|
||||
s_reader_scroll = lv_obj_create(s_reader_root);
|
||||
@@ -22675,7 +22676,7 @@ static void discoverBuildFeed() {
|
||||
(unsigned)discTypeColor(h.node_type), disp_esc, discTypeShort(h.node_type),
|
||||
(int)h.our_rssi, (double)h.our_snr_q4 / 4.0, direct, dist_seg, ago);
|
||||
}
|
||||
if (q == 0) snprintf(buf, sizeof buf, "#7A7F87 Scanning\xE2\x80\xA6 nothing has answered yet#");
|
||||
if (q == 0) snprintf(buf, sizeof buf, TR("#7A7F87 Scanning\xE2\x80\xA6 nothing has answered yet#"));
|
||||
else if (buf[q - 1] == '\n') buf[q - 1] = '\0';
|
||||
lv_label_set_text(s_discover_feed, buf);
|
||||
if (s_discover_status)
|
||||
@@ -31574,8 +31575,8 @@ static void settingsCatBuild(int cat) {
|
||||
lv_obj_set_style_bg_color(crash_btn, lv_color_hex(0x8A3B2E), LV_PART_MAIN); // warning red-brown
|
||||
lv_obj_add_event_cb(crash_btn, crashDumpExportCb, LV_EVENT_CLICKED, nullptr);
|
||||
lv_obj_t* cbl = lv_label_create(crash_btn);
|
||||
char ct[56];
|
||||
snprintf(ct, sizeof ct, LV_SYMBOL_WARNING " Export crash report (%uK)",
|
||||
char ct[96]; // room for a translated label
|
||||
snprintf(ct, sizeof ct, TR(LV_SYMBOL_WARNING " Export crash report (%uK)"),
|
||||
(unsigned)(s_crash_dump_size / 1024));
|
||||
lv_label_set_text(cbl, ct);
|
||||
lv_obj_set_style_text_font(cbl, &g_font_14, LV_PART_MAIN);
|
||||
|
||||
Reference in new issue
Block a user