Closed Bug 1432159 Opened 7 years ago Closed 6 years ago

[zh-CN] Switch plural rule for Simplified Chinese from #1 (2 forms) to #0 (1 form)

Categories

(Mozilla Localizations :: zh-CN / Chinese (Simplified), enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: flod, Assigned: shaohua.wen)

References

Details

Gecko products are set to use 2 plural forms (rule #1, like English).
https://hg.mozilla.org/l10n-central/zh-CN/file/default/toolkit/chrome/global/intl.properties#l55
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals

Pontoon is set to use 1 form (other), which means all other products/projects are using 1 form
https://pontoon.mozilla.org/zh-CN/

CLDR has 1 form like Pontoon for Chinese
http://www.unicode.org/cldr/charts/dev/supplemental/language_plural_rules.html#zh
https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/plurals.json#L856

As we move to Fluent and rely on CLDR data more, this is clearly going to become a problem. 

I'd like to understand the reasons for bug 926443, and possibly revisit them.
According to bug 467548 comment 2, at least the following strings should be split into two strings, or allow 2 plural forms in # 0, otherwise it will reduce the quality of translation, like "[Name] has been installed successfully." to "1 add-ons have been installed successfully.".

https://transvision.mozfr.org/?recherche=removeBookmarks&repo=gecko_strings&sourcelocale=en-US&locale=zh-CN&search_type=entities 
https://transvision.mozfr.org/?recherche=addonsInstalledNeedsRestart&repo=gecko_strings&sourcelocale=en-US&locale=zh-CN&search_type=entities
https://transvision.mozfr.org/?recherche=addonsInstalled&repo=gecko_strings&sourcelocale=en-US&locale=zh-CN&search_type=entities
Depends on: 467548
(In reply to YF (Yang) from comment #1)
> According to bug 467548 comment 2, at least the following strings should be
> split into two strings, or allow 2 plural forms in # 0, otherwise it will
> reduce the quality of translation, like "[Name] has been installed
> successfully." to "1 add-ons have been installed successfully.".

https://transvision.mozfr.org/?recherche=removeBookmarks&repo=gecko_strings&sourcelocale=en-US&locale=zh-CN&search_type=entities 

These are currently "non plural" strings, so I'm not sure why it would affect having 1 or 2 forms?

https://transvision.mozfr.org/?recherche=addonsInstalledNeedsRestart&repo=gecko_strings&sourcelocale=en-US&locale=zh-CN&search_type=entities

These have been fixed as part of bug 658191 for Firefox. 

SeaMonkey and Thunderbird should adopt a similar fix (no idea if there's a bug on file, it would just be a matter of copy and paste, but also don't plan to fix them myself).
(In reply to Francesco Lodolo [:flod] from comment #2)
> (In reply to YF (Yang) from comment #1)
> > According to bug 467548 comment 2, at least the following strings should be
> > split into two strings, or allow 2 plural forms in # 0, otherwise it will
> > reduce the quality of translation, like "[Name] has been installed
> > successfully." to "1 add-ons have been installed successfully.".
> 
> https://transvision.mozfr.org/
> ?recherche=removeBookmarks&repo=gecko_strings&sourcelocale=en-US&locale=zh-
> CN&search_type=entities 
> 
> These are currently "non plural" strings, so I'm not sure why it would
> affect having 1 or 2 forms?

"Remove Bookmark;Remove #1 Bookmarks" will to "Remove #1 Bookmarks" and got "Remove 1 Bookmarks" in #0.

> https://transvision.mozfr.org/
> ?recherche=addonsInstalledNeedsRestart&repo=gecko_strings&sourcelocale=en-
> US&locale=zh-CN&search_type=entities
> 
> These have been fixed as part of bug 658191 for Firefox. 

Nice, looks good.
(In reply to YF (Yang) from comment #3)
> (In reply to Francesco Lodolo [:flod] from comment #2)
> > (In reply to YF (Yang) from comment #1)
> > > According to bug 467548 comment 2, at least the following strings should be
> > > split into two strings, or allow 2 plural forms in # 0, otherwise it will
> > > reduce the quality of translation, like "[Name] has been installed
> > > successfully." to "1 add-ons have been installed successfully.".
> > 
> > https://transvision.mozfr.org/
> > ?recherche=removeBookmarks&repo=gecko_strings&sourcelocale=en-US&locale=zh-
> > CN&search_type=entities 
> > 
> > These are currently "non plural" strings, so I'm not sure why it would
> > affect having 1 or 2 forms?
> 
> "Remove Bookmark;Remove #1 Bookmarks" will to "Remove #1 Bookmarks" and got
> "Remove 1 Bookmarks" in #0.

Thanks, I was looking at the first string. You would translate the string as 'Remove #1 Bookmarks"

You can use the #1 in both plural forms, English doesn't do it for "cosmetic" reasons. In Traditional Chinese it's currently translated as '刪除 #1 筆書籤'
https://transvision.mozfr.org/string/?entity=browser/chrome/browser/browser.properties:editBookmark.removeBookmarks.label&repo=gecko_strings
(In reply to Francesco Lodolo [:flod] from comment #4)
> (In reply to YF (Yang) from comment #3)
> > (In reply to Francesco Lodolo [:flod] from comment #2)
> > > (In reply to YF (Yang) from comment #1)
> > > > According to bug 467548 comment 2, at least the following strings should be
> > > > split into two strings, or allow 2 plural forms in # 0, otherwise it will
> > > > reduce the quality of translation, like "[Name] has been installed
> > > > successfully." to "1 add-ons have been installed successfully.".
> > > 
> > > https://transvision.mozfr.org/
> > > ?recherche=removeBookmarks&repo=gecko_strings&sourcelocale=en-US&locale=zh-
> > > CN&search_type=entities 
> > > 
> > > These are currently "non plural" strings, so I'm not sure why it would
> > > affect having 1 or 2 forms?
> > 
> > "Remove Bookmark;Remove #1 Bookmarks" will to "Remove #1 Bookmarks" and got
> > "Remove 1 Bookmarks" in #0.
> 
> Thanks, I was looking at the first string. You would translate the string as
> 'Remove #1 Bookmarks"
> 
> You can use the #1 in both plural forms, English doesn't do it for
> "cosmetic" reasons. In Traditional Chinese it's currently translated as '刪除
> #1 筆書籤'
> https://transvision.mozfr.org/string/?entity=browser/chrome/browser/browser.
> properties:editBookmark.removeBookmarks.label&repo=gecko_strings

This is understandable but somewhat superfluous for this translation, probably should not remind the number to user if only one bookmark has been added.
(In reply to YF (Yang) from comment #5)
> This is understandable but somewhat superfluous for this translation,
> probably should not remind the number to user if only one bookmark has been
> added.

While I agree, it doesn't seem like a good reason to a) pick a rule that doesn't reflect the grammar and b) impact about 100 strings. This will also impact migration from the current strings to FTL files for Fluent.but, 

Note that with Fluent you would be able to define such special cases, independently from the plural rule.

By default you would have

en-US
remove-bookmarks = 
    { $bookmarks_count ->
        [one] Remove bookmark
       *[other] Remove { $bookmarks_count } bookmarks
    }

zh-CN
remove-bookmarks = 
    { $bookmarks_count ->
       *[other] 移除 { $bookmarks_count } 个书签
    }

But you can also decide to extend your translation by adding a special case for 1

remove-bookmarks = 
    { $bookmarks_count ->
        [1] 移除此书签
       *[other] 移除 { $bookmarks_count } 个书签
    }
(In reply to Francesco Lodolo [:flod] from comment #7)
> Side note: a string just landed with 1 form
> https://l10n.mozilla.org/dashboard/compare?run=899357#issue1
> 
> https://pontoon.mozilla.org/zh-CN/firefox/browser/chrome/browser/pageInfo.
> properties/?search=securityVisitsNumber&string=175124

Sorry, my fault. I thought it was a convention to only keep 1 form when the two forms are the same.
(In reply to xcffl from comment #8)
> Sorry, my fault. I thought it was a convention to only keep 1 form when the
> two forms are the same.

No, you need both. And, I believe, that's one more reason to use one form for Chinese.

Can you please discuss this bug internally, and figure out if we can switch to use 1 form for Chinese?
Hi Francesco,
  Is it possible to list all the entries that contains the plural rule?
Thanks Francesco, we'll go throught them.

Br
Holy
No longer depends on: 467548
See Also: → 467548
(In reply to Shaohua Wen from comment #12)
> Thanks Francesco, we'll go throught them.

Any update?
one another example:

https://pontoon.mozilla.org/zh-CN/seamonkey/all-resources/?status=translated&search=Localization_and_Plurals&string=126507
#1 has been installed successfully.;#2 add-ons have been installed successfully.

#1 is the addon name, #2 is the number of add-ons.
we need to handle all of them like the previous Bookmark string?
Br.
Holy
(In reply to Shaohua Wen from comment #14)
> one another example:
> 
> https://pontoon.mozilla.org/zh-CN/seamonkey/all-resources/
> ?status=translated&search=Localization_and_Plurals&string=126507
> #1 has been installed successfully.;#2 add-ons have been installed
> successfully.
> 
> #1 is the addon name, #2 is the number of add-ons.
> we need to handle all of them like the previous Bookmark string?

That's a bug that should be fixed by SeaMonkey, because that's an abuse of a plural form.

It's already fixed in Firefox as of 59.
OK, then we are OK for 1 plural form.
Br.
Holy
(In reply to Shaohua Wen from comment #16)
> OK, then we are OK for 1 plural form.

Do we need to wait for more feedback from other team members, or can I go ahead and make the change? 

As said, it will require some coordination to go through the strings to remove the second form.
Thanks for asking Francesco, we have consulted other team members and we are good to go.
Br.
Holy
Great, thanks.

Landed the change in
https://hg.mozilla.org/l10n-central/zh-CN/rev/ca333cde19871c47f0b99117a6b0db25ae042e50

Now you can start updating the strings. I can give you an update list of strings with the wrong number of plural forms later this week, but the dashboard will start showing up them as warnings at some point.

@pike
We need to switch zh-CN from 1 to 0 in compare-locales
Flags: needinfo?(l10n)
Summary: [zh-CN] Verify plural rule for Simplified Chinese → [zh-CN] Switch plural rule for Simplified Chinese from #1 (2 forms) to #0 (1 form)
Updated and deployed compare-locales 2.8.1.
Flags: needinfo?(l10n)
(In reply to Francesco Lodolo [:flod] from comment #19)
> Now you can start updating the strings. I can give you an update list of
> strings with the wrong number of plural forms later this week, but the
> dashboard will start showing up them as warnings at some point.

Looks like most of them are already fixed. There are still 16 in Firefox, and they're visible on the dashboard as warnings.

Locale: zh-CN (16)
- addonConfirmInstallSomeUnsigned.message (browser/chrome/browser/browser.properties) has 2 plural forms (requested: 1)
- tabs.closeWarningMultiple (browser/chrome/browser/tabbrowser.properties) has 2 plural forms (requested: 1)
- snapshotsList.drawCallsLabel (devtools/client/canvasdebugger.properties) has 2 plural forms (requested: 1)
- snapshotsList.functionCallsLabel (devtools/client/canvasdebugger.properties) has 2 plural forms (requested: 1)
- jit.samples (devtools/client/jit-optimizations.properties) has 2 plural forms (requested: 1)
- networkMenu.summary.requestsCount (devtools/client/netmonitor.properties) has 2 plural forms (requested: 1)
- toolboxToggleButton.errors (devtools/client/toolbox.properties) has 2 plural forms (requested: 1)
- toolboxToggleButton.warnings (devtools/client/toolbox.properties) has 2 plural forms (requested: 1)
- shortSeconds (toolkit/chrome/mozapps/downloads/downloads.properties) has 2 plural forms (requested: 1)
- shortMinutes (toolkit/chrome/mozapps/downloads/downloads.properties) has 2 plural forms (requested: 1)
- shortHours (toolkit/chrome/mozapps/downloads/downloads.properties) has 2 plural forms (requested: 1)
- shortDays (toolkit/chrome/mozapps/downloads/downloads.properties) has 2 plural forms (requested: 1)
- downloadMessage.deleteAll (mobile/android/chrome/aboutDownloads.properties) has 2 plural forms (requested: 1)
- webextPerms.hostDescription.tooManyWildcards (mobile/android/chrome/browser.properties) has 2 plural forms (requested: 1)
- webextPerms.hostDescription.tooManySites (mobile/android/chrome/browser.properties) has 2 plural forms (requested: 1)
- newtabpopup.opened (mobile/android/chrome/browser.properties) has 2 plural forms (requested: 1)
Thanks, looks like we're down to zero errors for plurals.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.