3 # Taken from the webwml CVS tree (english/templates/languages.wml)
5 package Packages::I18N::Languages;
12 our @ISA = qw( Exporter );
13 our @EXPORT = qw( langcmp get_transliteration get_selfname );
15 # 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à',
55 zh => '中文',
63 fr => 'français',
65 el => 'Ελληνικά',
69 ja => '日本語',
70 ko => '한국어',
71 lt => 'Lietuvių',
72 "no" => 'norsk (bokmål)',
74 pt_PT => 'Português (pt)',
75 pt_BR => 'Português (br)',
76 ro => 'română',
77 ru => 'Русский',
78 es => 'español',
79 sk => 'slovak', #FIXME
81 sl => 'slovenščina',
82 tr => 'Türkçe',
83 uk => 'ukrainian', #FIXME
86 # language directory name => Latin transliteration of the language name
87 # This is used for language names which consist entirely of non-Latin
88 # characters, to aid those that have browsers which cannot show different
89 # character sets at once.
92 bg => "Bəlgarski",
93 zh => "Zhongzu", # Not printed due to Chinese-specific code; kept for sort order
96 ko => "Hangul", # Not sure. "Hanguk-Mal" (=Spoken Korean)?
100 # second transliteration table, used for languages starting with a latin
107 my ($first, $second) = @_;
109 # Handle sorting of non-latin characters
110 # If there is a transliteration for this language available, use it
111 $first = $translit{$first} if defined $translit{$first};
112 $second = $translit{$second} if defined $translit{$second};
114 # Then handle special cases (initial latin letters with diacritics)
115 $first = $translit2{$first} if defined $translit2{$first};
116 $second = $translit2{$second} if defined $translit2{$second};
118 # Put remaining entity-only names last in the list
119 if (substr($first,0,1) eq '&')
121 $first =~ s/^&/ZZZ&/;
123 if (substr($second,0,1) eq '&')
125 $second =~ s/^&/ZZZ&/;
127 # There seems to be a bug with localization in
128 # Perl 5.005 so we need those extra variables.
129 my ($ufirst, $usecond) = (uc($first), uc($second));
130 return $ufirst cmp $usecond;
134 return $selflang{$_[0]} if exists $selflang{$_[0]};
138 sub get_transliteration {
139 return $translit{$_[0]} if exists $translit{$_[0]};