1 # Taken from the webwml CVS tree (english/templates/languages.wml)
3 package Packages::I18N::Languages;
10 our @ISA = qw( Exporter );
11 our @EXPORT = qw( langcmp get_transliteration get_selfname );
13 # language directory name => native name of the language
14 # non-ASCII letters must be escaped (using entities)!
16 ar => 'عربية',
17 bg => 'Български',
18 ca => 'català',
22 el => 'Ελληνικά',
25 es => 'español',
26 fa => 'فارسی',
28 fr => 'français',
31 hy => 'Հայերեն',
34 ja => '日本語',
36 ko => '한국어',
37 lt => 'Lietuvių',
39 "no" => 'norsk (bokmål)',
41 pt => 'Português (pt)',
42 'pt-pt'=> 'Português (pt)',
43 'pt-br'=> 'Português (br)',
44 ro => 'română',
45 ru => 'Русский',
49 sl => 'slovenščina',
50 tr => 'Türkçe',
51 uk => 'українська',
52 zh => '中文',
53 'zh-cn'=> '中文',
54 'zh-hk'=> '正體中文',
55 'zh-tw'=> '中文',
58 # language directory name => Latin transliteration of the language name
59 # This is used for language names which consist entirely of non-Latin
60 # characters, to aid those that have browsers which cannot show different
61 # character sets at once.
64 bg => "Bəlgarski",
69 ko => "Hangul", # Not sure. "Hanguk-Mal" (=Spoken Korean)?
73 'zh-cn'=> "Zhongwen,简",
74 'zh-hk'=> "Zhongwen,HK",
75 'zh-tw'=> "Zhongwen,繁",
78 # second transliteration table, used for languages starting with a latin
85 my ($first, $second) = @_;
87 # Handle sorting of non-latin characters
88 # If there is a transliteration for this language available, use it
89 $first = $translit{$first} if defined $translit{$first};
90 $second = $translit{$second} if defined $translit{$second};
92 # Then handle special cases (initial latin letters with diacritics)
93 $first = $translit2{$first} if defined $translit2{$first};
94 $second = $translit2{$second} if defined $translit2{$second};
96 # Put remaining entity-only names last in the list
97 if (substr($first,0,1) eq '&')
101 if (substr($second,0,1) eq '&')
103 $second =~ s/^&/ZZZ&/;
105 # There seems to be a bug with localization in
106 # Perl 5.005 so we need those extra variables.
107 my ($ufirst, $usecond) = (uc($first), uc($second));
108 return $ufirst cmp $usecond;
112 return $selflang{$_[0]} if exists $selflang{$_[0]};
116 sub get_transliteration {
117 return $translit{$_[0]} if exists $translit{$_[0]};