Munter / grunt-reduce

A grunt kitchen that reduces your web ingredients down to their essence for optimal serving. Bon appétit!
MIT License
184 stars 13 forks source link

Added support for internationalization #13

Closed gausby closed 10 years ago

gausby commented 10 years ago

Add locales: 'en,da' to the grunt reduce configuration. This will make asset graph build an english and danish version. Read the section about internationalization in the asset graph builder documentation for more info.

papandreou commented 10 years ago

I'm glad people are using that :)

papandreou commented 10 years ago

@gausby Are you using express-negotiator to serve the localized html in production?

gausby commented 10 years ago

At the time being I'm just researching the possibility to localise an application I'm about to build for a client, so I haven't thought about how to serve the end product.

gausby commented 10 years ago

Looks cool though. I am definitely going to check it out!

papandreou commented 10 years ago

It also works with Apache's mod_negotiation and NGINX's try_files directive. Basically anything that'll look at the Accept-Language header and pick the best match among a set of files on disc named foo.<localeId>.html. In addition to that, express-negotiator supports a language cookie that takes precedence over Accept-Language.

At One.com we use AssetGraph-builder's i18n features for localizing 4 major knockout.js web apps and an Ext.js one, and even some standalone web pages. The only thing about it I'd urgently like to change is the buildDevelopment requirement when when the translations need to work in the development setup.

Let me know if you need any assistance.

Munter commented 10 years ago

I forgot all about this one. I'll merge it in, but make a change so the locales is an array of strings instead of a comma separated string that has to be split. I think verbosity will actually be more helpful to avoid configuration errors

Munter commented 10 years ago

Published in grunt-reduce v0.2.0