Comments (3)
Correct, intl-get
returns an object with a property translation
and locale
, where the translation derived from. This is to tell the downstream format-message which locale to pass through to the format functions.
What is the use case for using intl-get
within your templates outside of format-message
/format-html-message
? I can make this backwards compat. by overriding toString, but I wasn't aware of people using the helper outside the context of subexpression :)
from ember-intl.
Jason,
We'd discovered that intl-get "worked" without using format-message. It wasn't clear that you "had" to use format-message. The docs didn't really say. Now they do, but it's still not quite clear. Here's the line that mentions it, but the wording of the line doesn't make it as obvious as I think it could: "Will return the message from the current locale, or locale explicitly passed as an argument, message object."
So, it looks like we were using it in an unexpected way, and we just need to do it the correct way with format-message.
Thanks for your help.
TR
from ember-intl.
Leaving this opened for now to update the docs to be more clear.
Thanks for the good feedback.
Edit: this PR will assert that intl-get is only used as a subexpression and wrote some tests to prevent that regression. #85
from ember-intl.
Related Issues (20)
- Better story for testing with lazy-loaded translations config HOT 5
- set locale normalizes localeName while getOrCreateIntl does not
- Ember-intl 6.x crashes on empty translation keys HOT 3
- Trying to add custom locales crashes the application HOT 3
- Add support for RON currency symbol: lei HOT 1
- [BUG] DateTimeFormat type errors - Might need to bump intl-messageformat to get it fixed HOT 4
- Consider more forgiving DX HOT 2
- What changed in v6? HOT 1
- Error: Could not find module `@formatjs/intl` imported from `ember-intl/services/intl` HOT 1
- Embroider support? HOT 1
- Rendering tests fail with get before set during rendering inside ember-intl HOT 1
- Missing fast-memoize module when updating ember-auto-import HOT 1
- Problems with adding Somali language - intl-numberformat error HOT 7
- When will there be another release? HOT 1
- Type issues from Registry HOT 6
- Type issues from -format-base.d.ts HOT 1
- bump typescript peer dependency to 5 HOT 3
- trailingZeroDisplay not working HOT 2
- FORMAT_ERROR when using the `Intl.RelativeTimeFormat` polyfill with `v6.0.0` of ember-intl HOT 3
- Double `intl.d.ts` cause type errors HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-intl.