i18n fixes

This commit is contained in:
Flowseal
2026-06-23 18:24:26 +03:00
parent 85b5e7f22a
commit 6b5fd72612
9 changed files with 38 additions and 19 deletions
+4 -3
View File
@@ -26,7 +26,7 @@ class LocaleEnum(str, Enum):
_LOCALES_DIR = Path(__file__).resolve().parent
_DEFAULT_LOCALE = LocaleEnum.russian
_DEFAULT_LOCALE = LocaleEnum.english
_translations: Dict[str, str] = {}
_current_lang: LocaleEnum = _DEFAULT_LOCALE
@@ -137,10 +137,11 @@ def language_option_labels() -> List[Tuple[LocaleEnum, str]]:
def language_label_for_config(value: LocaleInput) -> str:
loc = LocaleEnum.parse(value)
for cfg_val, label in language_option_labels():
labels = language_option_labels()
for cfg_val, label in labels:
if cfg_val == loc:
return label
return language_option_labels()[0][1]
return labels[0][1] if labels else _DEFAULT_LOCALE.value
def refresh_language_option_maps() -> None:
+1
View File
@@ -76,6 +76,7 @@
"connectivity.cfproxy_title": "CF Proxy",
"connectivity.cfworker_title": "CF Worker",
"connectivity.timeout": "timeout",
"connectivity.no_response": "no response",
"connectivity.available": "{title}: available",
"connectivity.unavailable": "{title}: unavailable",
"connectivity.all_ok": "{title}: all working",
+1
View File
@@ -76,6 +76,7 @@
"connectivity.cfproxy_title": "CF-прокси",
"connectivity.cfworker_title": "CF Worker",
"connectivity.timeout": "таймаут",
"connectivity.no_response": "нет ответа",
"connectivity.available": "{title}: доступен",
"connectivity.unavailable": "{title}: недоступен",
"connectivity.all_ok": "{title}: всё работает",