Re: PyQt5 fstring translation
Dmitry Shachnev <[email protected]>
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Apr 02, 2019 at 06:54:11AM -0700, Shyne wrote:
> Ok I can see the fstrings now in linguist with the last snapshot !
>
> But the translation work only if I remove the string variable ex:
>
> var = "plop"
>
> Working: self.tr(f"Test without")
>
> Not working: self.tr(f"Test with {var}")
How do you think it will work? pylupdate5 does not know what will be the
value of var, so what should it put into the .ts file?
I think if you need to translate some string, you should use percent
formatting or the format() method, not fstrings.
--
Dmitry Shachnev
_______________________________________________
PyQt mailing list [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE8kKZ/xu8kBi5BqTLYCaTbS8ciuAFAlyjb9EACgkQYCaTbS8c iuAzzRAAr8ZGl10Q+OGjdWyzdryVZ7LVqZXJd4vxvU4KA27smZVRhtfVqOEyD6p9 vg2vQP6TROS2xeILv2prnUcSAFaHm4sa4UYG1UKm8Ae3K7rXkIjWiFhbru30kyC2 P32nAQ1/twe59tLAWDqwmlD7X9a1f8gQrgsj62AJN7t5hrVeMyYNCDJFV7DaIIvk 7aKWnwuS6QKRPmluLBuUxGnF0NOiHrbShrl0nH0Lf9NffJuhKLIYZibHDX83mnGy CDntJP+THXI6SJv/vRAt2PWPTdoDpe1Fwt/a0ExxjFVW5ZYEH0TBURi3rkxSK+gk cCsBgoEiJkltbB+9zkLZrYDR1JkvgMsVHjyg5/EdDFdEBQXZhN1hk+2e4J1e7cal 4N/DUSW/qz7NIUKQFX/TFMUaqrSJqo82GlbNXqwiRTjE6xcioF60RwyUlX6WnQyn X8Dv9+s1U6NdRJLRq+IiWHqJIv0xelzrnIhYXyy8IyZtLgY4yFoFgUTvJ/8oYk1V vAjnTpj3C/f3goeVRA7U2bLFwDM8AurUcIAbW4gYtEOeQxqyVtFEReTBMW9aeFSK OACkwzbNV7rqWR8j5FzSHhp+7BKnXk0Jhp/obU+plcnInBLTN17lx33EZposp64X wFn63tfvQhmSTNFd0NQvoOZ4aSOUAOBmrQKoYfraxAbeVG18fbo= =dQ6E -----END PGP SIGNATURE-----