vue-i18n-service icon indicating copy to clipboard operation
vue-i18n-service copied to clipboard

Allow to import only one locale without squashing the others.

Open Yimiprod opened this issue 6 years ago • 0 comments

Quick example:

for a given component.vue

<i18n>
{
  "en": {
     "greeting": "Hello {name}",
  },
  "fr": {
     "greeting": "Bonjour {name}",
  }
}
</i18n>
// ...

inject two new locales

{
  "de": {
     "greeting": "Hallo, {name}",
  },
  "it": {
     "greeting": "Ciao {name}",
  }
}

results in

<i18n>
{
  "en": {
     "greeting": "Hello {name}",
  },
  "fr": {
     "greeting": "Bonjour {name}",
  },
  "de": {
     "greeting": "Hallo, {name}",
  },
  "it": {
     "greeting": "Ciao {name}",
  }
}
</i18n>
// ...

and maybe only targeting which one we want to export and import

$ npx vue-i18n-service export > translations.json --locales=fr,it
$ npx vue-i18n-service import < translations.json --locales=en,de

Yimiprod avatar Jun 12 '19 15:06 Yimiprod