1
0

i18n: add "context" param to _(), and use it from qml

fixes https://github.com/spesmilo/electrum/issues/8323

from issue:
> Currently, translatable strings from QML are assigned a `context`
> by `lupdate`, which is then also used by the conversion to `gettext`.
> This `context` must be used when translating such a string. This results in
> strings that are unique to QML to not be translated, due to a missing
> `context` parameter which we do not take into account in electrum.
This commit is contained in:
SomberNight
2023-04-20 14:31:44 +00:00
parent 1a4e48e2d4
commit b0b4f39b40
2 changed files with 15 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ class ElectrumTranslator(QTranslator):
super().__init__(parent)
def translate(self, context, source_text, disambiguation, n):
return _(source_text)
return _(source_text, context=context)
class ElectrumGui(BaseElectrumGui, Logger):