# HG changeset patch # User Fadi Abbud # Date 1547542259 -3600 # Node ID 70573eea890e51aac037293ec84f98e5c15f5024 # Parent 11669276e19761b8937110d10fc9a595e1881cfe improve Translation process : improve package.json and update the documentation * update vue-gettext dependency * add script to automate the `make translations` process via yarn serve/build * delete run:both, it misses the step in serve/build * update the Documention according to the last changes diff -r 11669276e197 -r 70573eea890e client/README.md --- a/client/README.md Tue Jan 15 09:42:38 2019 +0100 +++ b/client/README.md Tue Jan 15 09:50:59 2019 +0100 @@ -3,6 +3,8 @@ * Install dependencies + * Install (`xgettext`) tool (e.g. for Debian xgettext (GNU gettext-tools) 0.19.8.1) + * Javascript `yarn install` @@ -21,10 +23,6 @@ Run webpack-dev-server with `yarn serve` - * If you also want to start the backend, try - - `yarn run:both` - * Build `yarn build` builds the production ready assets to `web` folder. @@ -34,7 +32,7 @@ * Translation * Extract Messages via `make makemessages` - * Translations are converted via `make translations` + * Translations are converted via `make translations` which is executed automatically with yarn serve/build For more information see [developer documentation](./docs/developer.md) diff -r 11669276e197 -r 70573eea890e client/docs/developer.md --- a/client/docs/developer.md Tue Jan 15 09:42:38 2019 +0100 +++ b/client/docs/developer.md Tue Jan 15 09:50:59 2019 +0100 @@ -75,11 +75,8 @@ - SK - HU - HR -- RS -- BiH - BG - RO -- UA ## Our preferred translation cycle is as follows: @@ -113,7 +110,8 @@ In order to extract the messages from the templates call `make makemessages`. After that you have the `.po`-file which could be translated. -After translation, you have to call `make translations` to generate the `translations.json` + +After translation, `make translations` has to be called to generate the `translations.json`, that is being done automatically via yarn serve/build. which is consumed by `vue-gettext`. The workflow is as follows: diff -r 11669276e197 -r 70573eea890e client/package.json --- a/client/package.json Tue Jan 15 09:42:38 2019 +0100 +++ b/client/package.json Tue Jan 15 09:50:59 2019 +0100 @@ -8,9 +8,8 @@ }, "private": true, "scripts": { - "run:both": "concurrently \"../cmd/gemma/gemma\" \"vue-cli-service serve\"", - "serve": "VUE_APP_HGREV=$(hg log -r . --template \"{data|shortdate}-{node|short}\") vue-cli-service serve", - "build": "VUE_APP_HGREV=$(hg log -r . --template \"{data|shortdate}-{node|short}\") vue-cli-service build", + "serve": "make translations && VUE_APP_HGREV=$(hg log -r . --template \"{data|shortdate}-{node|short}\") vue-cli-service serve", + "build": "make translations && VUE_APP_HGREV=$(hg log -r . --template \"{data|shortdate}-{node|short}\") vue-cli-service build", "analyze": "ANALYZE=true vue-cli-service serve", "lint": "vue-cli-service lint", "test:unit": "vue-cli-service test:unit", @@ -65,7 +64,7 @@ "node-sass": "^4.10.0", "pretty-quick": "^1.8.0", "sass-loader": "^7.0.1", - "vue-gettext": "^2.1.1", + "vue-gettext": "^2.1.2", "vue-template-compiler": "^2.5.17", "webpack-bundle-analyzer": "^3.0.3" },