mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-07-03 11:51:07 +03:00
i18n fixes
This commit is contained in:
+4
-3
@@ -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:
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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}: всё работает",
|
||||
|
||||
Reference in New Issue
Block a user