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

Automatic writing of files for all locales #11

Closed
carlptr opened this issue Nov 16, 2011 · 4 comments
Closed

Automatic writing of files for all locales #11

carlptr opened this issue Nov 16, 2011 · 4 comments

Comments

@carlptr
Copy link

carlptr commented Nov 16, 2011

I like very much, that i18n writes the locale file automatically when a new translation string is used. What I am missing is a possibility to update the other locale files as well.
An example:
I have to locales, german (de) and english (en). I develop in german and use a new string. This string is added to the de.js file. The string is not added in the en.js file. Therefore I cannot create a translation of it. When I deploy the application now and an english user receives the translation he will get the german text as a translation was not done yet.

Are there any simple ways to deal with this?

Would it make sense to modify i18n, so that when a locale file is written, all locale files are updated?

@mashpie
Copy link
Owner

mashpie commented Nov 16, 2011

yes, both...

I think it would be a nice and easy to add feature to add new strings to all files. So I leave this issue as a note to myself :)
And, there is a method by using webtranslate it: they are able to merge and update on multiple files at once.

@jnovack
Copy link

jnovack commented Aug 28, 2013

Is there a method for getting ALL the i18n translations within your files? I have some functions which rarely get called, and all over the place. i18n only updates the file when the code is called. How can I go through all the files (with the exception of grep) to find all my i18n instances to build my en.json?

@mashpie
Copy link
Owner

mashpie commented Aug 28, 2013

currently not in api. but should be pretty easy to implement. any more specs? You need a dump of all phrases, right?

@jnovack
Copy link

jnovack commented Aug 28, 2013

Thank you, yes. I suppose an interface which dumps all the phrases would be very helpful. I imagine I would store in my project's contrib/ directory.

var i18n = require("i18n");

i18n.extract('path/');  // Traverse path for all .js files.
i18n.extract('path/to/file.js');   // Process single file.

This way I can run contrib/i18n.js before my final commit to have all the phrasing.

@mashpie mashpie modified the milestones: 0.9.0 - feature improvements, backlog, 0.8.0 - enhanced plural Feb 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants