Lines 119-125
Returns a reference to an array of hashes:
Link Here
|
119 |
sub getTranslatedLanguages { |
119 |
sub getTranslatedLanguages { |
120 |
my ($interface, $theme, $current_language, $which) = @_; |
120 |
my ($interface, $theme, $current_language, $which) = @_; |
121 |
my $htdocs; |
121 |
my $htdocs; |
122 |
my $all_languages = getAllLanguages(); |
|
|
123 |
my @languages; |
122 |
my @languages; |
124 |
my @enabled_languages; |
123 |
my @enabled_languages; |
125 |
|
124 |
|
Lines 161-167
sub getTranslatedLanguages {
Link Here
|
161 |
$seen{$_}++ for @languages; |
160 |
$seen{$_}++ for @languages; |
162 |
@languages = keys %seen; |
161 |
@languages = keys %seen; |
163 |
} |
162 |
} |
164 |
return _build_languages_arrayref($all_languages,\@languages,$current_language,\@enabled_languages); |
163 |
return _build_languages_arrayref(\@languages,$current_language,\@enabled_languages); |
165 |
} |
164 |
} |
166 |
|
165 |
|
167 |
=head2 getAllLanguages |
166 |
=head2 getAllLanguages |
Lines 276-282
FIXME: this could be rewritten and simplified using map
Link Here
|
276 |
=cut |
275 |
=cut |
277 |
|
276 |
|
278 |
sub _build_languages_arrayref { |
277 |
sub _build_languages_arrayref { |
279 |
my ($all_languages,$translated_languages,$current_language,$enabled_languages) = @_; |
278 |
my ($translated_languages,$current_language,$enabled_languages) = @_; |
280 |
my @translated_languages = @$translated_languages; |
279 |
my @translated_languages = @$translated_languages; |
281 |
my @languages_loop; # the final reference to an array of hashrefs |
280 |
my @languages_loop; # the final reference to an array of hashrefs |
282 |
my @enabled_languages = @$enabled_languages; |
281 |
my @enabled_languages = @$enabled_languages; |
283 |
- |
|
|