zombor / KOstache

Logic-less View/Mustache Module for Kohana v3
MIT License
138 stars 43 forks source link

I added the i18n support. #43

Open taai opened 12 years ago

taai commented 12 years ago

Normally you can translate the text inside your View_Something class and include that text in your template by using variables. But I find it useful to write the text right in the template and translate it from there. Otherways there are too many variables that actually doesn't get used anywhere else.

An example of how to translate the text in templates:

<div>{{#i18n}}Email{{/i18n}}</div>
taai commented 12 years ago

Probably could use {{#__}}Email{{/__}} syntax, like normaly used __('Email'), but I don't know...

zombor commented 12 years ago

I don't think this is a good addition for the core repo. If someone needs translation, it's trivial to add this lambda function to your base view class.

taai commented 12 years ago

It's ok. I just tought it would be useful for others, who were used to default Kohana's templates. :)