v2.0: Full localization (6 languages), first-run language screen, aircraft detail overhaul, aircraft-model API fallback, and multiple bugfixes

This commit is contained in:
Eiswolf-BG
2026-08-04 01:32:44 +02:00
parent 4e8bfcd30c
commit 665130e8bb
45 changed files with 2705 additions and 240 deletions

37
src/i18n.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "i18n.h"
#include "i18n_en.h"
#include "i18n_de.h"
#include "i18n_fr.h"
#include "i18n_tr.h"
#include "i18n_es.h"
#include "i18n_it.h"
#include "settings_store.h"
namespace I18n {
namespace {
const char* const* TABLES[LANG_COUNT] = {
I18N_EN, I18N_DE, I18N_FR, I18N_TR, I18N_ES, I18N_IT
};
const char* const LANGUAGE_NAMES[LANG_COUNT] = {
"English", "Deutsch", "Francais", "Turkce", "Espanol", "Italiano"
};
}
const char* t(StringId id) {
uint8_t lang = SettingsStore::language();
if (lang >= LANG_COUNT) lang = 0;
uint8_t idx = (uint8_t)id;
if (idx >= (uint8_t)StringId::COUNT) return "?";
return TABLES[lang][idx];
}
const char* languageName(uint8_t index) {
if (index >= LANG_COUNT) return "?";
return LANGUAGE_NAMES[index];
}
}