Closed atsu85 closed 9 years ago
Default here is no translation but the wrapping object containing all the translations. This is caused by the way how es6-module-loaders works I guess.
If you provide your own translation during setup it will take it if it exists. Otherwise it will look for the fallbackLng
. So I wasn't able to reproduce your error :(
Could you maybe create a unit test depicting the problem?
oh, it may be related to the fact, that my application won't have a two languages in foreseeable future - i'm using it to externalize texts/messages, so they can later be managed/changed from one place.
Maybe you can produce it by setting fallback language to the same value as default.
@atsu85 any update on this one?
I've got a question for You regarding this line: https://github.com/zewa666/aurelia-i18next/blob/master/src/relativeTime.js#L9 that currently tries to find translations from this file https://github.com/zewa666/aurelia-i18next/blob/master/src/defaultTranslations/relative.time.js with locale "default" that is currently missing and therefore results an error at https://github.com/zewa666/aurelia-i18next/blob/master/src/relativeTime.js#L9
Shouldn't the default translations (translations.default from that line) be detected based on plugin configuration:
If so, I would use
i18n.i18next.options.lng
instead ofdefault
there.Or maybe i have misconfigured smth or maybe line is never supposed to be executed as users are supposed to provide all the relativeTime translations in the main translations file?
Anyway it would make sense to provide better error message (with some instructions) than