-
-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
HI,
if you call __n() without setLocale beforehand it will throw:
var lc = targetLocale.toLowerCase().split(/[_-\s]+/)
^
TypeError: Cannot read property 'toLowerCase' of undefined
at Object.i18nTranslatePlural [as __n] (path/node_modules/i18n/i18n.js:371:31)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
Even if you define a default locale with:
i18n.configure({
locales:['en', 'de'],
directory: __dirname + '/../locales',
defaultLocale: 'de',
});
There should be a fallback that if no targetLocale is found the defaultLocale should be used.
TylerVigario, Welcius, Bitluck, MishaKav, beytarovski and 3 more
Metadata
Metadata
Assignees
Labels
No labels