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 => '日本語',
71 ko => '한국어',
72 lt => 'Lietuvių',
74 "no" => 'norsk (bokmål)',
76 pt => 'Português (pt)',
77 pt_PT => 'Português (pt)',
78 pt_BR => 'Português (br)',
79 ro => 'română',
80 ru => 'Русский',
84 sl => 'slovenščina',
85 tr => 'Türkçe',
86 uk => 'українська',
87 zh => '中文',
88 zh_CN => '簡體中文',
89 zh_HK => '正體中文',
90 zh_TW => '正體中文',
93 # language directory name => Latin transliteration of the language name
94 # This is used for language names which consist entirely of non-Latin
95 # characters, to aid those that have browsers which cannot show different
96 # character sets at once.
99 bg => "Bəlgarski",
104 ko => "Hangul", # Not sure. "Hanguk-Mal" (=Spoken Korean)?
107 zh => "Zhongzu", # Not printed due to Chinese-specific code; kept for sort order
108 zh_CN => "Simplified Chinese",
109 zh_HK => "Traditional Chinese",
110 zh_TW => "Traditional Chinese",
113 # second transliteration table, used for languages starting with a latin
120 my ($first, $second) = @_;
122 # Handle sorting of non-latin characters
123 # If there is a transliteration for this language available, use it
124 $first = $translit{$first} if defined $translit{$first};
125 $second = $translit{$second} if defined $translit{$second};
127 # Then handle special cases (initial latin letters with diacritics)
128 $first = $translit2{$first} if defined $translit2{$first};
129 $second = $translit2{$second} if defined $translit2{$second};
131 # Put remaining entity-only names last in the list
132 if (substr($first,0,1) eq '&')
134 $first =~ s/^&/ZZZ&/;
136 if (substr($second,0,1) eq '&')
138 $second =~ s/^&/ZZZ&/;
140 # There seems to be a bug with localization in
141 # Perl 5.005 so we need those extra variables.
142 my ($ufirst, $usecond) = (uc($first), uc($second));
143 return $ufirst cmp $usecond;
147 return $selflang{$_[0]} if exists $selflang{$_[0]};
151 sub get_transliteration {
152 return $translit{$_[0]} if exists $translit{$_[0]};