-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Factor out data producing functions #24
Conversation
will check and merge this asap. |
I thought it would be helpful if I made the changes I submitted more clear. I changed this bit of code inside self.flattenI18nextJSON(source, options, function(err, flat) {
self.parseGettext(domain, flat, options, function(err, gt) {
var data = path.extname(target) === '.po' ? gt.compilePO(domain) : gt.compileMO(domain);
self.writeFile(target, data, options, callback);
});
}); into: self.i18nextToGettextData(domain, source, path.extname(target), options, function(err, data) {
self.writeFile(target, data, options, callback);
}); where I defined a new function, i18nextToGettextData: function(domain, source, target, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
var self = this;
self.flattenI18nextJSON(source, options, function(err, flat) {
self.parseGettext(domain, flat, options, function(err, gt) {
var data = path.extname(target) === '.po' ? gt.compilePO(domain) : gt.compileMO(domain);
callback(err, data);
});
});
} The purpose of this change is to be able to use |
https://www.npmjs.com/package/i18next-conv v0.1.5 deployed on npm. |
would be nice if you keep me uptodate on the gulp plugin... |
Always been the plan :) |
if you want to add your repo to i18next organisation account i can add you there for transfer and later add needed rights to access it. upcoming v2 is right now wip: https://github.com/jamuhl/i18next-playground help there is more then welcome. right now i want to add the first draft for loading mechanism, so main parts are there and working. (plus adding some readme, with goals and basic structure of new project) right now it would be great if you could share your ideas and have a look at new code base: -> gulp tdd (will run new tests) (one of the biggest things on the list is generating some documentation like i18next.com - but want that to be generated out from markdown files (using https://github.com/millermedeiros/mdoc or something similar) for easier contribution.) |
Will be looking at it later for sure then! Thanks! |
looks like they take a lot of effort to build that: https://github.com/Automattic/mongoose/tree/gh-2462 |
Hi, I made small changes to the converting functions to separate the data creating part from the part that writes the data to the files, and checked that the tests passed. This will help me use this repo to write a gulp plugin. Thanks!