bugGNU gettext - Bugs: bug #66510, Add --prefer-cldr option to msginit

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66510: Add --prefer-cldr option to msginit

Submitter:  Michele Locati <mlocati>
Submitted:  Mon 02 Dec 2024 05:39:14 PM UTC
   
 
Category:  Plural forms Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Mon 09 Dec 2024 04:39:38 PM UTC, comment #3: 


>  Also, how would she know that she needs to use this extra option? She runs msginit once; the result looks fine; why try an extra command-line option?


If I run msginit and I expect that Italian has 3 plural rules (as per CLDR rules), but in the po we only have 2: that won't look good to me.

So I'd check what may be wrong, and see that I can force using the CLDR rules with this new --prefer-cldr option.

> I believe that msginit should prepare the translator's work as best as it can


What's the best? For example, the new CLDR rules define 3 plural forms for Italian (and French, Portuguese, Spanish and a few more).

For example:

one: "1 pagina"
many: "1,000,000 di pagine"
other: "2 pagine"

But historically, we had just 2 plural forms:

one: "1 pagina"
other: "2 pagine"

If I'd like to use the new CLDR definition, I'd prefer 3 plural forms.
If I'd like to use the historical syntax, I'd prefer 2 plural forms.

If we have to decide a single "best" approach: which one? Who will decide it? Why?

Michele Locati <mlocati>
Fri 06 Dec 2024 09:32:07 AM UTC, comment #2: 

I understand the goal, to give a translator more choice.

However, I have two problems with the concrete proposal:

1) Translators use msginit pretty rarely (each time she starts translating a new package). Therefore msginit is designed to do as much as possible automatically (even the determination of her email address!). A new option does not really fit well here.

Also, how would she know that she needs to use this extra option? She runs msginit once; the result looks fine; why try an extra command-line option?

2) I believe that msginit should prepare the translator's work as best as it can. That is, if the formula from the plural_table is better, use that; if the formula from CLDR is better, change the plural_table.

Doing so is tedious, though — which is why a number of bugs in the "Plural forms" category are still open. Help there is welcome.

Bruno Haible <haible>
Group administrator
Tue 03 Dec 2024 08:28:45 AM UTC, comment #1: 

For example, with the included patch applied and CLDR configured property (that is, the GETTEXTCLDRDIR env var points to a directory that contains the common/supplemental/plurals.xml file from CLDR v46), we have:

$ msginit --locale=it --output-file=- | grep -i plural
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

$ msginit --locale=it --output-file=- --prefer-cldr | grep -i plural
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n!=0 && n%1000000==0 ? 1 : 2);\n"


Michele Locati <mlocati>
Mon 02 Dec 2024 05:39:14 PM UTC, original submission:  

msginit can derive plural forms from both a static table (plural_table) and from the CLDR plurals.xml file (see https://www.gnu.org/software/gettext/manual/html_node/msginit-Invocation.html#Invoking-the-msginit-Program ).

At the moment, if the plural rules are defined in plural_table, msginit doesn't use the CLDR data.

What about adding a --prefer-cldr option to msginit so msginit tries to extract the plural rules from plurals.xml before trying with plural_table?

See attached file.

Michele Locati <mlocati>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #56665:  0001-Add-prefer-cldr-option-to-msginit.patch added by mlocati (9KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by mlocati (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-12-02 mlocati Attached File- Added 0001-Add-prefer-cldr-option-to-msginit.patch, #56665

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code