3

I'm using Vue-i18n package. In every component i include a JSON file with translations, like this:

// this is a Vue template: home.vue
<i18n src="../locales/pages/home.json"></i18n>

Locally it works fine.

But i'm storing JSON files with translations on another server, so this package won't work if i try to include an external JSON directly:

<i18n src="https://example.com/translations/home.json"></i18n>

Instead, i decided to get the files on the server side (using node), however i've faced an issue when i try to deploy my app in a docker container, because an app needs to be builded with npm run build, all of the files are already bundled in JS files after build, thus i cannot replace these JSON files with my node script.

Does anyone have an idea on how to reach my goal?

Alexander Kim
  • 17,304
  • 23
  • 100
  • 157

0 Answers0