Skip to content

Commit aa57be0

Browse files
committed
Facilitate translation of "device status" screen.
+ Extract English texts into constants. + Add German translations.
1 parent a7710e7 commit aa57be0

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

airrohr-firmware/airrohr-firmware.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,12 +1625,12 @@ static void webserver_status() {
16251625
#endif
16261626
versionHtml.replace("/", FPSTR(BR_TAG));
16271627
add_table_row_from_value(page_content, FPSTR(INTL_FIRMWARE), versionHtml);
1628-
add_table_row_from_value(page_content, F("Free Memory"), String(ESP.getFreeHeap()));
1628+
add_table_row_from_value(page_content, F(INTL_FREE_MEMORY), String(ESP.getFreeHeap()));
16291629
#if defined(ESP8266)
1630-
add_table_row_from_value(page_content, F("Heap Fragmentation"), String(ESP.getHeapFragmentation()), "%");
1630+
add_table_row_from_value(page_content, F(INTL_HEAP_FRAGMENTATION), String(ESP.getHeapFragmentation()), "%");
16311631
#endif
16321632
if (cfg::auto_update) {
1633-
add_table_row_from_value(page_content, F("Last OTA"), delayToString(millis() - last_update_attempt));
1633+
add_table_row_from_value(page_content, F(INTL_LAST_OTA), delayToString(millis() - last_update_attempt));
16341634
}
16351635
#if defined(ESP8266)
16361636
add_table_row_from_value(page_content, F("NTP Sync"), String(sntp_time_set));
@@ -1644,17 +1644,17 @@ static void webserver_status() {
16441644
ntpinfo.print(FPSTR(BR_TAG));
16451645
}
16461646
ntpinfo.printf_P(PSTR("%s (%s)"), IPAddress(*sntp).toString().c_str(), name ? name : "?");
1647-
ntpinfo.printf_P(PSTR(" reachable: %s"), sntp_getreachability(i) ? "Yes" : "No");
1647+
ntpinfo.printf_P(PSTR(" %s: %s"), F(INTL_REACHABLE), sntp_getreachability(i) ? F(INTL_YES) : F(INTL_NO));
16481648
}
16491649
}
16501650
add_table_row_from_value(page_content, F("NTP Info"), ntpinfo);
16511651
#endif
16521652

16531653
time_t now = time(nullptr);
16541654
add_table_row_from_value(page_content, FPSTR(INTL_TIME_UTC), ctime(&now));
1655-
add_table_row_from_value(page_content, F("Uptime"), delayToString(millis() - time_point_device_start_ms));
1655+
add_table_row_from_value(page_content, F(INTL_UPTIME), delayToString(millis() - time_point_device_start_ms));
16561656
#if defined(ESP8266)
1657-
add_table_row_from_value(page_content, F("Reset Reason"), ESP.getResetReason());
1657+
add_table_row_from_value(page_content, F(INTL_RESET_REASON), ESP.getResetReason());
16581658
#endif
16591659
if (cfg::sds_read) {
16601660
page_content += FPSTR(EMPTY_ROW);
@@ -1696,7 +1696,7 @@ static void webserver_status() {
16961696
}
16971697

16981698
if (last_sendData_returncode != 0) {
1699-
add_table_row_from_value(page_content, F("Data Send Return"),
1699+
add_table_row_from_value(page_content, F(INTL_DATA_SEND_RETURN_CODE),
17001700
last_sendData_returncode > 0 ? String(last_sendData_returncode) : HTTPClient::errorToString(last_sendData_returncode));
17011701
}
17021702
if (cfg::sds_read) {

airrohr-firmware/intl_de.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,14 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "Qualität";
125125
#define INTL_SENSOR "Sensor"
126126
#define INTL_PARAMETER "Parameter"
127127
#define INTL_VALUE "Wert"
128+
#define INTL_DATA_SEND_RETURN_CODE "Daten senden Return Code"
129+
#define INTL_UPTIME "Aktiv seit"
130+
#define INTL_RESET_REASON "Grund des Zurücksetzens"
131+
#define INTL_HEAP_FRAGMENTATION "Heap Fragmentierung"
132+
#define INTL_FREE_MEMORY "Freier Speicher"
133+
#define INTL_REACHABLE "erreichbar"
134+
#define INTL_YES "Ja"
135+
#define INTL_NO "Nein"
136+
#define INTL_LAST_OTA "Letzter OTA"
128137

129138
#include "./airrohr-logo-common.h"

airrohr-firmware/intl_en.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,14 @@ const char INTL_SIGNAL_QUALITY[] PROGMEM = "signal quality";
125125
#define INTL_SENSOR "Sensor"
126126
#define INTL_PARAMETER "Parameter"
127127
#define INTL_VALUE "Value"
128+
#define INTL_DATA_SEND_RETURN_CODE "Data Send Return"
129+
#define INTL_UPTIME "Uptime"
130+
#define INTL_RESET_REASON "Reset Reason"
131+
#define INTL_HEAP_FRAGMENTATION "Heap Fragmentation"
132+
#define INTL_FREE_MEMORY "Free Memory"
133+
#define INTL_REACHABLE "reachable"
134+
#define INTL_YES "Yes"
135+
#define INTL_NO "No"
136+
#define INTL_LAST_OTA "Last OTA"
128137

129138
#include "./airrohr-logo-common.h"

0 commit comments

Comments
 (0)