Slow add-on warning: Use ordered arguments in strings with multiple variables, use %S instead of %s in restart button (brandShortName is truncated)

RESOLVED DUPLICATE of bug 1071880

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 1071880
3 years ago
3 years ago

People

(Reporter: flod, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
http://hg.mozilla.org/mozilla-central/diff/2439c229cace/browser/locales/en-US/chrome/browser/browser.properties

addonwatch.slow=%S might be making %S run slowly
addonwatch.restart.message=To disable %S you must restart %S

These should be
addonwatch.slow=%1$S might be making %2$S run slowly
addonwatch.restart.message=To disable %1$S you must restart %2$S

It might seem obvious to you, but a command explaining what these variables are would be helpful.

I would also use uppercase for consistency
addonwatch.restart.label=Restart %s

As a general reference, https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Use_ordered_variables_in_string_with_multiple_variables
(Reporter)

Comment 1

3 years ago
(In reply to Francesco Lodolo [:flod] from comment #0)
> I would also use uppercase for consistency
> addonwatch.restart.label=Restart %s

Based on 
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getFormattedString
http://aecreations.blogspot.it/2007/11/discovering-wonders-of.html

Does %s actually works?

Comment 2

3 years ago
No, %s does not work. The button appears as "Restart N" instead of "Restart Nightly".
(Reporter)

Comment 3

3 years ago
(In reply to Jesse Ruderman from comment #2)
> No, %s does not work. The button appears as "Restart N" instead of "Restart
> Nightly".

Thanks for confirming, I've just encountered the issue myself.

While the first 2 strings can be fixed without new IDs (but changing them wouldn't hurt), the last one definitely needs a new ID to make sure the variable is fixed in localizations.
(Reporter)

Updated

3 years ago
Summary: Use ordered arguments and add localization comments for addonwatch.slow and addonwatch.restart.message (slow add-on warning) → Slow add-on warning: Use ordered arguments in strings with multiple variables, use %S instead of %s in restart button (brandShortName is truncated)
(Reporter)

Comment 4

3 years ago
Since bug 1071880 was backed out, I guess these will be fixed there.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1071880
You need to log in before you can comment on or make changes to this bug.