Closed Bug 947353 Opened 11 years ago Closed 10 years ago

L10N string " tabs.closeWarningMultipleTabs" needs pluralization

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 29

People

(Reporter: JasnaPaka, Assigned: flod)

Details

Attachments

(1 file, 3 obsolete files)

http://hg.mozilla.org/mozilla-central/file/default/browser/locales/en-US/chrome/browser/tabbrowser.properties

tabs.closeWarningMultipleTabs=You are about to close %S tabs. Are you sure you want to continue?

We need pluralization here.
https://developer.mozilla.org/en-US/docs/Localization_and_Plurals
Tentatively assigning this to myself, in order to check if I can fix this.
Assignee: nobody → francesco.lodolo
Attached patch bug947353.patch (obsolete) — Splinter Review
Use proper plural form for warning on close with multiple tabs.

@dao
Please another reviewer if I chose the wrong person (no suggested reviewer, based my choice on the history of tabbrowser.xml).
Attachment #8367895 - Flags: review?(dao)
Attached patch bug947353v1.patch (obsolete) — Splinter Review
Right patch without trailing blank spaces around
Attachment #8367895 - Attachment is obsolete: true
Attachment #8367895 - Flags: review?(dao)
Attachment #8367899 - Flags: review?(dao)
Comment on attachment 8367899 [details] [diff] [review]
bug947353v1.patch

>+          Components.utils.import("resource://gre/modules/PluralForm.jsm");
>+          var warningMessage = PluralForm.get(tabsToClose,
>+                                              bundle.getString("tabs.closeWarningMultiple")
>+                                              ).replace("#1", tabsToClose);

PluralForm is already available here, no need to import anything.

>+tabs.closeWarningMultiple=You are about to close #1 tab. Are you sure you want to continue?;You are about to close #1 tabs. Are you sure you want to continue?

The first string doesn't really make sense, as it shouldn't be possible to get that message for only one tab.
Attachment #8367899 - Flags: review?(dao) → review-
Attached patch bug947353v3.patch (obsolete) — Splinter Review
Thanks a lot for the review.

As suggested dropped unnecessary inclusion of PluralForm.jsm (didn't realize it was already available) and singular version of the string.

I find it less clear to read, but the same structure is used in other strings so I guess it's fine
http://hg.mozilla.org/mozilla-central/file/default/browser/locales/en-US/chrome/browser/browser.properties#l337
Attachment #8367899 - Attachment is obsolete: true
Attachment #8367939 - Flags: review?(dao)
Comment on attachment 8367939 [details] [diff] [review]
bug947353v3.patch

>+          var warningMessage = PluralForm.get(tabsToClose,
>+                                              bundle.getString("tabs.closeWarningMultiple")
>+                                              ).replace("#1", tabsToClose);

please format that this way:

>          var warningMessage = PluralForm.get(tabsToClose,
>                                              bundle.getString("tabs.closeWarningMultiple"))
>                                         .replace("#1", tabsToClose);

or:

>          var warningMessage =
>            PluralForm.get(tabsToClose, bundle.getString("tabs.closeWarningMultiple"))
>                      .replace("#1", tabsToClose);
Attachment #8367939 - Flags: review?(dao) → review+
Comment addressed, carrying on r+ from previous patch (hoping that's the correct procedure). Thanks again for helping.

I'll need someone to check-in the patch since I don't have access outside of l10n.
Attachment #8367939 - Attachment is obsolete: true
Attachment #8368013 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2d7d07a85dd0
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
(In reply to Dão Gottwald [:dao] from comment #4)
> >+tabs.closeWarningMultiple=You are about to close #1 tab. Are you sure you want to continue?;You are about to close #1 tabs. Are you sure you want to continue?
> 
> The first string doesn't really make sense, as it shouldn't be possible to
> get that message for only one tab.

But the first string helps localizers understand that this is a normal plural forms string. Leaving it blank makes the string much harder to understand for localizers not using the same plural rules as English, for no good reason.
Pavel, could you verify this one?
Flags: needinfo?(pcvrcek)
It looks good. Thanks!

v=pcvrcek
Status: RESOLVED → VERIFIED
Flags: needinfo?(pcvrcek)
QA Contact: pcvrcek
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: