Closed Bug 1287478 Opened 8 years ago Closed 8 years ago

Use proper plural forms for notification of incoming tabs.

Categories

(Firefox :: Sync, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 50
Tracking Status
firefox50 --- fixed

People

(Reporter: flod, Assigned: eoger)

References

Details

(Whiteboard: [send-tab])

Attachments

(1 file)

https://hg.mozilla.org/mozilla-central/diff/e7a27a7538b2/browser/locales/en-US/chrome/browser/accounts.properties

tabsArrivingNotification.body = %1$S tabs have arrived from %2$S.
tabsArrivingNotificationMultiple.body = %S tabs have arrived from your connected devices.

Please use proper plural forms
https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Use_proper_plural_forms
Just to make, even if already explained in the link above: at this point you need new string IDs.
From the document you linked:

> One last advice: never use plural form as a replacement for single/multiple conditional. See bug 658191 for more details.

We are exactly in this case here, when we only have one tab to display we use |tabsArrivingNotification.body| with the name of the device, otherwise with multiple devices we use |tabsArrivingNotificationMultiple.body| with the number of devices.
Flags: needinfo?(francesco.lodolo)
The fact that you split single/plural is great, that avoid the issue reported in bug 658191.

What you're missing is that the translation of "tabs" changes according to the number: while English only has one form for "more than 1", there are plenty of languages with a lot more forms. For example Czech will have a word for 2 tabs, and a different one for 5.
Flags: needinfo?(francesco.lodolo)
Flags: firefox-backlog+
Priority: -- → P1
Status: NEW → ASSIGNED
https://reviewboard.mozilla.org/r/65064/#review62170

::: browser/locales/en-US/chrome/browser/accounts.properties:50
(Diff revision 1)
>  tabArrivingNotification.title = Tab received
>  # LOCALIZATION NOTE (tabArrivingNotification.body) %1 is the title of the tab and %2 is the device name.
>  tabArrivingNotification.body = “%1$S” has arrived from %2$S.
>  
>  tabsArrivingNotification.title = Multiple tabs received
> -# LOCALIZATION NOTE (tabsArrivingNotification.body) %1 is the number of tabs received and %2 is the device name.
> +# LOCALIZATION NOTE (unnamedTabsArrivingNotification.body) #1 is the number of tabs received and #2 is the device name.

As explained in the doc (as sad as it sounds): "Important: always include the localization note with this format if you use a plural form in Firefox. This comment is used by tools to identify strings with plural forms."

In this case

\# LOCALIZATION NOTE (unnamedTabsArrivingNotification.body): 
\# Semi-colon list of plural forms.
\# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
\# #1 is the number of tabs received and #2 is the device name.

::: browser/locales/en-US/chrome/browser/accounts.properties:52
(Diff revision 1)
>  tabArrivingNotification.body = “%1$S” has arrived from %2$S.
>  
>  tabsArrivingNotification.title = Multiple tabs received
> -# LOCALIZATION NOTE (tabsArrivingNotification.body) %1 is the number of tabs received and %2 is the device name.
> -tabsArrivingNotification.body = %1$S tabs have arrived from %2$S.
> -# LOCALIZATION NOTE (tabsArrivingNotificationMultiple.body)
> +# LOCALIZATION NOTE (unnamedTabsArrivingNotification.body) #1 is the number of tabs received and #2 is the device name.
> +unnamedTabsArrivingNotification.body = #1 tab has arrived from #2.;#1 tabs have arrived from #2.
> +# LOCALIZATION NOTE (unnamedTabsArrivingNotificationMultiple.body)

Same here.
Comment on attachment 8772202 [details]
Bug 1287478 -  Use proper plural forms for notification of incoming tabs.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65066/diff/1-2/
Thanks Francesco, localization notes updated.
Comment on attachment 8772202 [details]
Bug 1287478 -  Use proper plural forms for notification of incoming tabs.

https://reviewboard.mozilla.org/r/65066/#review62178

Cant's switch to f+ in MozReview, but the strings look good, thanks.
Attachment #8772202 - Flags: review?(francesco.lodolo) → review+
Comment on attachment 8772202 [details]
Bug 1287478 -  Use proper plural forms for notification of incoming tabs.

https://reviewboard.mozilla.org/r/65066/#review62182

Looks great, thanks!
Attachment #8772202 - Flags: review?(markh) → review+
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/2111ed9e189e
Use proper plural forms for notification of incoming tabs. r=flod,markh
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2111ed9e189e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Depends on: 1305737
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: