-
Notifications
You must be signed in to change notification settings - Fork 80
Rename "context" to "bundle" #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| used as Gecko modules. | ||
|
|
||
| `Fluent.jsm` exports the `MessageContext` constructor which provides the | ||
| `Fluent.jsm` exports the `FluentBundle` constructor which provides the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zbraniecki Do we have a Fluent.jsm in fluent-gecko?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we have MessageContext.jsm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, of course not. Why would we? :( Sorry, Yeah, we have MessageContext.jsm, and I'm happy to rename it to FluentBundle.jsm
fluent-gecko/makefile
Outdated
| build: FluentBundle.jsm Localization.jsm DOMLocalization.jsm l10n.js | ||
|
|
||
| MessageContext.jsm: $(SOURCES) | ||
| FluentBundle.jsm: $(SOURCES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zbraniecki What's your preference wrt. renaming this JSM? Should we do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference. Happy to follow your preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference. Open to renaming it. At least to Fluent.jsm :)
zbraniecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename generateMessages to generateBundles everywhere and rename the Gecko thing to Fluent.jsm - but both are just mild preferences.
fluent-dom/src/localization.js
Outdated
| this.generateMessages = generateMessages; | ||
| this.ctxs = CachedAsyncIterable.from( | ||
| this.bundles = CachedAsyncIterable.from( | ||
| this.generateMessages(this.resourceIds)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateBundles? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, I forgot fluent-dom had those too.
| used as Gecko modules. | ||
|
|
||
| `Fluent.jsm` exports the `MessageContext` constructor which provides the | ||
| `Fluent.jsm` exports the `FluentBundle` constructor which provides the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, of course not. Why would we? :( Sorry, Yeah, we have MessageContext.jsm, and I'm happy to rename it to FluentBundle.jsm
fluent-gecko/makefile
Outdated
| build: FluentBundle.jsm Localization.jsm DOMLocalization.jsm l10n.js | ||
|
|
||
| MessageContext.jsm: $(SOURCES) | ||
| FluentBundle.jsm: $(SOURCES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference. Open to renaming it. At least to Fluent.jsm :)
| bundle2 = new FluentBundle(); | ||
| bundle2._setMessages(['foo', 'bar']); | ||
|
|
||
| generateMessages = async function *generateMessages() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateBundles?
fluent-dom/README.md
Outdated
| ```javascript | ||
| import { Localization } from 'fluent-dom' | ||
|
|
||
| function *generateMessages() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateBundles?
API changes:
MessageContexttoFluentBundle.MessageArgumenttoFluentType.MessageNumberArgumenttoFluentNumber.MessageDateTimeArgumenttoFluentDateTime.mapContextSynctomapBundleSync.mapContextSynctomapBundleSync.messagesprop of<LocalizationProvider>tobundles.Other internal changes:
ctx,cx,mcx,mc,ctxsandcontextstobundleorbundles.Localization'ssomethingFromContextmethods tosomethingFromBundle.Localization.ctxtstobundles.generateMessagestogenerateBundlesin documentation and examples.