[apps/global_preferences] DefaultLanguage is the first of the locales

Not EN, because we might build without the EN locale
This commit is contained in:
Léa Saviot
2020-04-06 11:52:55 +02:00
committed by EmilieNumworks
parent 19b5653851
commit efff509e2a
2 changed files with 5 additions and 2 deletions

View File

@@ -25,8 +25,9 @@ public:
void setFont(const KDFont * font) { m_font = font; }
constexpr static int NumberOfBrightnessStates = 5;
private:
static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have be an error when processing an empty EPSILON_I18N flag
GlobalPreferences() :
m_language(I18n::Language::EN),
m_language((I18n::Language)0),
m_examMode(ExamMode::Unknown),
m_showPopUp(true),
m_brightnessLevel(Ion::Backlight::MaxBrightness),

View File

@@ -95,8 +95,10 @@ def print_header(data, path, locales):
# Languages enumeration
f.write("enum class Language : uint16_t {\n")
index = 0
for locale in locales:
f.write(" " + locale.upper() + ",\n")
f.write(" " + locale.upper() + (" = 0" if (index < 1) else "") +",\n")
index = index + 1
f.write("};\n\n")
# Language names