bundle-tools icon indicating copy to clipboard operation
bundle-tools copied to clipboard

possible to include .js instead of .json in SFC (block)?

Open ssuess opened this issue 4 years ago • 3 comments

Currently the i18n block allow specifying a .json file as the source like so:

<i18n src="./common/locales.json"></i18n>

But as the dynamic feature of this issue is not yet implemented, I was wondering if there was a workaround by importing a .js file that exports the object like so:

//langVar.js
import langVar from './myComponent/langVar/index.json'
export default {
 langVar: langVar
}

and then in my component import langVar.js, either by:

<i18n src="./langVar.js"></i18n>

or in some other fashion? I need to keep my language files for the component separate to support my language translation system, which is why I need this.

ssuess avatar Sep 06 '19 12:09 ssuess

need this feature too :D

whenios avatar Nov 11 '19 11:11 whenios

Me too!!!, Hope gets added soon!

danielcommesse avatar Dec 04 '19 04:12 danielcommesse

Would be indeed awesome to have this!

JasonLandbridge avatar Jan 07 '20 16:01 JasonLandbridge

vue-i18n-loader will be deprecated near the future We can use unplugin-vue-i18n Thanks

kazupon avatar Nov 16 '22 01:11 kazupon

vue-i18n-loader will be deprecated near the future We can use unplugin-vue-i18n Thanks

Are there any examples for this? I can't find any here: unplugin-vue-i18n

ssuess avatar Nov 16 '22 07:11 ssuess