Localization plugin
Sun, 01 Nov 2009
, modified Sun, 01 Nov 2009
New i18n plugin translates strings,
localizes time and adds template helper for translating your own strings.
Configuration is as easy as usual (e.g.
ru locale):
"plugins" : [
"i18n", {"languages" : "ru_RU.UTF-8", "helper" : "loc"}
]
Use loc helper in templates:
<%= loc('My string to be translated') %>
Helper name is configurable (thanks Sebastian Riedel for a good advice):
<%=l 'My string to be translated' %>
or even
<%=_ 'My string to be translated' %>
To create a new localization use Bootylicious::I18N::ru as an example. Plugin requires MojoX::Locale::Maketext.