This commit is contained in:
proddy
2026-07-26 11:16:10 +02:00
parent ac36b072e8
commit c91488d2fe
8 changed files with 15 additions and 10 deletions

View File

@@ -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,

View File

@@ -548,7 +548,7 @@ const ApplicationSettings = () => {
margin="normal"
select
>
<MenuItem value="cz">Česky (CZ)</MenuItem>
<MenuItem value="cs">Česky (CZ)</MenuItem>
<MenuItem value="de">Deutsch (DE)</MenuItem>
<MenuItem value="en">English (EN)</MenuItem>
<MenuItem value="fr">Français (FR)</MenuItem>

View File

@@ -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' },

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

@@ -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;

View File

@@ -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"

View File

@@ -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

View File

@@ -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) {