toretore / babilu

ABANDONED - Use i18n-js instead
MIT License
65 stars 11 forks source link

Generate locales.js with just the references in public/**/**.js #2

Closed etagwerker closed 13 years ago

etagwerker commented 13 years ago

If there are many locales and a large set of keys in your I18n configuration, Babilu can generate quite a large locales.js -

This pull request will filter the keys to be included in the generated locales.js

Please review it and let me know.

Thanks, Ernesto

toretore commented 13 years ago

Hi Ernesto,

I agree it could be an issue on larger apps with multiple locales, but I'd rather force the developer to decide what should be included or not than to try and guess, which will undoubtedly result in mismatches and confusion due to too much magic. For example, it would not work on one of my apps where I've aliased I18n.t globally as just t(). I don't disagree that this is a good solution, but I don't want to force it on everyone..

Tore

etagwerker commented 13 years ago

Tore,

It could be introduced with a configuration option.

Something like I18n.config.all = true;

or

I18n.config.filtered = true; # If this is set a grep of I18n.t or I18n.translate will be used