diff --git a/interface/src/App.tsx b/interface/src/App.tsx index 8db9f2f28..0341dc9e6 100644 --- a/interface/src/App.tsx +++ b/interface/src/App.tsx @@ -20,7 +20,7 @@ const ALL_LOCALES = [ 'sk', 'sv', 'tr', - 'cz' + 'cs' ] as Locales[]; // Optional build-time allow-list (e.g. VITE_APP_LOCALES="en,de,nl"). When unset, diff --git a/interface/src/app/settings/ApplicationSettings.tsx b/interface/src/app/settings/ApplicationSettings.tsx index 9f2a63819..44e3a0fb0 100644 --- a/interface/src/app/settings/ApplicationSettings.tsx +++ b/interface/src/app/settings/ApplicationSettings.tsx @@ -548,7 +548,7 @@ const ApplicationSettings = () => { margin="normal" select > - Česky (CZ) + Česky (CZ) Deutsch (DE) English (EN) Français (FR) diff --git a/interface/src/components/inputs/LanguageSelector.tsx b/interface/src/components/inputs/LanguageSelector.tsx index 3eb5b59a4..f96192fa6 100644 --- a/interface/src/components/inputs/LanguageSelector.tsx +++ b/interface/src/components/inputs/LanguageSelector.tsx @@ -4,7 +4,7 @@ import type { CSSProperties } from 'react'; import { MenuItem, TextField } from '@mui/material'; -import CZflag from 'i18n/CZ.svg'; +import CSflag from 'i18n/CS.svg'; import DEflag from 'i18n/DE.svg'; import FRflag from 'i18n/FR.svg'; import GBflag from 'i18n/GB.svg'; @@ -28,7 +28,7 @@ interface LanguageOption { } const LANGUAGE_OPTIONS: LanguageOption[] = [ - { key: 'cz', flag: CZflag, label: 'CZ' }, + { key: 'cs', flag: CSflag, label: 'CS' }, { key: 'de', flag: DEflag, label: 'DE' }, { key: 'en', flag: GBflag, label: 'EN' }, { key: 'fr', flag: FRflag, label: 'FR' }, diff --git a/interface/src/i18n/CZ.svg b/interface/src/i18n/CS.svg similarity index 100% rename from interface/src/i18n/CZ.svg rename to interface/src/i18n/CS.svg diff --git a/interface/src/i18n/cz/index.ts b/interface/src/i18n/cs/index.ts similarity index 99% rename from interface/src/i18n/cz/index.ts rename to interface/src/i18n/cs/index.ts index 07f534e64..85f203421 100644 --- a/interface/src/i18n/cz/index.ts +++ b/interface/src/i18n/cs/index.ts @@ -1,6 +1,6 @@ import type { Translation } from '../i18n-types'; -const cz: Translation = { +const cs: Translation = { LANGUAGE: 'Jazyk', RETRY: 'Zkusit znovu', LOADING: 'Načítání', @@ -370,4 +370,4 @@ const cz: Translation = { EXECUTE_COMMAND_SENT: 'Příkaz odeslán', }; -export default cz; +export default cs; diff --git a/src/core/helpers.cpp b/src/core/helpers.cpp index 62186fb3b..9e10c034f 100644 --- a/src/core/helpers.cpp +++ b/src/core/helpers.cpp @@ -814,7 +814,7 @@ std::string Helpers::toUpper(std::string const & s) { // capitalizes one UTF-8 character in char array // works with Latin1 (1 byte), Polish and other (2 bytes) characters -// supports special characters for all 11 supported languages: EN, DE, NL, SV, PL, NO, FR, TR, IT, SK, CZ +// supports special characters for all 11 supported languages: EN, DE, NL, SV, PL, NO, FR, TR, IT, SK, CS #if defined(EMSESP_STANDALONE) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wtype-limits" diff --git a/src/core/locale_translations.h b/src/core/locale_translations.h index f5ece66ac..b96084df9 100644 --- a/src/core/locale_translations.h +++ b/src/core/locale_translations.h @@ -30,9 +30,9 @@ #define EMSESP_LOCALE_TR "tr" #define EMSESP_LOCALE_IT "it" #define EMSESP_LOCALE_SK "sk" -#define EMSESP_LOCALE_CZ "cz" +#define EMSESP_LOCALE_CS "cs" -// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr, it, sk, cz +// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr, it, sk, cs // // if there is no translation, it will default to en diff --git a/src/core/system.cpp b/src/core/system.cpp index 97d90a487..b73eae0d1 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -71,7 +71,7 @@ const char * const languages[] = {EMSESP_LOCALE_EN, EMSESP_LOCALE_TR, EMSESP_LOCALE_IT, EMSESP_LOCALE_SK, - EMSESP_LOCALE_CZ}; + EMSESP_LOCALE_CS}; #endif static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *); @@ -1632,6 +1632,11 @@ bool System::check_upgrade() { return StateUpdateResult::CHANGED; } } + // Migrate language from cz to cs + if (settings.locale == "cz") { + settings.locale = "cs"; + return StateUpdateResult::CHANGED; + } return StateUpdateResult::UNCHANGED; }); } else if (this_version < settings_version) {