docs: expand guide with vue-i18n-extract.js examples
This internationalization documentation patch provides the developers
with specific recommendations on using vue-i18n-extract.js tool to
ensure translations consistency.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: I506091c97043ad3f50c4753daddd450abe9744fc
diff --git a/docs/guide/guidelines/internationalization.md b/docs/guide/guidelines/internationalization.md
index c407edc..6ff17d7 100644
--- a/docs/guide/guidelines/internationalization.md
+++ b/docs/guide/guidelines/internationalization.md
@@ -23,10 +23,23 @@
## Using the Vue I18n plugin
- A new `src/i18n.js` file is added and it registers Vue I18n as a plugin to
our Vue instance via the `Vue.use()` function.
-- The CLI creates a `src/locales/en.json` file, which contains our default
+- The CLI creates a `src/locales/en-US.json` file, which contains our default
translation messages.
-- The keys are placed in the `src/locales/en.json` file and then the `$t()`
+- The keys are placed in the `src/locales/en-US.json` file and then the `$t()`
function is used to output the translation messages.
+- After adding or removing calls to `$t` please run this to ensure consistent
+English translation (note: using variable expansion in key names is not
+handled automatically, you need to manually check them):
+```bash
+node node_modules/vue-i18n-extract/bin/vue-i18n-extract.js -v 'src/**/*.?(js|vue)' -l 'src/locales/en-US.json'
+```
+- If you're working on updating a translation for another language (e.g.
+Russian), run this to see the omissions (as well as cruft) and add the
+necessary keys automatically:
+```bash
+node node_modules/vue-i18n-extract/bin/vue-i18n-extract.js -v 'src/**/*.?(js|vue)' -l 'src/locales/ru-RU.json' -a
+```
+
```json
"pageDumps": {
"dumpsAvailableOnBmc": "Dumps available on BMC"
@@ -54,4 +67,4 @@
okTitle: this.$tc('pageDumps.modal.deleteDump'),
cancelTitle: this.$t('global.action.cancel'),
})
-```
\ No newline at end of file
+```