Closed puzrin closed 5 years ago
Can you draw a simple chart about the order of scripts and their input/output files?
lv-textract
-> .yaml -> lv-tcompile
-> .clv-tmerge
-> .yamlAlternative - one script (except font) + subcommands:
lv-t [command] options
Example:
lv-t extract ./src/*.c ./i18n/*.yml
lv-t merge ./i18n/*.yml -s'Nuts' -d'Bolts'
I like the idea of one script.
merge
is really required? As I imagine people will always just extract
and if the output yml
already exists then the data should be merged.
merge
is really required? As I imagine people will always justextract
and if the outputyml
already exists then the data should be merged.
That's not to merge files, but to merge broken keys inside.
You may have each lang in separate yaml. Then changed text in firmware, and have floating translations in each after extract. How to fix? Of cause, you can do this manually, but IMO that's not convenient.
I see, in this case merge
is a little bit misleading. As you "just" delete or insert some msgid
s and not merging two files.
edit
or update
might be a better name.
I don't know about alternatives, but you are right, merge
is not perfect.
Let's all continue post alternate names, we can summarize after 1-2 weeks. This is not blocker for development.
@kisvegabor https://github.com/littlevgl/lv_i18n/tree/vit - take a look.
I've added CLI stub. It does nothing, but allows to play with help and report invalid arguments. Try to execute and play with it.
How to install:
git clone git@github.com:littlevgl/lv_i18n.git
cd lv_i18n
git checkout vit
npm install
Then run lv_i18n.js
with different options.
In general looks good to me. I've just added some straightforward fixes to the README. See: https://github.com/littlevgl/lv_i18n/commit/ed8f5cc9ab9dd3644e4f9efc4731b6c53d548ed9
Thanks. I moved it to separate branch :). My one is actively rewritten and last commit is incomplete (stores day progress, just to show everything goes forward).
Close. Info is outdated. Actual implementation + docs merged into active branches.
Minimal set of tools to maintain translations
node.js
lv-textract
Scan directories/files end extract phrases to config.
Initial extractor can be regexp-based. That's dirty, but may be enougth. In not enougth - search for PEG-based grammar parcers.
lv-tmerge
msg_id
.lv-tcompile
Generate catalog file for
#include
from config.lv-tlint
TBD
Consistency checker. Good got CI.
Did not decided, if this should be a separate tool, or part of extractor.
font builder
TBD
By default, it may build glyphs set automatically, from used phrases + some options for defaults
Unresolved