mixed plural form handling
Luigi Toscano
luigi.toscano at tiscali.it
Sat Apr 22 15:00:45 BST 2023
Frederik Schwarzer ha scritto:
> Hi,
>
> today I was nudged from this:
> https://invent.kde.org/sysadmin/l10n-scripty/-/issues/6#note_665802
> "Script kiddy generates endless daily commits that add and remove brackets"
>
> What happens there is that the PO files sometimes have parens around the plural condition and sometimes they do not, resulting in commits like this (back and forth):
> - "Plural-Forms: nplurals=2; plural=n != 1;\n"
> + "Plural-Forms: nplurals=2; plural=(n != 1);\n"
>
> Since it seems only the German translation is affected, I started looking into what is happening and now I wonder why this is not a more wide spread issue.
> What I found:
> - Scripty "check_po_files" removes parens from plural
check_po_files uses the format defined in
<lang>/messages/ki18n/ki18n{5,6}.po for ki18n translations;
<lang>/messages/ki18n/kcoreaddons{5,6}_qt.po for Qt translations.
https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/check_po_files#L38
We did this because in some cases the definitions we use differs a bit from
the ones defines elsewhere (especially plural forms), so it was decided to use
some of our "base" files as reference.
It seems that the older German translation files, including ki18n5.po and
ki18n6.po, uses the form without parentheses.
So you may want to run a global search-and-replace and set all German files to
use the form with parentheses. If you do that, the next run of check_po_files
shouldn't try to remove them anymore (I hope).
Ciao
--
Luigi
More information about the kde-i18n-doc
mailing list