We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having trouble getting certain strings to attach that are inside non-default-keyword member functions.
My code has a level of encapsulation to it, where I sometimes store the gettext function inside the class as a method, like so:
gettext
_ = gettext(...) class Foobar: def __init__(self, translator): self.i18n = translator def send(self): return self.i18n("Hello World") f = Foobar(translator=_) print(f.send())
I've added the i18n function to setup.cfg:
i18n
setup.cfg
[extract_messages] ... keywords = _ i18n ...
I've also tried adding "self.i18n", and Foobar.i18n to keywords, but this failed to extract the string as well.
"self.i18n"
Foobar.i18n
I can go through and manually wrap every single string with a "pure" N_() function, but the code has many strings and that would be highly verbose.
N_()
The text was updated successfully, but these errors were encountered:
I had a similar issue. I have a quick fix for it I'll post as a PR. (now #1136)
Sorry, something went wrong.
No branches or pull requests
I'm having trouble getting certain strings to attach that are inside non-default-keyword member functions.
My code has a level of encapsulation to it, where I sometimes store the
gettext
function inside the class as a method, like so:I've added the
i18n
function tosetup.cfg
:I've also tried adding
"self.i18n"
, andFoobar.i18n
to keywords, but this failed to extract the string as well.I can go through and manually wrap every single string with a "pure"
N_()
function, but the code has many strings and that would be highly verbose.The text was updated successfully, but these errors were encountered: