mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-08 11:21:02 +03:00
[1805] Remove Unused Function
This commit is contained in:
parent
e78154e2ff
commit
c2e685f561
18
l10n.py
18
l10n.py
@ -37,7 +37,6 @@ LANGUAGE_ID = '!Language'
|
|||||||
LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n')
|
LOCALISATION_DIR: pathlib.Path = pathlib.Path('L10n')
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
import ctypes
|
|
||||||
import win32api
|
import win32api
|
||||||
|
|
||||||
|
|
||||||
@ -165,14 +164,13 @@ class Translations:
|
|||||||
if lang:
|
if lang:
|
||||||
contents: dict[str, str] = self.contents(lang=lang, plugin_path=plugin_path)
|
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}')
|
logger.debug(f'Failure loading translations for overridden language {lang!r}')
|
||||||
return self.translate(x)
|
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}')
|
logger.debug(f'Missing translation: {x!r} for overridden language {lang!r}')
|
||||||
return self.translate(x)
|
return self.translate(x)
|
||||||
else:
|
return contents.get(x) or self.translate(x)
|
||||||
return contents.get(x) or self.translate(x)
|
|
||||||
|
|
||||||
if plugin_name:
|
if plugin_name:
|
||||||
if self.translations[None] and plugin_name not in self.translations:
|
if self.translations[None] and plugin_name not in self.translations:
|
||||||
@ -290,16 +288,6 @@ class _Locale:
|
|||||||
|
|
||||||
return None
|
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]:
|
def preferred_languages(self) -> Iterable[str]:
|
||||||
"""
|
"""
|
||||||
Return a list of preferred language codes.
|
Return a list of preferred language codes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user