{ my %languages = ( 'sv' => 'swedish.pl', 'no' => 'norwegian.pl', 'nb' => 'norwegian.pl', # Add more languages here 'en' => 'NONE', ); if (defined $ENV{'HTTP_ACCEPT_LANGUAGE'}) { my $language = ''; LANGUAGE: foreach $token (split /,/, $ENV{'HTTP_ACCEPT_LANGUAGE'}) { my ($lang, undef) = split /;/, $token, 2; if ($lang =~ /^([a-z][a-z])/i) { my $l = lc($1); if (defined $languages{$l}) { $language = $languages{$l}; last LANGUAGE; } } } if ($language ne '') { do $language unless $language eq 'NONE'; } } }
Search for CategoryTranslation to find current UseMod translations.