laravel-vue-i18n-generator icon indicating copy to clipboard operation
laravel-vue-i18n-generator copied to clipboard

How can i remove wrapping locale object?

Open illjah42 opened this issue 4 years ago • 1 comments

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?

illjah42 avatar Nov 27 '19 16:11 illjah42

The same issue! Looking forward!

yevhenlisovenko avatar Nov 27 '19 20:11 yevhenlisovenko