Issues with migrating from ember-i18n
See original GitHub issue- I am on the latest ember-intl version
- I have searched the issues of this repo and believe that this is not a duplicate
Environment
- Ember Version: 3.0.0
- Ember CLI Version: 3.0.0
- Ember Intl Version: 4.0.0-beta.9
- Browser(s): Chrome
- Node Version: 8.11.4
Steps to Reproduce
We have a translation that is bound to a variable. Something like {{t company.status}}
If company.status
is undefined, ember-intl will throw an error, as per https://github.com/ember-intl/ember-intl/blob/89009718cb36ebfce0b2783e9aff05702d9f6431/addon/helpers/-format-base.js#L36
I’m curious why we are so strict here? It might be nice to allow for undefined
values via a global allowEmpty
flag, rather than passing allowEmpty=true
into each helper. There should at least be a way to disable this check when running tests, in case your test environment does not have 100% parity with your real app, and is missing a variable.
Another issue, is we use ember-cli-accounting, which provides a format-number
helper. The one from ember-intl clobbers it, since they have the same name. It would be nice to allow whitelisting and blacklisting, so we could decide which helpers to include.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Yes that makes sense to me. I’ll plan to s/format/intl in the helper names and deprecate the existing names.
For sure, but module unification may be a very long time and even when it drops, it will take users awhile to update, so it might be good to guard against this.