Closed lolmaus closed 8 months ago
In a project, I have implemented a t-error helper to standardize error handling:
t-error
Before:
{{#if (eq error.status 403)}} {{t "errors.forbidden"}} {{else if (gte error.status 400}} {{t "errors.server-failure"}} {{else}} {{t "my-component.error-message"}} {{/if}}
After:
{{t-error error "my-component.error-message"}}
Unfortunately, this forces me to add all fallback keys to ember-intl-analyzer whitelist.
ember-intl-analyzer
I would like to configure ember-intl-analyzer to recognize my t-error helper. I imagine something like this:
export default { whitelist: [ /^[^.]+\.warnings\.[^.]+$/, ], helpers: ['t', 't-error'], };
Is it something we want to support?
PS Please note this should not be sensitive to argument order.
CC @nickschot
This is now available to use in 4.6.0
In a project, I have implemented a
t-error
helper to standardize error handling:Before:
After:
Unfortunately, this forces me to add all fallback keys to
ember-intl-analyzer
whitelist.I would like to configure
ember-intl-analyzer
to recognize myt-error
helper. I imagine something like this:Is it something we want to support?
PS Please note this should not be sensitive to argument order.
CC @nickschot