Merge pull request #2509 from tomwys/patch-2
Refactor. Stop using memory for list copies.
This commit is contained in:
commit
66cbd81456
|
@ -168,7 +168,7 @@ def translation(language):
|
||||||
# doesn't affect en-gb), even though they will both use the core "en"
|
# doesn't affect en-gb), even though they will both use the core "en"
|
||||||
# translation. So we have to subvert Python's internal gettext caching.
|
# translation. So we have to subvert Python's internal gettext caching.
|
||||||
base_lang = lambda x: x.split('-', 1)[0]
|
base_lang = lambda x: x.split('-', 1)[0]
|
||||||
if base_lang(lang) in [base_lang(trans) for trans in list(_translations)]:
|
if any(base_lang(lang) == base_lang(trans) for trans in _translations):
|
||||||
res._info = res._info.copy()
|
res._info = res._info.copy()
|
||||||
res._catalog = res._catalog.copy()
|
res._catalog = res._catalog.copy()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue