vue-i18n-service
vue-i18n-service copied to clipboard
Allow to import only one locale without squashing the others.
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