Closed Bug 1500823 Opened 6 years ago Closed 6 years ago

Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder in Japanese

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 65
Tracking Status
firefox-esr60 --- unaffected
firefox63 --- verified
firefox64 --- verified
firefox65 --- verified

People

(Reporter: hidekis, Assigned: flod)

References

Details

(Keywords: regression)

Attachments

(3 files)

Attached image 2018-10-21_18-56-46.png
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

When Japanese locale is active, open more than one Firefox window, and then attempt to quit Firefox. (Confirmation in Options should be enabled to show this message.)


Actual results:

The multiple window closing confirmation message contains string placeholders "%1$S 2個のウインドウを閉じようとしています。よろしいですか" when closing Firefox while more than one Window is active.


Expected results:

It should not show such placeholder "%1$S", and should only show pertinent message.
This happened in both RC build 2 installer and portable for 63.0 and with en-US + ja language pack, as well as ja portable package.
Yes, that's the one!
Status: UNCONFIRMED → NEW
Ever confirmed: true
Unfortunately we're past the string freeze for 63. 

While this is not a standard getFormattedString call, because of the plural, the code was designed to accept both %S and %1$S.
https://searchfox.org/mozilla-central/rev/0ec9f5972ef3e4a479720630ad7285a03776cdfc/browser/components/nsBrowserGlue.js#1785

The problem is that the regex is wrong

%(?:1$)?S

The $ sign is not escaped

%(?:1\$)?S
Assignee: nobody → francesco.lodolo
Blocks: 1438499
Component: ja / Japanese → General
Flags: needinfo?(h.rayflood)
Flags: needinfo?(chimantaea_mirabilis)
Product: Mozilla Localizations → Firefox
QA Contact: l10n-qa
Summary: Multiple window closing confirmation shows placeholders → Multiple window closing confirmation shows placeholders in Japanese
Summary: Multiple window closing confirmation shows placeholders in Japanese → Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder in Japanese
Pushed by francesco.lodolo@mozillaitalia.org:
https://hg.mozilla.org/integration/autoland/rev/6a8240b5c287
Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder r=Gijs
https://hg.mozilla.org/mozilla-central/rev/6a8240b5c287
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Keywords: regression
Does this look correct?
Flags: needinfo?(hidekis)
(In reply to Francesco Lodolo [:flod] from comment #8)
> Created attachment 9019254 [details]
> 65.0a1 (2018-10-22) (64 ビット)
> 
> Does this look correct?

Yes, this looks perfect!
Flags: needinfo?(hidekis)
Status: RESOLVED → VERIFIED
Comment on attachment 9018955 [details]
Bug 1500823 - Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Bug 1438499

User impact if declined: Warning displayed when closing multiple windows is incorrect for Japanese, and potentially other locales.

Is this code covered by automated tests?: No

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: No

If yes, steps to reproduce: 

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): Correcting incorrect regular expression only used to replace a parameter in this string.

String changes made/needed: None
Attachment #9018955 - Flags: approval-mozilla-release?
Attachment #9018955 - Flags: approval-mozilla-beta?
Comment on attachment 9018955 [details]
Bug 1500823 - Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder

Fixes a broken warning dialog for Japanese locales (and possibly others). Approved for 64.0b4.
Attachment #9018955 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
I've reproduced the issue on Windows 7 x64, Ubuntu 16.04 x64 and macOS 10.13 using Firefox 63 RC build 2 (ja localization build and en-US + ja language pack).

Verified the issue on Windows 7 x64, Ubuntu 16.04 x64 and macOS 10.13 using latest Nightly 65.0a1 (2018-10-24) with ja, ar, zh-CN, es-ES, de, ru, ko, pt-PT, pl, fr, tr localization builds and with en-US + ja language pack. Everything looks good here.
Verified fixed on Windows 7 x64, Ubuntu 16.04 x64 and macOS 10.13 using Firefox 64 Beta 4 (buildID: 20181025233934) with ja, ar, de, fr, es-ES, ko, pt-PT, ru, zh-CN localization builds and with en-US + ja language pack.
Flags: qe-verify+
Comment on attachment 9018955 [details]
Bug 1500823 - Dialog displayed when closing multiple windows shows unreplaced %1$S placeholder

Minimal patch, fixed on nightly a week ago, uplifted to beta, had QA, approved for 63.0.1. Thanks
Attachment #9018955 - Flags: approval-mozilla-release? → approval-mozilla-release+
Verified fixed on Windows 7 x64, Ubuntu 16.04 x86 and macOS 10.14 using Firefox 63.0.1 (buildID: 20181030165643) with ja, ar, de, fr, es-ES, ko, pt-PT, ru, zh-CN localization builds and with en-US + ja language pack.
You need to log in before you can comment on or make changes to this bug.