translations: add note that f-strings cannot be translated
and replace current usage
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user