Skip to content

Conversation

@stasm
Copy link
Contributor

@stasm stasm commented Aug 17, 2018

API changes:

  • Rename MessageContext to FluentBundle.
  • Rename MessageArgument to FluentType.
  • Rename MessageNumberArgument to FluentNumber.
  • Rename MessageDateTimeArgument to FluentDateTime.
  • Rename mapContextSync to mapBundleSync.
  • Rename mapContextSync to mapBundleSync.
  • Rename the messages prop of <LocalizationProvider> to bundles.

Other internal changes:

  • Rename all uses of ctx, cx, mcx, mc, ctxs and contexts to bundle or bundles.
  • Rename Localization's somethingFromContext methods to somethingFromBundle.
  • Rename Localization.ctxts to bundles.
  • Rename generateMessages to generateBundles in documentation and examples.

used as Gecko modules.

`Fluent.jsm` exports the `MessageContext` constructor which provides the
`Fluent.jsm` exports the `FluentBundle` constructor which provides the
Copy link
Contributor Author

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?

Copy link
Collaborator

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

Copy link
Collaborator

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

build: FluentBundle.jsm Localization.jsm DOMLocalization.jsm l10n.js

MessageContext.jsm: $(SOURCES)
FluentBundle.jsm: $(SOURCES)
Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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 :)

Copy link
Collaborator

@zbraniecki zbraniecki left a 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.

this.generateMessages = generateMessages;
this.ctxs = CachedAsyncIterable.from(
this.bundles = CachedAsyncIterable.from(
this.generateMessages(this.resourceIds));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateBundles? :)

Copy link
Contributor Author

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
Copy link
Collaborator

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

build: FluentBundle.jsm Localization.jsm DOMLocalization.jsm l10n.js

MessageContext.jsm: $(SOURCES)
FluentBundle.jsm: $(SOURCES)
Copy link
Collaborator

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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateBundles?

```javascript
import { Localization } from 'fluent-dom'

function *generateMessages() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateBundles?

@stasm stasm merged commit cc27987 into projectfluent:master Aug 20, 2018
@stasm stasm deleted the fluent-bundle branch August 20, 2018 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants