mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-07 19:01:03 +03:00
[1805] Remove Unused Function
This commit is contained in:
parent
e78154e2ff
commit
c2e685f561
16
l10n.py
16
l10n.py
@ -37,7 +37,6 @@ LANGUAGE_ID = '!Language'
|
||||
LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n')
|
||||
|
||||
if sys.platform == 'win32':
|
||||
import ctypes
|
||||
import win32api
|
||||
|
||||
|
||||
@ -165,13 +164,12 @@ class Translations:
|
||||
if lang:
|
||||
contents: dict[str, str] = self.contents(lang=lang, plugin_path=plugin_path)
|
||||
|
||||
if not contents or type(contents) is not dict:
|
||||
if not contents or not isinstance(contents, dict):
|
||||
logger.debug(f'Failure loading translations for overridden language {lang!r}')
|
||||
return self.translate(x)
|
||||
elif x not in contents.keys():
|
||||
if x not in contents:
|
||||
logger.debug(f'Missing translation: {x!r} for overridden language {lang!r}')
|
||||
return self.translate(x)
|
||||
else:
|
||||
return contents.get(x) or self.translate(x)
|
||||
|
||||
if plugin_name:
|
||||
@ -290,16 +288,6 @@ class _Locale:
|
||||
|
||||
return None
|
||||
|
||||
def wszarray_to_list(self, array):
|
||||
offset = 0
|
||||
while offset < len(array):
|
||||
sz = ctypes.wstring_at(ctypes.addressof(array) + offset * 2) # type: ignore
|
||||
if sz:
|
||||
yield sz
|
||||
offset += len(sz) + 1
|
||||
else:
|
||||
break
|
||||
|
||||
def preferred_languages(self) -> Iterable[str]:
|
||||
"""
|
||||
Return a list of preferred language codes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user