-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
New xgettext method to i18n module #13900
base: master
Are you sure you want to change the base?
Conversation
9ebc09e
to
4f5283b
Compare
b35d6b7
to
9347ef2
Compare
Since the underlying goal as I understand it is essentially "i18n.gettext() is not suitable for my use case because it depends on POTFILES but I would like to calculate the list from meson.build", it feels a bit like a more appropriate solution here could be to teach |
I understood that he also wants to generate multiple .pot files, so that would not be a single POTFILES. |
0fc8368
to
98a0fd7
Compare
cd32835
to
e9596e6
Compare
faed508
to
6c75e77
Compare
API-wise LGTM. Are there still open implementation questions? |
The "fixes for mypy" commit should be folded into the other commits. |
It looks like the mypy fixes aren't actually related, just underlying issues that the proposed enhancement coincidentally hits. It's fine as a separate commit. The second commit I'd probably mention why it's being split out -- just say "we want to call it from a module in a followup commit". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API seems fine to me, I guess. I haven't really taken a very close look at the implementation and how it interacts with targets, so my review doesn't cover that. There are some minor details I did notice though.
Because we will need to call it from a module in a followup commit.
This method call xgettext to extract translatable string from source files into a .pot translation template. It differs from a plain CustomTarget in three ways: - It accepts build targets as sources, and automatically resolves source files from those build targets; - It detects command lines that are too long, and writes, at config time, the list of source files into a text file to be consumed by the xgettext command; - It detects dependencies between pot extraction targets, based on the dependencies between source targets.
6c75e77
to
e19cd63
Compare
This method call xgettext to extract translatable
string from source files into a .pot translation template.
It differs from a plain CustomTarget in three ways:
files from those build targets;
time, the list of source files into a text file to be consumed by the
xgettext command;
dependencies between source targets.
This does the specific thing I need for my project, that I was trying to implement in a more generic way in #12272 and #11822.