Skip to content
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

POT file generation #103

Closed
piotrdrag opened this issue Jan 16, 2017 · 11 comments
Closed

POT file generation #103

piotrdrag opened this issue Jan 16, 2017 · 11 comments

Comments

@piotrdrag
Copy link
Contributor

Hi, I'm trying to fix POT file generation on https://l10n.gnome.org/module/appstream/.
appstream doesn't have a standard po/POTFILES.in file, so damned-lies gets confused.
Is there a way to generate a new POT file without building the whole project?

@ximion
Copy link
Owner

ximion commented Jan 16, 2017

Does make l10n-update not do the job?

@piotrdrag
Copy link
Contributor Author

I don't think we can run make in there. I will consult with the site's developer.

@ximion
Copy link
Owner

ximion commented Jan 16, 2017

Can you run anything in there? The problem is that .pot file contains some data merged in from XML parts which need itstool, so the job isn't done with just running xgettext.

In any case, let me know if there's something I can do to make your life easier!

@claudep
Copy link
Contributor

claudep commented Jan 17, 2017

Recent gettext is able to cope with XML i18n. Read https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html. polkit is doing so for example.

@ximion
Copy link
Owner

ximion commented Jan 17, 2017

@claudep It doesn't deal with metainfo files properly for older versions still in use, and we also want it to explicitly use our own-provided .its file here, in case we make additions to the spec which need to be translated - waiting for other tools to update can take quite long, and this code is especially needed for backports (was just recently demonstrated where a user ran into this issue).

@claudep
Copy link
Contributor

claudep commented Jan 17, 2017

Maybe we can try to find a way to allow for both methods? Could your script still work with SRCFILES renamed again to POTFILES.in and including the xml file(s) in it? In theory, xgettext should handle duplicated extracted strings properly.

@ximion
Copy link
Owner

ximion commented Jan 19, 2017

In theory SRCFILES is the POTFILES.in file, but without the XML stuff - it has been named differently precisely to avoid confusion.
I could name it back if that would help you though.

In any case, the stuff the buildsystem does to these files is not complicated at all (see https://github.com/ximion/appstream/blob/master/po/CMakeLists.txt#L17 ) - it's basically running xgettext on all non-XML files, using itstool to deal with XML and then merge the resulting .pot files together to build the final file.

@claudep
Copy link
Contributor

claudep commented Jan 19, 2017

On l10n.gnome.org, we have a rule to not launch make processes to produce POT files. Only simple scripts with "standard" tools are used. When you have >100 modules to follow, "make"ing modules quickly becomes a nightmare to maintain.

Now I see you have the appstream.pot in the repository. Is it really kept up-to-date when strings change? Then we could simply use that file as is.

@ximion
Copy link
Owner

ximion commented Jan 19, 2017

@claudep It is usually kept up to date, unless I forget updating it. Most of the time I refresh it directly when string changes were made, or at least a few days before a new release is made.
So yeah, the file should be fairly up-to-date :-)

@claudep
Copy link
Contributor

claudep commented Jan 20, 2017

I configured l10n.gnome.org to pick the committed pot file, so I think this issue can be closed.

@piotrdrag
Copy link
Contributor Author

Thank you both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants