mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
standalone includes two languages for testing, en & de
This commit is contained in:
@@ -52,11 +52,16 @@ using string_vector = std::vector<const char *>;
|
|||||||
#define F_(string_name) (__pstr__##string_name)
|
#define F_(string_name) (__pstr__##string_name)
|
||||||
#define FL_(list_name) (__pstr__L_##list_name)
|
#define FL_(list_name) (__pstr__L_##list_name)
|
||||||
|
|
||||||
#if defined(EMSESP_TEST) || defined(EMSESP_EN_ONLY)
|
#if defined(EMSESP_TEST)
|
||||||
// In testing just take one language (en) to save on Flash space
|
// in Test mode use two languages (en & de) to save flash memory needed for the tests
|
||||||
|
#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {de, nullptr};
|
||||||
|
#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, de, nullptr};
|
||||||
|
#elif defined(EMSESP_EN_ONLY)
|
||||||
|
// EN only
|
||||||
#define MAKE_WORD_TRANSLATION(list_name, en, ...) static const char * const __pstr__L_##list_name[] = {en, nullptr};
|
#define MAKE_WORD_TRANSLATION(list_name, en, ...) static const char * const __pstr__L_##list_name[] = {en, nullptr};
|
||||||
#define MAKE_TRANSLATION(list_name, shortname, en, ...) static const char * const __pstr__L_##list_name[] = {shortname, en, nullptr};
|
#define MAKE_TRANSLATION(list_name, shortname, en, ...) static const char * const __pstr__L_##list_name[] = {shortname, en, nullptr};
|
||||||
#elif defined(EMSESP_DE_ONLY)
|
#elif defined(EMSESP_DE_ONLY)
|
||||||
|
// EN + DE
|
||||||
#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {de, nullptr};
|
#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {de, nullptr};
|
||||||
#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, de, nullptr};
|
#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, de, nullptr};
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -52,12 +52,17 @@
|
|||||||
|
|
||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
// Languages supported. Note: the order is important and must match locale_translations.h
|
// Languages supported. Note: the order is important
|
||||||
#if defined(EMSESP_TEST) || defined(EMSESP_EN_ONLY)
|
// and must match locale_translations.h and common.h
|
||||||
// in Debug mode use one language (en) to save flash memory needed for the tests
|
#if defined(EMSESP_TEST)
|
||||||
|
// in Test mode use two languages (en & de) to save flash memory needed for the tests
|
||||||
|
const char * const languages[] = {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE};
|
||||||
|
#elif defined(EMSESP_EN_ONLY)
|
||||||
|
// EN only
|
||||||
const char * const languages[] = {EMSESP_LOCALE_EN};
|
const char * const languages[] = {EMSESP_LOCALE_EN};
|
||||||
#elif defined(EMSESP_DE_ONLY)
|
#elif defined(EMSESP_DE_ONLY)
|
||||||
const char * const languages[] = {EMSESP_LOCALE_DE};
|
// EN + DE
|
||||||
|
const char * const languages[] = {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE};
|
||||||
#else
|
#else
|
||||||
const char * const languages[] = {EMSESP_LOCALE_EN,
|
const char * const languages[] = {EMSESP_LOCALE_EN,
|
||||||
EMSESP_LOCALE_DE,
|
EMSESP_LOCALE_DE,
|
||||||
@@ -92,7 +97,7 @@ uint8_t System::language_index() {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0; // EN
|
return 0; // EN only
|
||||||
}
|
}
|
||||||
|
|
||||||
// send raw to ems
|
// send raw to ems
|
||||||
|
|||||||
Reference in New Issue
Block a user