1
0

translations: add note that f-strings cannot be translated

and replace current usage
This commit is contained in:
SomberNight
2020-04-11 16:33:45 +02:00
parent 08118ca167
commit 9a88c13b3d
5 changed files with 11 additions and 8 deletions

View File

@@ -30,6 +30,9 @@ LOCALE_DIR = os.path.join(os.path.dirname(__file__), 'locale')
language = gettext.translation('electrum', LOCALE_DIR, fallback=True)
# note: f-strings cannot be translated! see https://stackoverflow.com/q/49797658
# So this does not work: _(f"My name: {name}")
# instead use .format: _("My name: {}").format(name)
def _(x):
global language
return language.gettext(x)