~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to config/cfgroot/lang.pl

  • Committer: Dirk Wagner
  • Date: 2014-12-23 08:02:23 UTC
  • mfrom: (4405.56.108)
  • Revision ID: git-v1:601f8347ccb1e9c5e3f250ff26d4097ecd698875
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into asterisk-update

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
# (it is a developper options)
51
51
#
52
52
sub reload {
 
53
    my $LG = &FindWebLanguage(shift);
53
54
 
54
 
    my ($LG) = @_;
55
55
    %Lang::tr = ();     # start with a clean array
56
56
 
57
57
    # Use CacheLang if present & not empty.
157
157
    &General::log ("WARNING: cannot build cachelang file for [$missed].") if ($error);
158
158
    return $error;
159
159
}
 
160
 
 
161
sub FindWebLanguage() {
 
162
        my $lang = shift;
 
163
 
 
164
        my @options = ($lang);
 
165
 
 
166
        my ($shortlang, $encoding) = split(/\./, $lang);
 
167
        push(@options, $shortlang);
 
168
 
 
169
        my ($language, $country) = split(/_/, $shortlang);
 
170
        push(@options, $language);
 
171
 
 
172
        foreach my $option (@options) {
 
173
                return $option if (-e "${General::swroot}/langs/$option.pl");
 
174
        }
 
175
 
 
176
        return undef;
 
177
}
 
178
 
160
179
1;