Karl Gaissmaier > Captive-Portal > Captive::Portal::Role::I18N



Annotate this POD

View/Report Bugs
Module Version: 4.10   Source  


Captive::Portal::Role::I18N - utils for internationalization



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',

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.


Karl Gaissmaier, <gaissmai at cpan.org>


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.

syntax highlighting: