File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ const LanguageData const languageData[LANGUAGE_COUNT] = {
18
18
Language currentLanguage = LANGUAGE_ZH_HANS ;
19
19
20
20
const char * getLangString (L_StringID stringID ) {
21
+ if (stringID >= _L_COUNT ) {
22
+ return "@@STR@@" ;
23
+ }
24
+ if (currentLanguage >= LANGUAGE_COUNT ) {
25
+ return lang_en_US [stringID ];
26
+ }
21
27
const char * string = languageData [currentLanguage ].strings [stringID ];
22
28
return string && strlen (string ) > 0 ? string : lang_en_US [stringID ];
23
29
}
@@ -47,6 +53,8 @@ const char *getLangDesc(Language lang) {
47
53
return "日本語" ;
48
54
} else if (lang == LANGUAGE_PT_PT ) {
49
55
return "Português(Portugal)" ;
56
+ } else {
57
+ return "@@LANG@@" ;
50
58
}
51
59
}
52
60
Original file line number Diff line number Diff line change 93
93
#include "hal_spi_flash.h"
94
94
95
95
#include "cache.h"
96
- #include "settings.h"
97
96
#include "i18n/language.h"
97
+ #include "settings.h"
98
98
99
99
#define APP_SCHED_MAX_EVENT_SIZE 4 /**< Maximum size of scheduler events. */
100
100
#define APP_SCHED_QUEUE_SIZE 16 /**< Maximum number of events in the scheduler queue. */
104
104
105
105
#define APP_SHUTDOWN_HANDLER_PRIORITY 1
106
106
107
-
108
107
int8_t g_usb_led_marquee_enable = 0 ; /** dummy for chameleon */
109
108
110
109
// #define SPI_FLASH
@@ -166,8 +165,6 @@ static bool shutdown_handler(nrf_pwr_mgmt_evt_t event) {
166
165
// save settings
167
166
settings_save ();
168
167
169
-
170
-
171
168
hal_spi_flash_sleep ();
172
169
173
170
err_code = bsp_wakeup_button_enable (BTN_ID_SLEEP );
@@ -260,7 +257,7 @@ int main(void) {
260
257
err_code = ntag_emu_init (& default_ntag215 );
261
258
APP_ERROR_CHECK (err_code );
262
259
263
- //cache_clean(); //FOR TESTING
260
+ // cache_clean(); //FOR TESTING
264
261
check_wakeup_src ();
265
262
266
263
err_code = settings_init ();
@@ -277,11 +274,8 @@ int main(void) {
277
274
278
275
NRF_LOG_DEBUG ("init done" );
279
276
280
- if (p_settings -> language >= LANGUAGE_COUNT ) {
281
- p_settings -> language = LANGUAGE_EN_US ;
282
- }
283
277
setLanguage (p_settings -> language );
284
-
278
+
285
279
mui_t * p_mui = mui ();
286
280
mui_init (p_mui );
287
281
You can’t perform that action at this time.
0 commit comments