1
0

i18n: don't translate empty string

see #7158

```
$ ./contrib/pull_locale
Found 260 files to translate
Generate template
electrum/gui/qt/installwizard.py:265: warning: Empty msgid.  It is reserved by GNU gettext:
                                               gettext("") returns the header entry with
                                               meta information, not the empty string.
electrum/gui/qt/channels_list.py:49: warning: Empty msgid.  It is reserved by GNU gettext:
                                              gettext("") returns the header entry with
                                              meta information, not the empty string.
```
This commit is contained in:
SomberNight
2021-04-01 03:33:16 +02:00
parent f87727c195
commit 210ff647fa
3 changed files with 5 additions and 3 deletions

View File

@@ -33,7 +33,9 @@ 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):
def _(x: str) -> str:
if x == "":
return "" # empty string must not be translated. see #7158
global language
return language.gettext(x)