mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
rename num_languages
This commit is contained in:
@@ -50,7 +50,7 @@ namespace emsesp {
|
|||||||
// Languages supported. Note: the order is important and must match locale_translations.h
|
// Languages supported. Note: the order is important and must match locale_translations.h
|
||||||
const char * const languages[] = {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE, EMSESP_LOCALE_NL, EMSESP_LOCALE_SV, EMSESP_LOCALE_PL, EMSESP_LOCALE_NO, EMSESP_LOCALE_FR};
|
const char * const languages[] = {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE, EMSESP_LOCALE_NL, EMSESP_LOCALE_SV, EMSESP_LOCALE_PL, EMSESP_LOCALE_NO, EMSESP_LOCALE_FR};
|
||||||
|
|
||||||
size_t num_languages = sizeof(languages) / sizeof(const char *);
|
static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *);
|
||||||
|
|
||||||
uuid::log::Logger System::logger_{F_(system), uuid::log::Facility::KERN};
|
uuid::log::Logger System::logger_{F_(system), uuid::log::Facility::KERN};
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ bool System::restart_requested_ = false;
|
|||||||
// find the index of the language
|
// find the index of the language
|
||||||
// 0 = EN, 1 = DE, etc...
|
// 0 = EN, 1 = DE, etc...
|
||||||
uint8_t System::language_index() {
|
uint8_t System::language_index() {
|
||||||
for (uint8_t i = 0; i < num_languages; i++) {
|
for (uint8_t i = 0; i < NUM_LANGUAGES; i++) {
|
||||||
if (languages[i] == locale()) {
|
if (languages[i] == locale()) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user