mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
195 stars 86 forks source link

Again trouble with translations #637

Closed raveit65 closed 4 years ago

raveit65 commented 4 years ago

Expected behaviour

No trouble with translations

For the 1.24.1 release i had to fix 4 languages at transifex, see git history. Building always failed like this.

rm -f ko.gmo && /usr/bin/msgfmt -c --statistics --verbose -o ko.gmo ko.po
ko.po:1293: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same
/usr/bin/msgfmt: found 1 fatal error
ko.po: 409 translated messages, 22 untranslated messages.
make[3]: *** [Makefile:211: ko.gmo] Error 1

The problem is the -c option of msgfmt See help:

Input file interpretation:
  -c, --check                 perform all the checks implied by
                                --check-format, --check-header, --check-domain
      --check-format          check language dependent format strings
      --check-header          verify presence and contents of the header entry
      --check-domain          check for conflicts between domain directives
                                and the --output-file option

In result:

[rave@mother marco-dist]$ /usr/bin/msgfmt -v -c po/ko.po
po/ko.po:1293: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same
/usr/bin/msgfmt: found 1 fatal error
409 translated messages, 22 untranslated messages.

[rave@mother marco-dist]$ /usr/bin/msgfmt -v --check-format --check-header --check-domain po/ko.po
po/ko.po:1293: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same
/usr/bin/msgfmt: found 1 fatal error
409 translated messages, 22 untranslated messages.

[rave@mother marco-dist]$ /usr/bin/msgfmt -v --check-header --check-domain po/ko.po
409 translated messages, 22 untranslated messages.
[rave@mother marco-dist]$ 

So we need to change msgfmt option somewhere in package, but i didn't find something in /po/Makevars. It is not acceptable that i have to fix at transifex simple formatting issues by translators with nearly every new tarball. Especially when i don't understand the languages.

sc0w commented 4 years ago

@raveit65 @mate-desktop/core-team

I think msgfmt -c does the checks to prevent unexpected behavior caused by erroneous translation

I think we can work in the classical way, without transifex, doing PRs with translations.

raveit65 commented 4 years ago

I think msgfmt -c does the checks to prevent unexpected behavior caused by erroneous translation

Yes, msgfmt -c is the same like msgfmt -v --check-format --check-header --check-domain, and --check-format gives us the fatal error. With msgfmt -v --check-header --check-domain the bad formatted string will simply ignored and not translated. This is the same behaviour before we switched to gettext.

I think we can work in the classical way, without transifex, doing PRs with translations.

Sadly, i don't have any spare time left to review tons of PRs in tons of languages.

rbuj commented 4 years ago

I remember that pology can remove conflicting translations or mark them as draft/fuzzy, or something similar.

rbuj commented 4 years ago

@raveit65 you can use the macro AM_XGETTEXT_OPTION in configure.ac file for adding options to xgettext.

https://www.gnu.org/software/gettext/manual/html_node/AM_005fXGETTEXT_005fOPTION.html#AM_005fXGETTEXT_005fOPTION

rbuj commented 4 years ago

msguniq can remove dulicated entries

raveit65 commented 4 years ago

I was able to fix similar issue for mate-power-manager with Lithuanian languge. https://github.com/mate-desktop/mate-power-manager/commit/809da871ffcd82732384ee8f164588b4008938e2 https://www.transifex.com/mate/MATE/translate/#lt/1-24--mate-power-manager/194076476?q=text%3A'%25i+minute' transifex Here singular and plural forms are selectable. I will try it later for marco.