Closed
Bug 67372
Opened 25 years ago
Closed 25 years ago
%s %s %s our substitution forces specific orderings
Categories
(Core :: Internationalization: Localization, defect)
Core
Internationalization: Localization
Tracking
()
VERIFIED
INVALID
People
(Reporter: timeless, Assigned: rchen)
References
Details
(Keywords: arch, helpwanted)
we should use a form of either %verb% %subject% %object% or %s1 %s2 %s3.
Different languages are likely to need different word ordering.
I believe we have used "%1$s" for this purpose. Please be more specific about
the file name and the bug.
Comment 3•25 years ago
|
||
I search lxr and it seems like everywhere we use %1$s is for properties files
referenced by c/cpp files.
I think timeless is referring to javascript and the fact that we have no
standard way to do it there.
Comment 5•25 years ago
|
||
no, the string formats support positional formatting. see the documentation in
nsTextFormatter, which is how nsIStringBundle::formatStringFromName works.
you do stuff just like mkaply said, and use
if the property file says:
foo=%2$S %1$S %3$S
then you can say
var text = bundle.formatStringFromName("foo", ["can", "pigs", "fly"], 3);
and text will have the value "pigs can fly"
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
vrfy. thank you for the information.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•