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 => ISO 639 two-letter code for the language name
49 # language directory name => native name of the language
50 # non-ASCII letters must be escaped (using entities)!
52 ar => 'عربية',
53 bg => 'Български',
54 ca => 'català',
58 el => 'Ελληνικά',
61 es => 'español',
62 fa => 'فارسی',
64 fr => 'français',
67 hy => 'Հայերեն',
70 ja => '日本語',
72 ko => '한국어',
73 lt => 'Lietuvių',
75 "no" => 'norsk (bokmål)',
77 pt => 'Português (pt)',
78 'pt-pt'=> 'Português (pt)',
79 'pt-br'=> 'Português (br)',
80 ro => 'română',
81 ru => 'Русский',
85 sl => 'slovenščina',
86 tr => 'Türkçe',
87 uk => 'українська',
88 zh => '中文',
89 'zh-cn'=> '中文',
90 'zh-hk'=> '正體中文',
91 'zh-tw'=> '中文',
94 # language directory name => Latin transliteration of the language name
95 # This is used for language names which consist entirely of non-Latin
96 # characters, to aid those that have browsers which cannot show different
97 # character sets at once.
100 bg => "Bəlgarski",
105 ko => "Hangul", # Not sure. "Hanguk-Mal" (=Spoken Korean)?
109 'zh-cn'=> "Zhongwen,简",
110 'zh-hk'=> "Zhongwen,HK",
111 'zh-tw'=> "Zhongwen,繁",
114 # second transliteration table, used for languages starting with a latin
121 my ($first, $second) = @_;
123 # Handle sorting of non-latin characters
124 # If there is a transliteration for this language available, use it
125 $first = $translit{$first} if defined $translit{$first};
126 $second = $translit{$second} if defined $translit{$second};
128 # Then handle special cases (initial latin letters with diacritics)
129 $first = $translit2{$first} if defined $translit2{$first};
130 $second = $translit2{$second} if defined $translit2{$second};
132 # Put remaining entity-only names last in the list
133 if (substr($first,0,1) eq '&')
135 $first =~ s/^&/ZZZ&/;
137 if (substr($second,0,1) eq '&')
139 $second =~ s/^&/ZZZ&/;
141 # There seems to be a bug with localization in
142 # Perl 5.005 so we need those extra variables.
143 my ($ufirst, $usecond) = (uc($first), uc($second));
144 return $ufirst cmp $usecond;
148 return $selflang{$_[0]} if exists $selflang{$_[0]};
152 sub get_transliteration {
153 return $translit{$_[0]} if exists $translit{$_[0]};