[+] dedent
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import builtins
|
||||
import textwrap
|
||||
from collections import defaultdict
|
||||
|
||||
import json5
|
||||
@@ -115,7 +116,7 @@ class I18N:
|
||||
:return: The phrase from the locale file.
|
||||
"""
|
||||
# key: some.key.here
|
||||
phrase = self._locale.get(key)
|
||||
phrase = textwrap.dedent(self._locale.get(key))
|
||||
if not phrase:
|
||||
return f"<{key.upper()}>"
|
||||
return phrase.format_map(defaultdict(lambda: '<unknown>', kwargs))
|
||||
|
||||
Reference in New Issue
Block a user