add parameters to property files documentation

RESOLVED INVALID

Status

Developer Documentation
Mozilla Platform
RESOLVED INVALID
12 years ago
4 months ago

People

(Reporter: Pike, Assigned: Nobody's working on this, feel free to take it)

Tracking

Details

(URL)

(Reporter)

Description

12 years ago
The article about properties files in the xul tutorial, http://developer.mozilla.org/en/docs/XUL_Tutorial:Property_Files, doesn't mention the syntax to be used for parameters.
http://www.xulplanet.com/references/elemref/ref_stringbundle.html#prop_getFormattedString isn't really concise either.

A (python) regexp to describe the syntax in some detail would be

'%(?:(?P<cn>[0-9]+)\$)?(?P<width>[0-9]+)?(?:.(?P<pres>[0-9]+))?(?P<size>[hL]|(?:ll?))(?P<type>[dciouxXefgpCSsn])'

That ain't fully tested, I have to admit, but there is a variety of home grown alternatives for no real reason other than lack of docs.

I'm not sure if this article should be part of the xul tutorial itself, or if this should rather be an out-of-band article, linked to from the tutorial.
Assignee: nobody → eshepherd
I could use some more help with this one.  Regexps and I don't get along, so this doesn't tell me very much, I'm afraid. :)
Component: Documentation Requests → Documentation
Product: Mozilla Developer Network → Mozilla Developer Network
Automatically closing all bugs that have not been updated in a while. Please reopen if this is still important to you and has not yet been corrected.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
Reopening for review by Sheppy.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
(In reply to Axel Hecht [:Pike] from comment #0)
> The article about properties files in the xul tutorial,
> http://developer.mozilla.org/en/docs/XUL_Tutorial:Property_Files, doesn't
> mention the syntax to be used for parameters.

I'm not clear exactly what the issue is here. Is this about the syntax for the value of a property, or for something else?
Component: Documentation → General
Product: Mozilla Developer Network → Developer Documentation
(Reporter)

Comment 5

5 years ago
(In reply to Eric Shepherd [:sheppy] from comment #4)
> (In reply to Axel Hecht [:Pike] from comment #0)
> > The article about properties files in the xul tutorial,
> > http://developer.mozilla.org/en/docs/XUL_Tutorial:Property_Files, doesn't
> > mention the syntax to be used for parameters.
> 
> I'm not clear exactly what the issue is here. Is this about the syntax for
> the value of a property, or for something else?

Yes.

Basically, it's a variant of printf for the most part, so you have entries like

my_string = You got %1$S from %2$S

Other entries, in particular for plurals, have the notion of using

my_plural_string = You got one mail;You got #1 mails

Newly added as part of jetpack-based code is

my_jetpack_string = You got {{ nags }} from {{ random_dude }}
Whiteboard: u=mozdev p=0
Component: General → Mozilla Platform
Whiteboard: u=mozdev p=0 → u=mozdev p=0 c=Platform
Assignee: eshepherd → nobody
Status: REOPENED → NEW
Whiteboard: u=mozdev p=0 c=Platform → [DocArea=XUL]
I think this is no longer relevant, please reopen if I'm wrong.
Status: NEW → RESOLVED
Last Resolved: 5 years ago4 months ago
Resolution: --- → INVALID
Whiteboard: [DocArea=XUL]
You need to log in before you can comment on or make changes to this bug.