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

Consider message as default key #46

Closed
bakura10 opened this issue Feb 16, 2015 · 2 comments
Closed

Consider message as default key #46

bakura10 opened this issue Feb 16, 2015 · 2 comments

Comments

@bakura10
Copy link

Hi,

When formatting message, we are forced to specify the full path: {{format-message (intl-get 'messages.foo.bar')}}.

Can't this actually always assume that messages is the root, so that it allows us to simply refer to message using "foo.bar" instead of "messages.foo.bar" ? :)

@jasonmit
Copy link
Member

This is already possible today. See my last set of comments in #23

@jasonmit
Copy link
Member

Update since I was on my phone and just want to make one point clear:

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

// app/locales/en.js
export default Locale.extend({
  foo: 'bar'
});

{{format-message (intl-get 'foo')}} outputs bar

If this is the path you plan on taking, I suggest creating your own locales class which extends from ember-intl/models/locales where you implement your own addMessage/addMessages (if you plan to use them).

See: https://github.com/yahoo/ember-intl/blob/master/addon/models/locale.js#L12-L29

If you have no plans to sideload messages, then you can ignore changing them.

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

No branches or pull requests

2 participants