vue-storefront-1
vue-storefront-1 copied to clipboard
Documentation: Command to create translations not working
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
- Open terminal
- Navigate to your Vue Storefront root directory
- 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
developbranch and create Pull Request2. Feature / Improvementback todevelop. - [ ] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - [ ] 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
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.
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).