Automatically extract translation keys from templates and place them in location files
See original GitHub issueCouldn’t find a command for that in this project or in the web.
The workflow I wanted:
- Write templates declaring translation keys (like:
v-t="'cool_word'"
). - Run a command that will add all those translation keys to my locale json files.
- Check the json files for empty translations and fill them.
This would be much better than adding each key manually to each locale file.
For now, I wrote this Python script as a workaround for some cases: https://gist.github.com/andresmrm/2c2f959a8a5b5d4fd7ab05063f437cc1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Extracting translations - i18next documentation
Static extraction tools can read through your code files to automatically find and export translation keys. i18next-scanner, i18next-parser and ...
Read more >Localization / Multi-lingual Support — pywb 2.0 documentation
pywb can extract all text from templates and generate CSV files for translation and convert them back into a binary format used for ......
Read more >Set up continuous translation with Weblate and i18next
Automatically extract translation keys from source code. A last thing to automate a boring step: Copy all translations keys from source code and ......
Read more >i18next/i18next-scanner: Scan your code, extract ... - GitHub
Scan your code, extract translation keys/values, and merge them into i18n resource files.
Read more >Automatically extract text and structured data from documents ...
In this post, we show how you can take advantage of Amazon Textract to automatically extract text and data from scanned documents without ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rrd108 nice, I didnt know that… I am using vue-i18n-extract, but I will definitely check vue UI if it can be used for my usecase.
here is my script extracting keys from code with
vue-i18n-extract
the advantage is that you can run this nodejs script in pipelines or another automated systems… I will check if vue UI can be used same way.
Happy coding! 😃
I’ve been looking for some way to do this with Vue, but the only active project I’ve found is vue3-gettext. The problem is the documentation is a bit sparse and I’m not sure it supports all the features of vue-i18n so as to adopt it in a project. It would be great if vue-i18n supported this kind workflow. Specially being able to directly pass English strings instead of keys to
$t()
/i18n.t()
would be a big improvement.If it helps as a reference, ngx-translate-extract is a project that does this for Angular’s i18n ngx-translate library.