How to translate gettext strings when importing zxcvbn as module?
sigg3 opened this issue · 3 comments
This might be something of a noob question, but here goes; how do I enable translation of or extract gettext exposed strings in e.g. feedback.py in my app?
My app already has translation working with strings that are in my files, but xgettext does not "recurse" into modules like zxcvbn when I use import zxcvbn
. Is there some "domain" trickery I can use with xgettext to do this, or do I have to just copy your feedback.py into my dir? I am entirely new to gettext, but it's standard so I'd like to know canonical way to do it :D
Thanks for providing zxcvbn, it is awesome! 👍
i hope you were able to solve your issue!
Sort of. I copied all the strings used in the module and put it into a function that is never called in the main app.
As you can tell, this is a stale and spaghetti way of solving the problem, so I guess I'll just have to read more gettext docs.
Thanks anyway!
If anyone else will face this problem - here is another solution:
https://stackoverflow.com/a/68588763/12125834
And yes - thanks for the library! :)