i18n: fix synaptic-{pot,update-po} targets#269
Merged
Merged
Conversation
The underscore-prefixed tags (<_name>, <_summary>, <_p>, <_li>, <_message>) are an intltool convention. Since the switch to meson, i18n.merge_file() runs gettext's msgfmt, which does not understand them: the installed metainfo contained literal <_name> tags (invalid AppStream) and the strings stayed untranslated. So we need to remove the "_" to make msgfmt/xgettext --xml work. This is the metainfo/policy counterpart of 4e7668f, which already fixed synaptic.desktop.in the same way (see discussion in PR#263).
Meson's gettext helper treats every non-comment line in POTFILES.in as a file path, so the intltool-only "[encoding: UTF-8]" directive and "[type: gettext/glade]" prefixes made the synaptic-pot target fail with: xgettext: error while opening "[encoding: UTF-8]" for reading xgettext detects GtkBuilder .ui files by extension, so the type prefixes are not needed. With this change "ninja synaptic-pot" succeeds and extracts 730 msgids, including the desktop, metainfo and polkit policy strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the meson merge we switched from intltool to plain xgettext/msgmerge. This means that we need to tweak some of the existing files to make translations fully working again. This PR contians the two fixes needed (see the individual commits).
Thanks to @AsciiWolf and @AtesComp for raising the i18n issues. This should also solve #263
I validated via: