Closed Bug 1423679 Opened 3 years ago Closed 2 years ago

Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz), Welsh (cy), Breton (br)

Categories

(Webtools :: Pontoon, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flod, Assigned: mathjazz)

References

Details

Attachments

(2 files, 1 obsolete file)

We're changing the plural form for Georgian (ka) and Persian (fa)

They're both moving from one form (other) to two forms (one, other).

Is there a way to make this change not painful for GetText projects? Plurals for FTL files seem to be already OK (not sure I was expecting that).

We might have other locales going through this kind of change: have one bug open for Turkish, we change az but it was already set to [one, other].
Flags: needinfo?(m)
In Gettext projects pluralized strings will become untranslated.

We'd need to manually update stats to reflect that.

Or we can also provide translations for the plural form "one" if it can be automated.

Is there anything else we should?
Flags: needinfo?(m)
Priority: -- → P3
(In reply to Matjaz Horvat [:mathjazz] from comment #1)
> Or we can also provide translations for the plural form "one" if it can be
> automated.

I think we should do this: provide the translation, copying the existing one.

Note that we'll have Uzbek (bug 1423126) and likely Turkish (bug 1423131), so it would be worth documenting it.
Depends on: 1423131
No longer depends on: 1423131
See Also: → 1423131
Blocks: 1423131
See Also: 1423131
Summary: Update plural rule for Georgian (ka) and Persian (fa) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr)
(In reply to Francesco Lodolo [:flod] from comment #2)
> I think we should do this: provide the translation, copying the existing one.

We should only do this if the existing translation is approved, right?

Should we also copy translation author and timestamp to the new translation?

> Note that we'll have Uzbek (bug 1423126) and likely Turkish (bug 1423131),
> so it would be worth documenting it.

We can build a management command to populate translations for the newly added plural forms and document it here: https://github.com/mozilla-l10n/documentation/tree/master/tools/pontoon.

Or would that be an overkill?
(In reply to Matjaz Horvat [:mathjazz] from comment #3)
> (In reply to Francesco Lodolo [:flod] from comment #2)
> > I think we should do this: provide the translation, copying the existing one.
> 
> We should only do this if the existing translation is approved, right?

Yes, that seems the right thing to do.

> Should we also copy translation author and timestamp to the new translation?

Yes.

> We can build a management command to populate translations for the newly
> added plural forms and document it here:
> https://github.com/mozilla-l10n/documentation/tree/master/tools/pontoon.
> 
> Or would that be an overkill?

Documenting it there might be overkill. The idea is to avoid having to analyze the problem again, if this happens in the future (hopefully it won't). If it's a command added to Pontoon codebase, I guess documenting it in the code itself would be enough?
Summary: Update plural rule for Georgian (ka), Persian (fa), Turkish (tr) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz)
Blocks: 1423126
Let's run this as a data migration.
Assignee: nobody → m
Priority: P3 → P2
We will have a second scenario to keep in mind for planning this (it would be a future separate bug, but worth keeping in mind).

Bug 1423138 is going to change plural rule for Welsh, adding 2 more forms. I'm not sure new values can be derived safely from existing translations (need to ask), so we might need to mark all plural strings in .po files as suggestions, or copy one existing translation to more than one plural form.
Depends on: 1423138
Confirmed that Welsh is moving from 4 to 6 forms: one of the existing plural forms should be copied over, and the string marked as fuzzy/suggested to let the team review them.
Summary: Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz), Welsh (cy)
Depends on: 1432149
Breton: one, two, few, many, other.
Summary: Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz), Welsh (cy) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz), Welsh (cy), Breton (br)
On a side note: we now have the same problem with Fluent.
(In reply to Francesco Lodolo [:flod] from comment #9)
> On a side note: we now have the same problem with Fluent.

Clarifying cryptic message: 
- New strings with plural forms will have the wrong variants by default
- Existing strings with the wrong number of plural forms need to be migrated
Attached file locales.txt (obsolete) —
We also need to update the `plural_rule` for those locales.

:flod, could you confirm that these look OK?

I've taken the plural rules from here:
http://mlocati.github.io/cldr-to-gettext-plural-rules/
Attachment #8968473 - Flags: review?(francesco.lodolo)
Blocks: 1423138
No longer depends on: 1423138
Blocks: 1432149
No longer depends on: 1432149
Attachment #8968473 - Attachment is patch: true
Comment on attachment 8968473 [details]
locales.txt

Persian is incorrect

    'fa': {
        'cldr_plurals': '1,5',
        'plural_rule': '(n != 1)',
    },

It should be n > 1 (like French).

Breton is different from what we have in pluralForm.jsm, but it's readable
https://searchfox.org/mozilla-central/rev/a30a60eadcff99d2a043241955d215dbeccad876/intl/locale/PluralForm.jsm#73

And the results are the same as in our tests
https://searchfox.org/mozilla-central/source/intl/locale/tests/unit/test_pluralForm.js#559

r+ with Persian fixed.
Attachment #8968473 - Attachment is patch: false
Attachment #8968473 - Flags: review?(francesco.lodolo) → review+
Attached file locales.txt
Attachment #8968473 - Attachment is obsolete: true
CCing a few localizers to make sure they know why a few strings will show up as suggested.
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/ddfb1dac0ce7ae8c84febad263c9ca620eb08e4f
Bug 1423679: Update plural rules (#932)

Fix plural rules for some locales and adjust Translations and Stats.
Fixed in:
https://github.com/mozilla/pontoon/commit/ddfb1dac0ce7ae8c84febad263c9ca620eb08e4f
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.