martinlindhe / laravel-vue-i18n-generator

Generates a vue-i18n compatible include file from your Laravel translations
MIT License
306 stars 207 forks source link

How can i remove wrapping locale object? #101

Open illjah42 opened 4 years ago

illjah42 commented 4 years ago

In our work we use lazy-loading translations, provided by https://nuxt-community.github.io/nuxt-i18n/.

Loaded file expects to be like this:

{
   key: 'value'
}

But the generator outputs something like this, even for --multi-locales flag:

{
  en: {
    key: 'value'
  }
}

The loaded file injects as is, so the translation function can't find $t('key'), because now it is $t(i18n.locale + '.key')

Can we somehow tune the generator to recieve an object, not wrapped in locale key in output?

yevhenlisovenko commented 4 years ago

The same issue! Looking forward!