Closed
Bug 1310148
Opened 9 years ago
Closed 9 years ago
Create reference documentation for Builtins
Categories
(L20n :: Evangelism, defect)
L20n
Evangelism
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Pike, Assigned: zbraniecki)
References
Details
(Whiteboard: [gecko-l20n])
Attachments
(1 file)
We don't seem to have a reference documentation for Builtins like LEN etc yet?
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gandalf
| Assignee | ||
Comment 1•9 years ago
|
||
| Reporter | ||
Updated•9 years ago
|
Attachment #8802751 -
Flags: review?(stas)
Attachment #8802751 -
Flags: review?(l10n)
| Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8802751 [details] [review]
pr
I think we need to make the options explicit in our documentation. For one, I think our documentation should be self-contained, but also because the intl spec is really hard to decipher, if you're not acquainted with the nomenclature.
I'm not sure if we should keep the "In the future we might" part. I'm even wondering if that's a question for the binding part? For example:
Default options for builtins can be passed in by the developer, if the API supports it. At this point, there's no API that does that, though.
I wonder if we should keep the PLURAL builtin, mostly because we don't implement it as documented. It's really just an alias for NUMBER, and I wonder if it's easier to explain why people should use the same options in the selector as in the placable.
PS: PLURAL is one of the things that made me file this bug when I tried to read the code of which builtins we have ;-)
Attachment #8802751 -
Flags: review?(l10n) → review-
Comment 3•9 years ago
|
||
(In reply to Axel Hecht [:Pike] from comment #2)
> Comment on attachment 8802751 [details] [review]
> pr
>
> I think we need to make the options explicit in our documentation. For one,
> I think our documentation should be self-contained, but also because the
> intl spec is really hard to decipher, if you're not acquainted with the
> nomenclature.
+1
>
> I'm not sure if we should keep the "In the future we might" part. I'm even
> wondering if that's a question for the binding part? For example:
>
> Default options for builtins can be passed in by the developer, if the API
> supports it. At this point, there's no API that does that, though.
That's actually already supported by MessageContext: https://github.com/l20n/l20n.js/blob/3ba0b9ad8f20a9540eb7ef6c4bda4604af4677e1/src/intl/polyfill.js#L6-L7
> I wonder if we should keep the PLURAL builtin, mostly because we don't
> implement it as documented. It's really just an alias for NUMBER, and I
> wonder if it's easier to explain why people should use the same options in
> the selector as in the placable.
I think we should remove it. I filed bug 1311662 to have that discussion there. Zibi did a good job documenting the current state of the code. Let's discuss changes to the code in separate bugs.
I also filed bug 1311666 in which I suggest we rename OS to PLATFORM.
Comment 4•9 years ago
|
||
Comment on attachment 8802751 [details] [review]
pr
I left my feedback at https://github.com/l20n/l20n.js/pull/160#pullrequestreview-5051881. I'd like to see another iteration.
Attachment #8802751 -
Flags: review?(stas) → review-
Comment 5•9 years ago
|
||
Removing the dependencies as they aren't really blocking this.
Comment 6•9 years ago
|
||
Also note that the parser requires `:` for the keyword arguments, as well as quotes:
today-is = Today is { DATETIME($date, weekday: "long") }
https://github.com/l20n/l20n.js/blob/3ba0b9ad8f20a9540eb7ef6c4bda4604af4677e1/src/ftl/ast/parser.js#L503
We should probably change the EBNF grammar: https://github.com/l20n/spec/blob/126b422ae146cdb81eed38484eca8d732cec46a6/grammar.ebnf#L49
| Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8802751 [details] [review]
pr
carry over r+ from Stas on IRC
Attachment #8802751 -
Flags: review-
Attachment #8802751 -
Flags: review+
| Assignee | ||
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•