vue-storefront-1 icon indicating copy to clipboard operation
vue-storefront-1 copied to clipboard

Documentation: Command to create translations not working

Open phoenixdev-kl opened this issue 6 years ago • 0 comments

Current behavior

When executing the following command from docs/guide/basics/recipes.md, an empty file i18n.csv is created:

grep --include \*.js --include \*.vue -nrw  ./ -e 'i18n.t(' -e '$t(' -h | grep -o -P "(?<=t\(\').*(?=\'\))" | awk -F"'" -v OFS='|' '{ print $1,$1 }' > i18n.csv

Expected behavior

As stated in recipes.md, a file containing all translations should be created.

[...] A good start is to properly collect all i18n phrases into a CSV file. The following line of bash code would get the job done (a pipe-separated CSV file named i18n.csv would be created, adjust accordingly to your needs).

Steps to reproduce the issue

  1. Open terminal
  2. Navigate to your Vue Storefront root directory
  3. Execute grep --include \*.js --include \*.vue -nrw ./ -e 'i18n.t(' -e '$t(' -h | grep -o -P "(?<=t\(\').*(?=\'\))" | awk -F"'" -v OFS='|' '{ print $1,$1 }' > i18n.csv

Repository

https://github.com/DivanteLtd/vue-storefront/blob/develop/docs/guide/basics/recipes.md#collecting-all-vsf-i18n-phrases-into-a-csv

Can you handle fixing this bug by yourself?

  • [ ] YES
  • [x] NO

Which Release Cycle state this refers to? Info for developer.

  • [x] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • [ ] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • [ ] This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • OS: MacOS 10.14.6 (Mojave)
  • Node: 10.16.3
  • Code Version: 1.11.0-rc.1

Additional information

Might also happen on master branch, but haven't tried yet. The logic needs to be adjusted to be able to handle $t() or i18n.t() called with a second parameter (see vuestorefront/vue-storefront#2854).

phoenixdev-kl avatar Sep 16 '19 07:09 phoenixdev-kl