_i18n.pm 8.63 KB
Newer Older
1
2
3
4
5
## @file
# Messages translation for Lemonldap::NG::Manager

## @class
# Messages translation for Lemonldap::NG::Manager.
Yadd's avatar
Yadd committed
6
7
package Lemonldap::NG::Manager::_i18n;

Yadd's avatar
Yadd committed
8
9
# Developer warning : this file must be utf8 encoded

Yadd's avatar
Yadd committed
10
use strict;
Yadd's avatar
Yadd committed
11
use AutoLoader qw(AUTOLOAD);
Yadd's avatar
Yadd committed
12
our $VERSION = '0.5';
Yadd's avatar
Yadd committed
13

Yadd's avatar
Yadd committed
14
15
16
17
18
## @method string translate(string text,string lang)
# Returns $text translated in $lang.
#@param $text textId
#@param $lang Optional language string. If not set, uses Accept-Language
# HTTP header.
Yadd's avatar
Yadd committed
19
20
21
22
sub translate {
    my ( $self, $text, $lang ) = @_;
    return $text unless ( $text =~ /[a-z]/ );
    $lang ||= $ENV{HTTP_ACCEPT_LANGUAGE};
Yadd's avatar
Yadd committed
23
24
    $lang = lc($lang);
    $lang =~ s/-/_/g;
Yadd's avatar
Yadd committed
25
    foreach ( split( /[,;]/, $lang ), 'en' ) {
Yadd's avatar
Yadd committed
26
        next if /=/;
Yadd's avatar
Yadd committed
27
        if ( __PACKAGE__->can($_) ) {
Yadd's avatar
Yadd committed
28
29
30
31
32
33
34
35
36
            no strict 'refs';
            my $r = &$_()->{$text};
            if ($r) {
                return $r;
            }
            else {
                print STDERR __PACKAGE__ . ": $text not translated in $_\n";
                return $text;
            }
Yadd's avatar
Yadd committed
37
        }
Yadd's avatar
Yadd committed
38
39
40
41
42
43
44
    }
}

*fr_fr = *fr;
*en_us = *en;

1;
Yadd's avatar
Yadd committed
45

Clément OUDOT's avatar
Clément OUDOT committed
46
__END__
47

Yadd's avatar
Yadd committed
48
49
sub en {
    return {
Yadd's avatar
Yadd committed
50
51
52
        advancedParams             => 'Advanced parameters',
        authentication             => 'Authentication module',
        authParams                 => 'Authentication parameters',
53
        clickHereToForce           => 'Click here to force',
Yadd's avatar
Yadd committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
        Configuration              => 'Configuration',
        confSaved                  => 'Configuration saved',
        confWasChanged             => 'Configuration has been changed',
        cookieExpiration           => 'Cookie expiration time',
        cookieName                 => 'Cookie Name',
        cookieParams               => 'Cookies Parameters',
        databaseLocked             => 'Database locked by another process',
        domain                     => 'Domain',
        exportedAttr               => 'SOAP exported attributes',
        exportedVars               => 'Exported Variables',
        generalParameters          => 'General Parameters',
        globalStorage              => 'Apache::Session module',
        globalStorageOptions       => 'Apache::Session module parameters',
        groups                     => 'Groups',
        headers                    => 'HTTP Headers',
        https                      => 'Default value for https parameter',
        ldapBase                   => 'LDAP Search Base',
        ldapParams                 => 'LDAP parameters',
        ldapPort                   => 'LDAP Server Port',
        ldapServer                 => 'LDAP Server',
74
        logParams                  => 'Logs parameters',
Yadd's avatar
Yadd committed
75
        macros                     => 'Macros',
Yadd's avatar
Yadd committed
76
        mailBody                   => 'Mail content',
Yadd's avatar
Yadd committed
77
        mailFrom                   => 'Mail sender',
Yadd's avatar
Yadd committed
78
        mailSubject                => 'Mail subject',
Yadd's avatar
Yadd committed
79
80
81
        managerDn                  => 'LDAP Account',
        managerPassword            => 'LDAP Password',
        notification               => 'Active notifications',
Yadd's avatar
Yadd committed
82
        notifications              => 'Notifications',
Yadd's avatar
Yadd committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
        notificationStorage        => 'Notifications storage type',
        notificationStorageOptions => 'Storage module parameters',
        passwordDB                 => 'Passaword database type',
        passwordManagement         => 'Password management',
        portal                     => 'Portal',
        randomPasswordRegexp       => 'Regexp for password generation',
        rules                      => 'Rules',
        securedCookie              => 'Secured Cookie (SSL)',
        sessionParams              => 'Sessions Parameters',
        sessionStorage             => 'Sessions Storage',
        singleIP                   => 'One IP only by user',
        singleSession              => 'One session only by user',
        singleUserByIP             => 'One user by IP address',
        SMTPServer                 => 'SMTP server',
        Soap                       => 'Activate portal SOAP functions',
        storePassword              => 'Store user password in session datas',
        syntaxError                => 'Syntax Error',
        syslog                     => 'Syslog facility',
        timeout                    => 'Sessions timeout',
        trustedDomains             => 'Trusted domains',
        unknownError               => 'Unknown error',
        uploadDenied               => 'Upload denied',
        userDB                     => 'Users database type',
        userControl                => 'Username control',
Yadd's avatar
Yadd committed
107
        useXForwardedForIP         => "Use X-Forwarded-For header address",
Yadd's avatar
Yadd committed
108
109
        virtualHosts               => 'Virtual Hosts',
        whatToTrace                => "Attribute to use in Apache's logs",
Yadd's avatar
Yadd committed
110
111
112
113
114
    };
}

sub fr {
    return {
115
116
117
        advancedParams             => 'Paramètres avancés',
        authentication             => "Module d'authentification",
        authParams                 => "Paramètres d'authentification",
118
        clickHereToForce           => 'Clicker ici pour forcer',
119
120
121
122
123
124
125
126
127
128
        Configuration              => 'Configuration',
        confSaved                  => 'Configuration sauvegardée',
        confWasChanged             => 'Configuration modifiée entre-temps',
        cookieExpiration           => 'Durée de vie du cookie',
        cookieName                 => 'Nom du cookie',
        cookieParams               => 'Paramètres des cookies',
        databaseLocked             => 'Base de donnée verrouillée par un autre processus',
        domain                     => 'Domaine',
        exportedAttr               => 'Attribut exportés par le portail (SOAP)',
        exportedVars               => 'Attributs LDAP à exporter',
Yadd's avatar
Yadd committed
129
130
131
132
133
134
135
136
137
138
        generalParameters          => 'Paramètres généraux',
        globalStorage              => 'Module Apache::Session',
        globalStorageOptions       => 'Paramètres du module Apache::Session',
        groups                     => 'Groupes',
        headers                    => 'En-têtes HTTP',
        https                      => 'Valeur par défaut du paramètre https',
        ldapBase                   => 'Base de recherche LDAP',
        ldapParams                 => 'Paramètres LDAP',
        ldapPort                   => 'Port du serveur LDAP',
        ldapServer                 => 'Serveur LDAP',
139
        logParams                  => 'Paramètres de journalisation',
Yadd's avatar
Yadd committed
140
141
142
        macros                     => 'Macros',
        mailBody                   => 'Contenu du message',
        mailFrom                   => 'Expéditeur du message',
Yadd's avatar
Yadd committed
143
        mailSubject                => 'Sujet du message',
Yadd's avatar
Yadd committed
144
145
146
        managerDn                  => 'Compte de connexion LDAP',
        managerPassword            => 'Mot de passe LDAP',
        notification               => 'Active les notifications',
Yadd's avatar
Yadd committed
147
        notifications              => 'Notifications',
Yadd's avatar
Yadd committed
148
149
        notificationStorage        => 'Type de stockage des notifications',
        notificationStorageOptions => 'Paramètres du module de stockage',
150
151
152
        passwordDB                 => 'Type de base de données des mots-de-passe',
        passwordManagement         => 'Gestion des mots-de-passe',
        portal                     => 'Portail',
Yadd's avatar
Yadd committed
153
154
        randomPasswordRegexp =>
          'Expression regulière pour la génération des mots-de-passe',
155
156
157
158
159
160
161
162
163
        rules                      => 'Règles',
        securedCookie              => 'Cookie sécurisé (SSL)',
        sessionParams              => 'Paramètres des Sessions Parameters',
        sessionStorage             => 'Stockage des sessions',
        singleIP                   => 'Une seule IP par utilisateur',
        singleSession              => 'Une seule session par utilisateur',
        singleUserByIP             => 'Une seule adresse IP par utilisateur',
        SMTPServer                 => 'Serveur SMTP',
        Soap                       => 'Active les fonctions SOAP du portail',
Yadd's avatar
Yadd committed
164
165
        storePassword =>
"Stocke le mot-de-passe de l'utilisateur dans les données de session",
166
167
168
169
170
171
172
173
        syntaxError                => 'Erreur de syntaxe',
        syslog                     => 'Facilité syslog',
        timeout                    => 'Durée de vie des sessions',
        trustedDomains             => 'Domaines appouvés',
        unknownError               => 'Erreur nconnue',
        uploadDenied               => 'Téléchargement refusé',
        userDB                     => "Type de base de données d'utilisateurs",
        userControl                => "Contrôle du nom d'utilisateur",
Yadd's avatar
Yadd committed
174
175
        useXForwardedForIP =>
          "Utiliser l'adresse IP de l'en-tête X-Forwarded-For",
176
177
        virtualHosts               => 'Hôtes virtuels',
        whatToTrace                => "Donnée à inscrire dans les journaux d'Apache",
Yadd's avatar
Yadd committed
178
179
180
    };
}