SlexAxton / require-handlebars-plugin

A plugin for handlebars in require.js (both in dev and build)
804 stars 202 forks source link

Allow use of format in i18n #43

Open achur opened 12 years ago

achur commented 12 years ago

js format works as follows:

"{0} started following {1}".format("achur", "require-handlebars-plugin")

outputs

"achur started following require-handlebars-plugin"

It would be awesome if we could do something like

{{$ "following-format" "achur" "require-handlebars-plugin"}}

which would localize the string with the two parameters.

SlexAxton commented 12 years ago

I have a repo for this. Messageformat.js will have a plugin to this with precompilation soon. I wrote it but it needs tests and some bug fixes. Its super cool though.

achur commented 12 years ago

Awesome, looking forward to it.

SlexAxton commented 11 years ago

I'm working on a generic way to give this to people, but just as an update, I have a public project that is using the general idea of what I want to do with messageformat.js being used as an additional compilation step.

https://github.com/jedtoolkit/messageform.at/blob/master/dev/js/hbs/i18nprecompile.js