gushov / grunt-messageformat

messageformat.js's command line tool ported to a grunt plugin
MIT License
6 stars 4 forks source link

Doesn't Work With Recent MessageFormat Updates #4

Closed iammerrick closed 6 years ago

iammerrick commented 10 years ago

Simply doesn't work anymore. See: https://github.com/SlexAxton/messageformat.js/issues/38

jokeyrhyme commented 10 years ago

Any chance of a pull-request? Is there anything you need help with?

jokeyrhyme commented 10 years ago

I ended up just using grunt-exec to run messageformat CLI directly.

iammerrick commented 10 years ago

That works but requires messageformat be installed globally. (Or referenced relatively.) I really want npm to implement bundle exec style functionality.

jokeyrhyme commented 10 years ago

Yeah, I installed messageformat locally (yuck, I know).

My grunt-exec configuration looks like:

exec: {
  messageformat: {
    cmd: 'node_modules/messageformat/bin/messageformat.js -l en js/locales/en js/locales/en/i18n.js'
  }
},

Kinda' terrible, but it works for me for now. I agree, about npm exec, that would be awesome:

alex-dow commented 9 years ago

this project seems dead unfortunately. I have started a new one at https://github.com/alex-dow/grunt-messageformat-compiler

jokeyrhyme commented 9 years ago

Has anyone already looked at either of the following libraries as a replacement for this project?

How do they compare to this project? Which of these is the easiest to migrate to?

If no-one has any experience with these, I'll try to do a comparison myself in the next few weeks and see how it goes.

alex-dow commented 9 years ago

While I'm not aware of any formal comparisons to any of these projects, I can explain my rationale for wanting to stick close to MessageFormat:

i18next has a translation UI, a nice JSON structure, including support for multiline strings that are stored in arrays. Unfortunately, i18next does not use the ICU standard syntax. Since my webapp will also have a backend component to it written in Java and using ICU4J, I'd rather stick with the more common standard.

FormatJS is robust, has direct integrations with some popular frameworks, and does use MessageFormat and thus uses ICU standards. However, it relies on the http://www.ecma-international.org/ecma-402/1.0/index.html. Only IE11 fully supports this standard. Polyfills exist, but I'd prefer to avoid using them when possible.

Globalize has dependency overhead. This is something I appreciate about MessageFormat. It compiles your string resource files into small snippets of javascript that have no dependencies on anything at all. This makes integration into existing code painless, and has the least amount of overhead.

These are just my opinions really, and I have not done extensive research into any of those tools. But I still find that MessageFormat provides client-side localization with the lowest footprint and widest browser support (without resorting to polyfills).

jokeyrhyme commented 9 years ago

@alex-dow great points, very useful. Thanks.