grunt-angular-translate icon indicating copy to clipboard operation
grunt-angular-translate copied to clipboard

Any plans updating this repo?

Open gercheq opened this issue 7 years ago • 3 comments

It's really useful to automate the process of extracting strings from the templates and scripts however this repo has been sitting with issues and open PRs for a long time.

I found out this repo https://github.com/Boulangerie/angular-translate-extract It seems to be more recent but I couldn't be sure since it was not referenced in angular-translate account.

Please advise and let me know if I can help bringing this one up-to-date.

Thanks!

gercheq avatar Feb 14 '18 11:02 gercheq

@firehist @manuelmazzuola @phw @knalli @jtheoof @SKoschnicke @jdahlbom first of all, sorry for mentioning y'all. However, it's getting really tricky to use this grunt task with keys coming from the API. Let's say we have a select list from the API with countries. How can we make sure the translation keys will be extracted? Is it a good idea to setup a test server? is there any better alternative?

gercheq avatar Feb 19 '18 13:02 gercheq

I suggest that you you force the extracter to grab the keys returned by the server. If the server is in node you could enforce this way:

res.send({
   message: /* i18nextract */'my.key.returned.from.server',
   ...
});

Otherwise do something similar to the component displaying that string. If you're doing it client side, I suggest to do this /* i18nextract */ extraction as close to the consumption of that string as possible. This way removal of the component will indeed remove it from your i18n.json file containing the actual translations.

Hope this helps.

jtheoof avatar Feb 19 '18 15:02 jtheoof

Echoing @gercheq, grunt-angular-translate is very useful and has some functionality like the custom regex that other variations of angular-translate extraction tools do not support. However, it depends on such an old version of grunt and grunt-cli that it is using deprecated modules.

In particular: "+ [email protected]

npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue"

Moving to a newer grunt version means grunt-angular-translate can't find it's required dependency on an older grunt:

"npm WARN EPEERINVALID [email protected] requires a peer of grunt@~0.4.0 but none was installed."

cbeiter avatar Aug 13 '18 16:08 cbeiter