Conversation
| get messages() { | ||
| return this._messages[Symbol.iterator](); | ||
| } | ||
|
|
There was a problem hiding this comment.
It would be good to retain some way of iterating over a bundle's messages. Atm. e.g. print() in tools/format.js ends up needing to access bundle._messages.
How about something like this?
get messageKeys() {
return this._messages.keys();
}There was a problem hiding this comment.
I don't think we need to add this right now. I don't know of good runtime use-cases for iterating over all messages in a bundle. I usually prefer to keep the API surface as small as possible, and extend it only when needed.
The code in tools/format.js should use the result of the full-AST parsing from fluent-syntax to build an iterable of message keys for the purpose of printing all messages. I intend to fix it in a follow-up but I can also do it here.
| if (typeof message === "string") { | ||
| return this._transform(message); | ||
| format(path, args, errors) { | ||
| let parts = path.split("."); |
There was a problem hiding this comment.
you could just use path.split(".", 1); to separate one . and not bother with anything past that. The rest is an attribute name.
|
We're going to the go with the |
This is a continuation of the work started by @unclenachoduh in #322.