Hi, Just from the plugin documentation you wont get any web "user" translations. Just for the system wide language. it would be fine if the example of "Sending messages to the user" had something like this: <% FOR message IN messages %> <div class="alert alert-<% message.bootstrap_color %>"> <% message.toString(session.user_lang) | html_entity %> </div> <% END %> This works really fine for end user localization. A awesome plugin evolution would be not to check de "locale" but a session lang or from "accept-language" header :-) Paulo 2016-03-03 9:25 GMT+00:00 Andrew Beverley <andy@andybev.com>:
On Thu, 2016-03-03 at 08:58 +0000, Zahir Lalani wrote:
Can i get some ideas of how people are handling internationalisation within a dancer framework?
With Dancer2::Plugin::LogReport
It will integrate all your logging, user messages, exceptions and translations. It is very flexible and powerful.
I did a talk about it at the Dancer conference. The talk isn't great (I repeated it at LPW, but simplified and without the translations), but the slides are here. Have a look at slide 15 onwards:
http://files.andybev.com/log-report-dancerconf.odp
It's a steep learning curve, but that's because it's so powerful. Stick it out, and you will be rewarded. You may get up and running quicker with other approaches, but you will likely have headaches and/or limitations later on.
I did an introduction to the module, but without the translations. I'll write up translations later:
https://github.com/abeverley/advent-calendar/blob/master/2015/9-easy-excepti...
I'm the author of the module, and very happy to answer questions and help out.
Andy
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users