line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Admin::Translate; |
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
42
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
35
|
|
4
|
2
|
|
|
2
|
|
6
|
use utf8; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
2
|
|
|
2
|
|
46
|
use vars qw($ACCEPT_LANGUAGE $lang $DefaultClass @EXPORT @ISA $defaultconfig); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
140
|
|
7
|
|
|
|
|
|
|
@MySQL::Admin::Translate::EXPORT = qw(loadTranslate saveTranslate $lang); |
8
|
2
|
|
|
2
|
|
7
|
use MySQL::Admin::Config; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
670
|
|
9
|
|
|
|
|
|
|
@ISA = qw(Exporter MySQL::Admin::Config); |
10
|
|
|
|
|
|
|
$MySQL::Admin::Translate::VERSION = '1.1'; |
11
|
|
|
|
|
|
|
$DefaultClass = 'MySQL::Admin::Translate' unless defined $MySQL::Admin::Translate::DefaultClass; |
12
|
|
|
|
|
|
|
$defaultconfig = '%CONFIG%'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
MySQL::Admin::Translate - Translations for MySQL::Admin. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use MySQL::Admin::Translate; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use vars qw($lang); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
loadTranslate("/srv/www/cgi-bin/config/translate.pl"); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
*lang = \$MySQL::Admin::Translate::lang; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
print $lang->{de}{firstname}; #'Vorname' |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Translations for MySQL::Admin. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 EXPORT |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
loadTranslate() saveTranslate() $lang |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 Public |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 new() |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
45
|
2
|
|
|
2
|
1
|
5
|
my ($class, @initializer) = @_; |
46
|
2
|
|
|
|
|
2
|
my $self = {}; |
47
|
2
|
|
33
|
|
|
13
|
bless $self, ref $class || $class || $DefaultClass; |
48
|
2
|
|
|
|
|
9
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 loadTranslate() |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub loadTranslate { |
56
|
2
|
|
|
2
|
1
|
9
|
my ($self, @p) = getSelf(@_); |
57
|
2
|
50
|
|
|
|
8
|
my $do = (defined $p[0]) ? $p[0] : $defaultconfig; |
58
|
2
|
50
|
|
|
|
25
|
if (-e $do) { do $do; } |
|
0
|
|
|
|
|
0
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 saveTranslate() |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub saveTranslate { |
66
|
0
|
|
|
0
|
1
|
0
|
my ($self, @p) = getSelf(@_); |
67
|
0
|
0
|
|
|
|
0
|
my $l = defined $p[0] ? $p[0] : $defaultconfig; |
68
|
0
|
|
|
|
|
0
|
$self->SUPER::saveConfig($l, $lang, 'lang'); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 Private |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 getSelf() |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub getSelf { |
78
|
2
|
0
|
33
|
2
|
1
|
8
|
return @_ if defined($_[0]) && (!ref($_[0])) && ($_[0] eq 'MySQL::Admin::Translate'); |
|
|
|
33
|
|
|
|
|
79
|
|
|
|
|
|
|
return ( |
80
|
2
|
50
|
33
|
|
|
18
|
defined($_[0]) |
81
|
|
|
|
|
|
|
&& (ref($_[0]) eq 'MySQL::Admin::Translate' |
82
|
|
|
|
|
|
|
|| UNIVERSAL::isa($_[0], 'MySQL::Admin::Translate')) |
83
|
|
|
|
|
|
|
) |
84
|
|
|
|
|
|
|
? @_ |
85
|
|
|
|
|
|
|
: ($MySQL::Admin::Translate::DefaultClass->new, @_); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 see Also |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L L L L L L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Dirk Lindner |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Copyright (C) 2015 by Hr. Dirk Lindner |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
101
|
|
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public License |
102
|
|
|
|
|
|
|
as published by the Free Software Foundation; |
103
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
104
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
105
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
106
|
|
|
|
|
|
|
GNU Lesser General Public License for more details. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=cut |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |