[+] dedent
This commit is contained in:
parent
633c92608f
commit
774a1b0ce3
@ -1,4 +1,5 @@
|
|||||||
import builtins
|
import builtins
|
||||||
|
import textwrap
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
import json5
|
import json5
|
||||||
@ -115,7 +116,7 @@ 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 = self._locale.get(key)
|
phrase = textwrap.dedent(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 phrase.format_map(defaultdict(lambda: '<unknown>', kwargs))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user