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

Generate json translation files automatically based on usage of tr in code #204

Closed
omidraha opened this issue Jun 17, 2020 · 4 comments
Closed

Comments

@omidraha
Copy link

omidraha commented Jun 17, 2020

Hi,

It's possible to generate json translation files automatically based on usage of tr in code?

For example, in Django we have this command:

$ django-admin makemessages -a

Runs over the entire source tree of the current directory and pulls out all strings marked for translation. It creates (or updates) a message file in the conf/locale (in the Django tree) or locale (for project and application) directory. After making changes to the messages files you need to compile them with compilemessages for use with the builtin gettext support.

@Overman775
Copy link
Collaborator

@omidraha No, is not implemented

@SanjiKir
Copy link

SanjiKir commented Oct 9, 2020

@Overman775 Hey man! Was wondering why is this issue closed? many popular translations libraries support this out of the box like https://github.com/i18next/i18next-parser or http://i18next.github.io/i18next-scanner/

@spiritinlife
Copy link
Collaborator

@SanjiKir @Overman775 @aissat @omidraha

I also needed this and created a rough script that can do it with some limitations.
You could check it out here https://gist.github.com/spiritinlife/49a9397768b508ecab929e7d6bbee038.

@tapionx
Copy link

tapionx commented Dec 16, 2020

This is not good. The tool should generate the JSON (or CSV / XML) files automatically, and update them accordingly if i add or delete some strings.

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

5 participants