| MySQL-Admin documentation | Contained in the MySQL-Admin distribution. |
MySQL::Admin::Translate - Translations for MySQL::Admin.
use MySQL::Admin::Translate;
use vars qw($lang);
loadTranslate("/srv/www/cgi-bin/config/translate.pl");
*lang = \$MySQL::Admin::Translate::lang;
print $lang->{de}{firstname}; #'Vorname'
Translations for MySQL::Admin.
loadTranslate() saveTranslate() $lang
CGI MySQL::Admin MySQL::Admin::Actions MySQL::Admin::Translate MySQL::Admin::Settings MySQL::Admin::Config
Dirk Lindner <lze@cpan.org>
Copyright (C) 2009 by Hr. Dirk Lindner
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
| MySQL-Admin documentation | Contained in the MySQL-Admin distribution. |
package MySQL::Admin::Translate; use strict; use warnings; require Exporter; use vars qw($ACCEPT_LANGUAGE $lang $DefaultClass @EXPORT @ISA $defaultconfig); @MySQL::Admin::Translate::EXPORT = qw(loadTranslate saveTranslate $lang); use MySQL::Admin::Config; @ISA = qw(Exporter MySQL::Admin::Config); $MySQL::Admin::Translate::VERSION = '0.62'; $DefaultClass = 'MySQL::Admin::Translate' unless defined $MySQL::Admin::Translate::DefaultClass; $defaultconfig = '%CONFIG%';
sub new { my ($class, @initializer) = @_; my $self = {}; bless $self, ref $class || $class || $DefaultClass; return $self; }
sub loadTranslate { my ($self, @p) = getSelf(@_); my $do = (defined $p[0]) ? $p[0] : $defaultconfig; if (-e $do) {do $do;} }
sub saveTranslate { my ($self, @p) = getSelf(@_); my $l = defined $p[0] ? $p[0] : $defaultconfig; $self->SUPER::saveConfig($l, $lang, 'lang'); }
sub getSelf { return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Translate'); return (defined($_[0]) && (ref($_[0]) eq 'MySQL::Admin::Translate' || UNIVERSAL::isa($_[0], 'MySQL::Admin::Translate'))) ? @_ : ($MySQL::Admin::Translate::DefaultClass->new, @_); }
1;