NAME
Captive::Portal::Role::I18N - utils for internationalization
ROLES
- $capo->choose_language()
-
Parses the HTTP header 'Accept-Language' and returns an appropriate language from the configured languages or the fallback language in config file.
I18N_LANGUAGES => [ 'en', 'de', ], I18N_FALLBACK_LANG => 'en',
- $capo->gettext($msg_nr)
-
Poor mans gettext. Retrieve i18n system message from message catalog in config file. The default mesage catalog looks like:
I18N_MSG_CATALOG => { msg_001 => { en => 'last session state was:', de => 'Status der letzten Sitzung war:', }, msg_002 => { en => 'username or password is missing', de => 'Username oder Passwort fehlt', }, msg_003 => { en => 'username or password is wrong', de => 'Username oder Passwort ist falsch', }, msg_004 => { en => 'successfull logout', de => 'erfolgreich abgemeldet', }, msg_005 => { en => 'admin_secret is wrong', de => 'Admin-Passwort ist falsch', }, msg_006 => { en => 'Idle-session reestablished due to valid cookie.', de => 'Abgelaufene Sitzung durch gueltiges Cookie erneuert.', }, },
Add your own translation to the conig hash.
AUTHOR
Karl Gaissmaier, <gaissmai at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2010-2013 Karl Gaissmaier, all rights reserved.
This distribution is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Artistic License version 2.0.