jeresig / i18n-node-2

Lightweight simple translation module for node.js / express.js with dynamic json storage. Uses common __('...') syntax in app and templates.
MIT License
507 stars 79 forks source link

The swig example is a mislead, as its not possible to have that syntax #3

Closed kaareal closed 11 years ago

kaareal commented 11 years ago

As far as I can tell from http://paularmstrong.github.com/swig/ The closet thing is a create a custom tag {% __ Hello world %} the syntax would be something like that. Not as elegant.

Is the code example {{ __("Welcome to:") }} {{ title }} just meant as some pseudo code ?

or do you got some super awesome code that would make the code example work?

okovalov commented 11 years ago

Same problem. As an output I got simple {} - that's it. It does not work for swig

jeresig commented 11 years ago

I'm using it with swig with that syntax by registering the methods as dynamic helpers - let me know if it isn't working for you, for some reason: https://github.com/jeresig/i18n-node-2/blob/master/i18n.js#L80