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

RESOLVED FIXED

Status

enhancement
P2
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: flod, Assigned: mathjazz)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

a year ago
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].
(Reporter)

Updated

a year ago
Flags: needinfo?(m)
(Assignee)

Comment 1

a year ago
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)
(Assignee)

Updated

a year ago
Priority: -- → P3
(Reporter)

Comment 2

a year ago
(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.
(Reporter)

Updated

a year ago
Depends on: 1423131
(Reporter)

Updated

a year ago
No longer depends on: 1423131
See Also: → 1423131
(Reporter)

Updated

a year ago
Blocks: 1423131
See Also: 1423131
(Reporter)

Updated

a year ago
Summary: Update plural rule for Georgian (ka) and Persian (fa) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr)
(Assignee)

Comment 3

a year ago
(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?
(Reporter)

Comment 4

a year ago
(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?
(Reporter)

Updated

a year ago
Summary: Update plural rule for Georgian (ka), Persian (fa), Turkish (tr) → Update plural rule for Georgian (ka), Persian (fa), Turkish (tr), Uzbek (uz)
(Reporter)

Updated

a year ago
Blocks: 1423126
(Assignee)

Comment 5

a year ago
Let's run this as a data migration.
Assignee: nobody → m
Priority: P3 → P2
(Reporter)

Comment 6

a year ago
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.
(Reporter)

Updated

a year ago
Depends on: 1423138
(Reporter)

Comment 7

a year ago
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.
(Reporter)

Updated

a year ago
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)
(Reporter)

Updated

a year ago
Depends on: 1432149
(Reporter)

Comment 8

a year ago
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)
(Reporter)

Comment 9

a year ago
On a side note: we now have the same problem with Fluent.
(Reporter)

Comment 10

a year ago
(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
(Assignee)

Comment 11

a year ago
Posted 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)
(Reporter)

Updated

a year ago
Blocks: 1423138
No longer depends on: 1423138
(Reporter)

Updated

a year ago
Blocks: 1432149
No longer depends on: 1432149
(Reporter)

Updated

a year ago
Attachment #8968473 - Attachment is patch: true
(Reporter)

Comment 12

a year ago
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+
(Assignee)

Comment 13

a year ago
Posted file locales.txt
Attachment #8968473 - Attachment is obsolete: true
(Reporter)

Comment 15

a year ago
CCing a few localizers to make sure they know why a few strings will show up as suggested.

Comment 16

a year ago
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.
(Assignee)

Comment 17

a year ago
Fixed in:
https://github.com/mozilla/pontoon/commit/ddfb1dac0ce7ae8c84febad263c9ca620eb08e4f
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.