Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flow #3

Open
ghost opened this issue Jan 26, 2019 · 2 comments
Open

flow #3

ghost opened this issue Jan 26, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 26, 2019

hi
What are the steps you take to convert from source code to json file like es_ES.json ?

For now I found this method:

cd dart_gettext
pybabel extract -F babel.cfg -k __ -o messages.pot .
pybabel init -i messages.pot -d translations -l es_ES

then edit
translations/es_ES/LC_MESSAGES/messages.po with poedit

then make a script using gettext-parser
to convert translations/es_ES/LC_MESSAGES/messages.po to l10n/es_ES.json

do you work like this or ou have better dev flow?

@cah4a
Copy link
Owner

cah4a commented Jan 27, 2019

To convert po-file to json you could use a simple script:

node po-to-json.js ./path/to/some.po > /path/to/new.json

Or, in my opinion, the better way, you could compile po to mo using msgfmt and open those mo-files using dart_gettext_parser package in the app runtime.

@ghost
Copy link
Author

ghost commented Jan 27, 2019

interesting, will try tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant