jamesarosen/ember-i18n

Any way to override /app/locales

Closed this issue · 2 comments

Hello!

Is there any way to override the default /app/locales/ structure when importing translations?

I'd like to add locales using a subfolder in vendor (i.e. /vendor/branding/) but there doesn't seem to be a way to override the default. My thinking was to pull them in using a defined path in ember-cli-build without building an addon that manipulates and moves files into the locales default directory. Hope that makes sense.

Thanks

You can call addTranslationson the i18n service. We actually load translations from the server on boot that, in some cases, are customer specific.

this.get('i18n').addTranslations('en', {
  'hello': 'world',
  'foo': 'bar'
});

So all you really need to do is just export a hash from the vendor/branding/XXX file, import it and call addTranslations. I'd say do this in an initializer.

jamesarosen/ember-i18n has been deprecated in favor of ember-intl.