Fix language fallback logic in _get_lang function
Previously, _get_lang returned 'EN' if the language was not found, which could cause issues. Now, it sets lang to 'EN' and continues processing, ensuring consistent behavior.
This commit is contained in:
@@ -169,7 +169,7 @@ def format_bytes(bytes: int, unit: bool = False):
|
||||
|
||||
def _get_lang(lang: str, *keys) -> Optional[Union[list[str], str]]:
|
||||
if lang not in LANGS:
|
||||
return "EN"
|
||||
lang = "EN"
|
||||
|
||||
if not LANGS[lang]:
|
||||
LANGS[lang] = open_json(os.path.join("langs", f"{lang}.json"))
|
||||
|
||||
Reference in New Issue
Block a user