You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate
Environment
Ember Version: 3.28.9
Ember CLI Version: 4.5.0
Ember Intl Version: 6.0.0-beta.3
Browser(s): Chrome 103.0.5060.134
Node Version: 12.14.1
Steps to Reproduce
My browsers locale is set to de-DE. I am setting the locales on the intl service as
this.intl.setLocale(['de-DE','en-gb']);
During setLocale(locale) the following happens:
setLocale(locale){(true&&!(locale)&&(0,_debug.assert)(`[ember-intl] no locale has been set! See: https://ember-intl.github.io/ember-intl/docs/quickstart#4-configure-ember-intl`,locale));this.locale=locale;this.getOrCreateIntl(locale);}
Via this.locale = locale the setter is called, which normalizes the passed locales and sets this._locale = ['de-de', 'en-gb'].
Then getOrCreateIntl creates the intl but doesn't normalize de-DE to de-de, which creates an entry in this._intls under key de-DE.
Now if I translate via the t helper in a template, in serviceFormatterProxy the locale is set via this.locale is set to ['de-de', 'en-gb'] (via this._locale).
However, intl = this.getIntl(locale); sets intl to undefined since there is no entry for de-DE in this._intls.
As a consequence, the format method in FormatMessage throws an error since intl is undefined.
Happens only in chrome when language is set to German.
The text was updated successfully, but these errors were encountered:
Environment
Steps to Reproduce
My browsers locale is set to
de-DE
. I am setting the locales on theintl
service asDuring
setLocale(locale)
the following happens:Via
this.locale = locale
the setter is called, which normalizes the passed locales and setsthis._locale = ['de-de', 'en-gb']
.Then
getOrCreateIntl
creates the intl but doesn't normalizede-DE
tode-de
, which creates an entry inthis._intls
under keyde-DE
.Now if I translate via the
t
helper in a template, inserviceFormatterProxy
thelocale
is set viathis.locale
is set to['de-de', 'en-gb']
(viathis._locale
).However,
intl = this.getIntl(locale);
setsintl
toundefined
since there is no entry forde-DE
inthis._intls
.As a consequence, the
format
method inFormatMessage
throws an error sinceintl
isundefined
.Happens only in chrome when language is set to German.
The text was updated successfully, but these errors were encountered: