[+] dedent fix
This commit is contained in:
parent
774a1b0ce3
commit
8792aaeeb9
@ -116,10 +116,10 @@ class I18N:
|
|||||||
:return: The phrase from the locale file.
|
:return: The phrase from the locale file.
|
||||||
"""
|
"""
|
||||||
# key: some.key.here
|
# key: some.key.here
|
||||||
phrase = textwrap.dedent(self._locale.get(key))
|
phrase = self._locale.get(key)
|
||||||
if not phrase:
|
if not phrase:
|
||||||
return f"<{key.upper()}>"
|
return f"<{key.upper()}>"
|
||||||
return phrase.format_map(defaultdict(lambda: '<unknown>', kwargs))
|
return textwrap.dedent(phrase.format_map(defaultdict(lambda: '<unknown>', kwargs)))
|
||||||
|
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
key = item.replace("_", ".") # заменяем _ на . для удобства
|
key = item.replace("_", ".") # заменяем _ на . для удобства
|
||||||
|
Loading…
x
Reference in New Issue
Block a user