gadicc / meteor-messageformat

MessageFormat i18n support for Meteor, with reactive templates
54 stars 22 forks source link

Smart package support incomplete #51

Open gadicc opened 10 years ago

gadicc commented 10 years ago

Currently, if you create packages in your app, there is no problem to translate them from inside the app. What's not clear is how a package author (who need translatable templates), can best include his/her translations in the package itself. Currently, there is no clear distinction between package translations and app translations... ideally the former should not appear in the /translate page or in the translatable collection.

Ref : https://github.com/gadicc/meteor-messageformat/issues/8#issuecomment-51309681

grigio commented 10 years ago

@gadicc thanks for the reply. Yes, "app level" strings works at "package level", but is possible to use mf_extract.js to add strings also from projRoot + '/packages/my_custom_package/* ?

gadicc commented 10 years ago

If I'm not mistaken (correct me if you find otherwise), this should work without a problem. But as discussed, it gets added at an app level.

grigio commented 10 years ago

Currently strings in ./packages/custom_pkg aren't added. It seems to be fixed editing https://github.com/gadicc/meteor-messageformat/blob/master/cli/mf_extract.js

from:

var walker  = walk.walk('.', {
    followLinks: false,
    filters: ["packages"]
});

to:

var walker  = walk.walk('.', {
    followLinks: false
});

Would you accept a patch?

gadicc commented 10 years ago

Sorry, my bad. You reminded me now that we intentionally skip the package dir because of https://github.com/gadicc/meteor-messageformat/issues/21. This needs to be sorted out properly, so hold off with the patch and we'll try get a proper solution for this out soon.