Skip to content

Instantly share code, notes, and snippets.

@mszkb
Created January 22, 2021 09:46
Show Gist options
  • Save mszkb/af1d7d675469cb85521002cfa00a57d8 to your computer and use it in GitHub Desktop.
Save mszkb/af1d7d675469cb85521002cfa00a57d8 to your computer and use it in GitHub Desktop.
vuex-i18n split up lang.json files

vuex-i18n concat json files: If you developing a component library and you want to decouple it from the app:

  • Create seperate lang.json file
  • require it in i18n/index.js
  • concat with others
const defaultEn = require("./en.json");
const appkitEn = require("@/components/theme/appkit/i18n/en.json");

const en = { ...defaultEn, ...appkitEn };

Vue.i18n.add("en", en);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment