Skip to content
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

[Breaking] Locale modules now extend from a Locale model (WIP) #26

Merged
merged 12 commits into from
Feb 9, 2015

Conversation

jasonmit
Copy link
Member

@jasonmit jasonmit commented Feb 7, 2015

  • Add addMessages and addMessage to the intl service and which delegates to the locale module
this.intl.addMessage('en', 'greeting', 'hello');
this.intl.addMessage('fr', 'greeting', 'hello');

// will do a shallow merge based on feedback from @caridy
this.intl.addMessages('en' {
  greeting: 'hello',
  bye: 'goodbye'
});

This is extensible if you do not want your messages to hang off "messages" on the locale module. You can override addMessage/addMessages on the locale model.

  • This locale model implements a accessor method so you can implement your own getter accessor logic.
    • This is the method invoked from intl-get and intl-get no longer acts on the service, but instead the active locale module instance.

It will resolve #24 #23 #18

All existing locale modules no longer can be POJOs and should extend from:

import Locale from 'ember-intl/models/locale’;

This locale model implements a intlGetAccessor method so you can
implement your own getter accessor logic.

This is the method invoked from intl-get and intl-get no longer acts on
the service, but instead the active locale module instance.

It should resolve #24 #23

All existing locale modules no longer can be POJOs and should extend
from:

`import Locale from 'ember-intl/models/locale’;`
@jasonmit jasonmit changed the title [Breaking] Locale modules now extend from Locale model [Breaking] Locale modules now extend from a Locale model Feb 7, 2015
@jasonmit jasonmit changed the title [Breaking] Locale modules now extend from a Locale model [Breaking] Locale modules now extend from a Locale model (WIP) Feb 7, 2015
@jasonmit jasonmit force-pushed the intl-get-accesor branch 7 times, most recently from dfe1e1c to 5f67161 Compare February 8, 2015 07:12
@jasonmit
Copy link
Member Author

jasonmit commented Feb 9, 2015

Thanks for adding the smoke tests @zeppelin, I've also added you as a contributor in package.json 👍

I fixed the failing test issues and will likely merge this shortly.

jasonmit added a commit that referenced this pull request Feb 9, 2015
[Breaking] Locale modules now extend from a Locale model (WIP)
@jasonmit jasonmit merged commit af61a9c into master Feb 9, 2015
@jasonmit jasonmit deleted the intl-get-accesor branch February 10, 2015 06:40
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.

Allow message keys to contain dots
2 participants