1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/LanguageCode.cc
15 #include "zypp/base/Logger.h"
16 #include "zypp/base/String.h"
17 #include "zypp/base/Gettext.h"
19 #include "zypp/LanguageCode.h"
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////
29 { /////////////////////////////////////////////////////////////////
31 /** Wrap static codemap data. */
32 struct CodeMaps // singleton
34 typedef std::map<std::string,std::string> CodeMap;
35 typedef CodeMap::const_iterator Index;
37 /** Return the CodeMap Index for \a code_r. */
38 static Index getIndex( const std::string & code_r )
40 static CodeMaps _maps; // the singleton instance
41 return _maps.lookup( code_r );
45 /** Ctor initializes the code maps.
46 * http://www.loc.gov/standards/iso639-2/ISO-639-2_values_8bits.txt
50 /** Make shure the code is in the code maps and return it's index. */
51 inline Index lookup( const std::string & code_r );
53 /** Return index of \a code_r, if it's in the code maps. */
54 inline Index lookupCode( const std::string & code_r );
57 /** Two letter codes. */
59 /** Three letter codes. */
61 /** All the stuff the application injects. */
65 inline CodeMaps::Index CodeMaps::lookupCode( const std::string & code_r )
67 switch ( code_r.size() )
71 Index it = iso639_1.find( code_r );
72 if ( it != iso639_1.end() )
79 Index it = iso639_2.find( code_r );
80 if ( it != iso639_2.end() )
85 // not found: check others
86 // !!! not found at all returns others.end()
87 return others.find( code_r );
90 inline CodeMaps::Index CodeMaps::lookup( const std::string & code_r )
92 Index it = lookupCode( code_r );
93 if ( it != others.end() )
96 // not found: Remember a new code
97 CodeMap::value_type nval( code_r, std::string() );
99 if ( code_r.size() > 3 || code_r.size() < 2 )
100 WAR << "Malformed LanguageCode '" << code_r << "' (expect 2 or 3-letter)" << endl;
102 std::string lcode( str::toLower( code_r ) );
103 if ( lcode != code_r )
105 WAR << "Malformed LanguageCode '" << code_r << "' (not lower case)" << endl;
106 // but maybe we're lucky with the lower case code
107 // and find a language name.
108 it = lookupCode( lcode );
109 if ( it != others.end() )
110 nval.second = it->second;
113 MIL << "Remember LanguageCode '" << code_r << "': '" << nval.second << "'" << endl;
114 return others.insert( nval ).first;
117 /////////////////////////////////////////////////////////////////
119 ///////////////////////////////////////////////////////////////////
121 ///////////////////////////////////////////////////////////////////
123 // CLASS NAME : LanguageCode::Impl
125 /** LanguageCode implementation.
126 * \note CodeMaps contain the untranslated language names.
127 * Translation is done in \ref name.
129 struct LanguageCode::Impl
132 : _index( CodeMaps::getIndex( std::string() ) )
135 Impl( const std::string & code_r )
136 : _index( CodeMaps::getIndex( code_r ) )
139 std::string code() const
140 { return _index->first; }
142 std::string name() const {
143 if ( _index->second.empty() )
145 std::string ret( _("Unknown language: ") );
147 ret += _index->first;
151 return _( _index->second.c_str() );
155 /** index into code map. */
156 CodeMaps::Index _index;
159 /** Offer default Impl. */
160 static shared_ptr<Impl> nullimpl()
162 static shared_ptr<Impl> _nullimpl( new Impl );
166 ///////////////////////////////////////////////////////////////////
168 ///////////////////////////////////////////////////////////////////
170 // CLASS NAME : LanguageCode
172 ///////////////////////////////////////////////////////////////////
174 const LanguageCode LanguageCode::noCode;
176 ///////////////////////////////////////////////////////////////////
178 // METHOD NAME : LanguageCode::LanguageCode
179 // METHOD TYPE : Ctor
181 LanguageCode::LanguageCode()
182 : _pimpl( Impl::nullimpl() )
185 ///////////////////////////////////////////////////////////////////
187 // METHOD NAME : LanguageCode::LanguageCode
188 // METHOD TYPE : Ctor
190 LanguageCode::LanguageCode( const std::string & code_r )
191 : _pimpl( new Impl( code_r ) )
194 ///////////////////////////////////////////////////////////////////
196 // METHOD NAME : LanguageCode::~LanguageCode
197 // METHOD TYPE : Dtor
199 LanguageCode::~LanguageCode()
202 ///////////////////////////////////////////////////////////////////
204 // METHOD NAME : LanguageCode::code
205 // METHOD TYPE : std::string
207 std::string LanguageCode::code() const
208 { return _pimpl->code(); }
210 ///////////////////////////////////////////////////////////////////
212 // METHOD NAME : LanguageCode::name
213 // METHOD TYPE : std::string
215 std::string LanguageCode::name() const
216 { return _pimpl->name(); }
218 ///////////////////////////////////////////////////////////////////
220 { /////////////////////////////////////////////////////////////////
224 // Defined LanguageCode constants
225 others[""] = N_("No Code");
229 const char *iso639_2;
230 const char *iso639_1;
234 // some languages have more than one iso639_2 code
235 // so there are items with duplicate names
236 LangInit langInit[] = {
237 // language code: aar aa
238 { "aar", "aa", N_( "Afar" ) },
239 // language code: abk ab
240 { "abk", "ab", N_( "Abkhazian" ) },
241 // language code: ace
242 { "ace", NULL, N_( "Achinese" ) },
243 // language code: ach
244 { "ach", NULL, N_( "Acoli" ) },
245 // language code: ada
246 { "ada", NULL, N_( "Adangme" ) },
247 // language code: ady
248 { "ady", NULL, N_( "Adyghe" ) },
249 // language code: afa
250 { "afa", NULL, N_( "Afro-Asiatic (Other)" ) },
251 // language code: afh
252 { "afh", NULL, N_( "Afrihili" ) },
253 // language code: afr af
254 { "afr", "af", N_( "Afrikaans" ) },
255 // language code: ain
256 { "ain", NULL, N_( "Ainu" ) },
257 // language code: aka ak
258 { "aka", "ak", N_( "Akan" ) },
259 // language code: akk
260 { "akk", NULL, N_( "Akkadian" ) },
261 // language code: alb sqi sq
262 { "alb", "sq", N_( "Albanian" ) },
263 // language code: alb sqi sq
264 { "sqi", NULL, N_( "Albanian" ) },
265 // language code: ale
266 { "ale", NULL, N_( "Aleut" ) },
267 // language code: alg
268 { "alg", NULL, N_( "Algonquian Languages" ) },
269 // language code: alt
270 { "alt", NULL, N_( "Southern Altai" ) },
271 // language code: amh am
272 { "amh", "am", N_( "Amharic" ) },
273 // language code: ang
274 { "ang", NULL, N_( "English, Old (ca.450-1100)" ) },
275 // language code: apa
276 { "apa", NULL, N_( "Apache Languages" ) },
277 // language code: ara ar
278 { "ara", "ar", N_( "Arabic" ) },
279 // language code: arc
280 { "arc", NULL, N_( "Aramaic" ) },
281 // language code: arg an
282 { "arg", "an", N_( "Aragonese" ) },
283 // language code: arm hye hy
284 { "arm", "hy", N_( "Armenian" ) },
285 // language code: arm hye hy
286 { "hye", NULL, N_( "Armenian" ) },
287 // language code: arn
288 { "arn", NULL, N_( "Araucanian" ) },
289 // language code: arp
290 { "arp", NULL, N_( "Arapaho" ) },
291 // language code: art
292 { "art", NULL, N_( "Artificial (Other)" ) },
293 // language code: arw
294 { "arw", NULL, N_( "Arawak" ) },
295 // language code: asm as
296 { "asm", "as", N_( "Assamese" ) },
297 // language code: ast
298 { "ast", NULL, N_( "Asturian" ) },
299 // language code: ath
300 { "ath", NULL, N_( "Athapascan Languages" ) },
301 // language code: aus
302 { "aus", NULL, N_( "Australian Languages" ) },
303 // language code: ava av
304 { "ava", "av", N_( "Avaric" ) },
305 // language code: ave ae
306 { "ave", "ae", N_( "Avestan" ) },
307 // language code: awa
308 { "awa", NULL, N_( "Awadhi" ) },
309 // language code: aym ay
310 { "aym", "ay", N_( "Aymara" ) },
311 // language code: aze az
312 { "aze", "az", N_( "Azerbaijani" ) },
313 // language code: bad
314 { "bad", NULL, N_( "Banda" ) },
315 // language code: bai
316 { "bai", NULL, N_( "Bamileke Languages" ) },
317 // language code: bak ba
318 { "bak", "ba", N_( "Bashkir" ) },
319 // language code: bal
320 { "bal", NULL, N_( "Baluchi" ) },
321 // language code: bam bm
322 { "bam", "bm", N_( "Bambara" ) },
323 // language code: ban
324 { "ban", NULL, N_( "Balinese" ) },
325 // language code: baq eus eu
326 { "baq", "eu", N_( "Basque" ) },
327 // language code: baq eus eu
328 { "eus", NULL, N_( "Basque" ) },
329 // language code: bas
330 { "bas", NULL, N_( "Basa" ) },
331 // language code: bat
332 { "bat", NULL, N_( "Baltic (Other)" ) },
333 // language code: bej
334 { "bej", NULL, N_( "Beja" ) },
335 // language code: bel be
336 { "bel", "be", N_( "Belarusian" ) },
337 // language code: bem
338 { "bem", NULL, N_( "Bemba" ) },
339 // language code: ben bn
340 { "ben", "bn", N_( "Bengali" ) },
341 // language code: ber
342 { "ber", NULL, N_( "Berber (Other)" ) },
343 // language code: bho
344 { "bho", NULL, N_( "Bhojpuri" ) },
345 // language code: bih bh
346 { "bih", "bh", N_( "Bihari" ) },
347 // language code: bik
348 { "bik", NULL, N_( "Bikol" ) },
349 // language code: bin
350 { "bin", NULL, N_( "Bini" ) },
351 // language code: bis bi
352 { "bis", "bi", N_( "Bislama" ) },
353 // language code: bla
354 { "bla", NULL, N_( "Siksika" ) },
355 // language code: bnt
356 { "bnt", NULL, N_( "Bantu (Other)" ) },
357 // language code: bos bs
358 { "bos", "bs", N_( "Bosnian" ) },
359 // language code: bra
360 { "bra", NULL, N_( "Braj" ) },
361 // language code: bre br
362 { "bre", "br", N_( "Breton" ) },
363 // language code: btk
364 { "btk", NULL, N_( "Batak (Indonesia)" ) },
365 // language code: bua
366 { "bua", NULL, N_( "Buriat" ) },
367 // language code: bug
368 { "bug", NULL, N_( "Buginese" ) },
369 // language code: bul bg
370 { "bul", "bg", N_( "Bulgarian" ) },
371 // language code: bur mya my
372 { "bur", "my", N_( "Burmese" ) },
373 // language code: bur mya my
374 { "mya", NULL, N_( "Burmese" ) },
375 // language code: byn
376 { "byn", NULL, N_( "Blin" ) },
377 // language code: cad
378 { "cad", NULL, N_( "Caddo" ) },
379 // language code: cai
380 { "cai", NULL, N_( "Central American Indian (Other)" ) },
381 // language code: car
382 { "car", NULL, N_( "Carib" ) },
383 // language code: cat ca
384 { "cat", "ca", N_( "Catalan" ) },
385 // language code: cau
386 { "cau", NULL, N_( "Caucasian (Other)" ) },
387 // language code: ceb
388 { "ceb", NULL, N_( "Cebuano" ) },
389 // language code: cel
390 { "cel", NULL, N_( "Celtic (Other)" ) },
391 // language code: cha ch
392 { "cha", "ch", N_( "Chamorro" ) },
393 // language code: chb
394 { "chb", NULL, N_( "Chibcha" ) },
395 // language code: che ce
396 { "che", "ce", N_( "Chechen" ) },
397 // language code: chg
398 { "chg", NULL, N_( "Chagatai" ) },
399 // language code: chi zho zh
400 { "chi", "zh", N_( "Chinese" ) },
401 // language code: chi zho zh
402 { "zho", NULL, N_( "Chinese" ) },
403 // language code: chk
404 { "chk", NULL, N_( "Chuukese" ) },
405 // language code: chm
406 { "chm", NULL, N_( "Mari" ) },
407 // language code: chn
408 { "chn", NULL, N_( "Chinook Jargon" ) },
409 // language code: cho
410 { "cho", NULL, N_( "Choctaw" ) },
411 // language code: chp
412 { "chp", NULL, N_( "Chipewyan" ) },
413 // language code: chr
414 { "chr", NULL, N_( "Cherokee" ) },
415 // language code: chu cu
416 { "chu", "cu", N_( "Church Slavic" ) },
417 // language code: chv cv
418 { "chv", "cv", N_( "Chuvash" ) },
419 // language code: chy
420 { "chy", NULL, N_( "Cheyenne" ) },
421 // language code: cmc
422 { "cmc", NULL, N_( "Chamic Languages" ) },
423 // language code: cop
424 { "cop", NULL, N_( "Coptic" ) },
425 // language code: cor kw
426 { "cor", "kw", N_( "Cornish" ) },
427 // language code: cos co
428 { "cos", "co", N_( "Corsican" ) },
429 // language code: cpe
430 { "cpe", NULL, N_( "Creoles and Pidgins, English-Based (Other)" ) },
431 // language code: cpf
432 { "cpf", NULL, N_( "Creoles and Pidgins, French-Based (Other)" ) },
433 // language code: cpp
434 { "cpp", NULL, N_( "Creoles and Pidgins, Portuguese-Based (Other)" ) },
435 // language code: cre cr
436 { "cre", "cr", N_( "Cree" ) },
437 // language code: crh
438 { "crh", NULL, N_( "Crimean Tatar" ) },
439 // language code: crp
440 { "crp", NULL, N_( "Creoles and Pidgins (Other)" ) },
441 // language code: csb
442 { "csb", NULL, N_( "Kashubian" ) },
443 // language code: cus
444 { "cus", NULL, N_( "Cushitic (Other)" ) },
445 // language code: cze ces cs
446 { "cze", "cs", N_( "Czech" ) },
447 // language code: cze ces cs
448 { "ces", NULL, N_( "Czech" ) },
449 // language code: dak
450 { "dak", NULL, N_( "Dakota" ) },
451 // language code: dan da
452 { "dan", "da", N_( "Danish" ) },
453 // language code: dar
454 { "dar", NULL, N_( "Dargwa" ) },
455 // language code: day
456 { "day", NULL, N_( "Dayak" ) },
457 // language code: del
458 { "del", NULL, N_( "Delaware" ) },
459 // language code: den
460 { "den", NULL, N_( "Slave (Athapascan)" ) },
461 // language code: dgr
462 { "dgr", NULL, N_( "Dogrib" ) },
463 // language code: din
464 { "din", NULL, N_( "Dinka" ) },
465 // language code: div dv
466 { "div", "dv", N_( "Divehi" ) },
467 // language code: doi
468 { "doi", NULL, N_( "Dogri" ) },
469 // language code: dra
470 { "dra", NULL, N_( "Dravidian (Other)" ) },
471 // language code: dsb
472 { "dsb", NULL, N_( "Lower Sorbian" ) },
473 // language code: dua
474 { "dua", NULL, N_( "Duala" ) },
475 // language code: dum
476 { "dum", NULL, N_( "Dutch, Middle (ca.1050-1350)" ) },
477 // language code: dut nld nl
478 { "dut", "nl", N_( "Dutch" ) },
479 // language code: dut nld nl
480 { "nld", NULL, N_( "Dutch" ) },
481 // language code: dyu
482 { "dyu", NULL, N_( "Dyula" ) },
483 // language code: dzo dz
484 { "dzo", "dz", N_( "Dzongkha" ) },
485 // language code: efi
486 { "efi", NULL, N_( "Efik" ) },
487 // language code: egy
488 { "egy", NULL, N_( "Egyptian (Ancient)" ) },
489 // language code: eka
490 { "eka", NULL, N_( "Ekajuk" ) },
491 // language code: elx
492 { "elx", NULL, N_( "Elamite" ) },
493 // language code: eng en
494 { "eng", "en", N_( "English" ) },
495 // language code: enm
496 { "enm", NULL, N_( "English, Middle (1100-1500)" ) },
497 // language code: epo eo
498 { "epo", "eo", N_( "Esperanto" ) },
499 // language code: est et
500 { "est", "et", N_( "Estonian" ) },
501 // language code: ewe ee
502 { "ewe", "ee", N_( "Ewe" ) },
503 // language code: ewo
504 { "ewo", NULL, N_( "Ewondo" ) },
505 // language code: fan
506 { "fan", NULL, N_( "Fang" ) },
507 // language code: fao fo
508 { "fao", "fo", N_( "Faroese" ) },
509 // language code: fat
510 { "fat", NULL, N_( "Fanti" ) },
511 // language code: fij fj
512 { "fij", "fj", N_( "Fijian" ) },
513 // language code: fil
514 { "fil", NULL, N_( "Filipino" ) },
515 // language code: fin fi
516 { "fin", "fi", N_( "Finnish" ) },
517 // language code: fiu
518 { "fiu", NULL, N_( "Finno-Ugrian (Other)" ) },
519 // language code: fon
520 { "fon", NULL, N_( "Fon" ) },
521 // language code: fre fra fr
522 { "fre", "fr", N_( "French" ) },
523 // language code: fre fra fr
524 { "fra", NULL, N_( "French" ) },
525 // language code: frm
526 { "frm", NULL, N_( "French, Middle (ca.1400-1600)" ) },
527 // language code: fro
528 { "fro", NULL, N_( "French, Old (842-ca.1400)" ) },
529 // language code: fry fy
530 { "fry", "fy", N_( "Frisian" ) },
531 // language code: ful ff
532 { "ful", "ff", N_( "Fulah" ) },
533 // language code: fur
534 { "fur", NULL, N_( "Friulian" ) },
535 // language code: gaa
536 { "gaa", NULL, N_( "Ga" ) },
537 // language code: gay
538 { "gay", NULL, N_( "Gayo" ) },
539 // language code: gba
540 { "gba", NULL, N_( "Gbaya" ) },
541 // language code: gem
542 { "gem", NULL, N_( "Germanic (Other)" ) },
543 // language code: geo kat ka
544 { "geo", "ka", N_( "Georgian" ) },
545 // language code: geo kat ka
546 { "kat", NULL, N_( "Georgian" ) },
547 // language code: ger deu de
548 { "ger", "de", N_( "German" ) },
549 // language code: ger deu de
550 { "deu", NULL, N_( "German" ) },
551 // language code: gez
552 { "gez", NULL, N_( "Geez" ) },
553 // language code: gil
554 { "gil", NULL, N_( "Gilbertese" ) },
555 // language code: gla gd
556 { "gla", "gd", N_( "Gaelic" ) },
557 // language code: gle ga
558 { "gle", "ga", N_( "Irish" ) },
559 // language code: glg gl
560 { "glg", "gl", N_( "Galician" ) },
561 // language code: glv gv
562 { "glv", "gv", N_( "Manx" ) },
563 // language code: gmh
564 { "gmh", NULL, N_( "German, Middle High (ca.1050-1500)" ) },
565 // language code: goh
566 { "goh", NULL, N_( "German, Old High (ca.750-1050)" ) },
567 // language code: gon
568 { "gon", NULL, N_( "Gondi" ) },
569 // language code: gor
570 { "gor", NULL, N_( "Gorontalo" ) },
571 // language code: got
572 { "got", NULL, N_( "Gothic" ) },
573 // language code: grb
574 { "grb", NULL, N_( "Grebo" ) },
575 // language code: grc
576 { "grc", NULL, N_( "Greek, Ancient (to 1453)" ) },
577 // language code: gre ell el
578 { "gre", "el", N_( "Greek, Modern (1453-)" ) },
579 // language code: gre ell el
580 { "ell", NULL, N_( "Greek, Modern (1453-)" ) },
581 // language code: grn gn
582 { "grn", "gn", N_( "Guarani" ) },
583 // language code: guj gu
584 { "guj", "gu", N_( "Gujarati" ) },
585 // language code: gwi
586 { "gwi", NULL, N_( "Gwich'in" ) },
587 // language code: hai
588 { "hai", NULL, N_( "Haida" ) },
589 // language code: hat ht
590 { "hat", "ht", N_( "Haitian" ) },
591 // language code: hau ha
592 { "hau", "ha", N_( "Hausa" ) },
593 // language code: haw
594 { "haw", NULL, N_( "Hawaiian" ) },
595 // language code: heb he
596 { "heb", "he", N_( "Hebrew" ) },
597 // language code: her hz
598 { "her", "hz", N_( "Herero" ) },
599 // language code: hil
600 { "hil", NULL, N_( "Hiligaynon" ) },
601 // language code: him
602 { "him", NULL, N_( "Himachali" ) },
603 // language code: hin hi
604 { "hin", "hi", N_( "Hindi" ) },
605 // language code: hit
606 { "hit", NULL, N_( "Hittite" ) },
607 // language code: hmn
608 { "hmn", NULL, N_( "Hmong" ) },
609 // language code: hmo ho
610 { "hmo", "ho", N_( "Hiri Motu" ) },
611 // language code: hsb
612 { "hsb", NULL, N_( "Upper Sorbian" ) },
613 // language code: hun hu
614 { "hun", "hu", N_( "Hungarian" ) },
615 // language code: hup
616 { "hup", NULL, N_( "Hupa" ) },
617 // language code: iba
618 { "iba", NULL, N_( "Iban" ) },
619 // language code: ibo ig
620 { "ibo", "ig", N_( "Igbo" ) },
621 // language code: ice isl is
622 { "ice", "is", N_( "Icelandic" ) },
623 // language code: ice isl is
624 { "isl", NULL, N_( "Icelandic" ) },
625 // language code: ido io
626 { "ido", "io", N_( "Ido" ) },
627 // language code: iii ii
628 { "iii", "ii", N_( "Sichuan Yi" ) },
629 // language code: ijo
630 { "ijo", NULL, N_( "Ijo" ) },
631 // language code: iku iu
632 { "iku", "iu", N_( "Inuktitut" ) },
633 // language code: ile ie
634 { "ile", "ie", N_( "Interlingue" ) },
635 // language code: ilo
636 { "ilo", NULL, N_( "Iloko" ) },
637 // language code: ina ia
638 { "ina", "ia", N_( "Interlingua (International Auxiliary Language Association)" ) },
639 // language code: inc
640 { "inc", NULL, N_( "Indic (Other)" ) },
641 // language code: ind id
642 { "ind", "id", N_( "Indonesian" ) },
643 // language code: ine
644 { "ine", NULL, N_( "Indo-European (Other)" ) },
645 // language code: inh
646 { "inh", NULL, N_( "Ingush" ) },
647 // language code: ipk ik
648 { "ipk", "ik", N_( "Inupiaq" ) },
649 // language code: ira
650 { "ira", NULL, N_( "Iranian (Other)" ) },
651 // language code: iro
652 { "iro", NULL, N_( "Iroquoian Languages" ) },
653 // language code: ita it
654 { "ita", "it", N_( "Italian" ) },
655 // language code: jav jv
656 { "jav", "jv", N_( "Javanese" ) },
657 // language code: jbo
658 { "jbo", NULL, N_( "Lojban" ) },
659 // language code: jpn ja
660 { "jpn", "ja", N_( "Japanese" ) },
661 // language code: jpr
662 { "jpr", NULL, N_( "Judeo-Persian" ) },
663 // language code: jrb
664 { "jrb", NULL, N_( "Judeo-Arabic" ) },
665 // language code: kaa
666 { "kaa", NULL, N_( "Kara-Kalpak" ) },
667 // language code: kab
668 { "kab", NULL, N_( "Kabyle" ) },
669 // language code: kac
670 { "kac", NULL, N_( "Kachin" ) },
671 // language code: kal kl
672 { "kal", "kl", N_( "Kalaallisut" ) },
673 // language code: kam
674 { "kam", NULL, N_( "Kamba" ) },
675 // language code: kan kn
676 { "kan", "kn", N_( "Kannada" ) },
677 // language code: kar
678 { "kar", NULL, N_( "Karen" ) },
679 // language code: kas ks
680 { "kas", "ks", N_( "Kashmiri" ) },
681 // language code: kau kr
682 { "kau", "kr", N_( "Kanuri" ) },
683 // language code: kaw
684 { "kaw", NULL, N_( "Kawi" ) },
685 // language code: kaz kk
686 { "kaz", "kk", N_( "Kazakh" ) },
687 // language code: kbd
688 { "kbd", NULL, N_( "Kabardian" ) },
689 // language code: kha
690 { "kha", NULL, N_( "Khasi" ) },
691 // language code: khi
692 { "khi", NULL, N_( "Khoisan (Other)" ) },
693 // language code: khm km
694 { "khm", "km", N_( "Khmer" ) },
695 // language code: kho
696 { "kho", NULL, N_( "Khotanese" ) },
697 // language code: kik ki
698 { "kik", "ki", N_( "Kikuyu" ) },
699 // language code: kin rw
700 { "kin", "rw", N_( "Kinyarwanda" ) },
701 // language code: kir ky
702 { "kir", "ky", N_( "Kirghiz" ) },
703 // language code: kmb
704 { "kmb", NULL, N_( "Kimbundu" ) },
705 // language code: kok
706 { "kok", NULL, N_( "Konkani" ) },
707 // language code: kom kv
708 { "kom", "kv", N_( "Komi" ) },
709 // language code: kon kg
710 { "kon", "kg", N_( "Kongo" ) },
711 // language code: kor ko
712 { "kor", "ko", N_( "Korean" ) },
713 // language code: kos
714 { "kos", NULL, N_( "Kosraean" ) },
715 // language code: kpe
716 { "kpe", NULL, N_( "Kpelle" ) },
717 // language code: krc
718 { "krc", NULL, N_( "Karachay-Balkar" ) },
719 // language code: kro
720 { "kro", NULL, N_( "Kru" ) },
721 // language code: kru
722 { "kru", NULL, N_( "Kurukh" ) },
723 // language code: kua kj
724 { "kua", "kj", N_( "Kuanyama" ) },
725 // language code: kum
726 { "kum", NULL, N_( "Kumyk" ) },
727 // language code: kur ku
728 { "kur", "ku", N_( "Kurdish" ) },
729 // language code: kut
730 { "kut", NULL, N_( "Kutenai" ) },
731 // language code: lad
732 { "lad", NULL, N_( "Ladino" ) },
733 // language code: lah
734 { "lah", NULL, N_( "Lahnda" ) },
735 // language code: lam
736 { "lam", NULL, N_( "Lamba" ) },
737 // language code: lao lo
738 { "lao", "lo", N_( "Lao" ) },
739 // language code: lat la
740 { "lat", "la", N_( "Latin" ) },
741 // language code: lav lv
742 { "lav", "lv", N_( "Latvian" ) },
743 // language code: lez
744 { "lez", NULL, N_( "Lezghian" ) },
745 // language code: lim li
746 { "lim", "li", N_( "Limburgan" ) },
747 // language code: lin ln
748 { "lin", "ln", N_( "Lingala" ) },
749 // language code: lit lt
750 { "lit", "lt", N_( "Lithuanian" ) },
751 // language code: lol
752 { "lol", NULL, N_( "Mongo" ) },
753 // language code: loz
754 { "loz", NULL, N_( "Lozi" ) },
755 // language code: ltz lb
756 { "ltz", "lb", N_( "Luxembourgish" ) },
757 // language code: lua
758 { "lua", NULL, N_( "Luba-Lulua" ) },
759 // language code: lub lu
760 { "lub", "lu", N_( "Luba-Katanga" ) },
761 // language code: lug lg
762 { "lug", "lg", N_( "Ganda" ) },
763 // language code: lui
764 { "lui", NULL, N_( "Luiseno" ) },
765 // language code: lun
766 { "lun", NULL, N_( "Lunda" ) },
767 // language code: luo
768 { "luo", NULL, N_( "Luo (Kenya and Tanzania)" ) },
769 // language code: lus
770 { "lus", NULL, N_( "Lushai" ) },
771 // language code: mac mkd mk
772 { "mac", "mk", N_( "Macedonian" ) },
773 // language code: mac mkd mk
774 { "mkd", NULL, N_( "Macedonian" ) },
775 // language code: mad
776 { "mad", NULL, N_( "Madurese" ) },
777 // language code: mag
778 { "mag", NULL, N_( "Magahi" ) },
779 // language code: mah mh
780 { "mah", "mh", N_( "Marshallese" ) },
781 // language code: mai
782 { "mai", NULL, N_( "Maithili" ) },
783 // language code: mak
784 { "mak", NULL, N_( "Makasar" ) },
785 // language code: mal ml
786 { "mal", "ml", N_( "Malayalam" ) },
787 // language code: man
788 { "man", NULL, N_( "Mandingo" ) },
789 // language code: mao mri mi
790 { "mao", "mi", N_( "Maori" ) },
791 // language code: mao mri mi
792 { "mri", NULL, N_( "Maori" ) },
793 // language code: map
794 { "map", NULL, N_( "Austronesian (Other)" ) },
795 // language code: mar mr
796 { "mar", "mr", N_( "Marathi" ) },
797 // language code: mas
798 { "mas", NULL, N_( "Masai" ) },
799 // language code: may msa ms
800 { "may", "ms", N_( "Malay" ) },
801 // language code: may msa ms
802 { "msa", NULL, N_( "Malay" ) },
803 // language code: mdf
804 { "mdf", NULL, N_( "Moksha" ) },
805 // language code: mdr
806 { "mdr", NULL, N_( "Mandar" ) },
807 // language code: men
808 { "men", NULL, N_( "Mende" ) },
809 // language code: mga
810 { "mga", NULL, N_( "Irish, Middle (900-1200)" ) },
811 // language code: mic
812 { "mic", NULL, N_( "Mi'kmaq" ) },
813 // language code: min
814 { "min", NULL, N_( "Minangkabau" ) },
815 // language code: mis
816 { "mis", NULL, N_( "Miscellaneous Languages" ) },
817 // language code: mkh
818 { "mkh", NULL, N_( "Mon-Khmer (Other)" ) },
819 // language code: mlg mg
820 { "mlg", "mg", N_( "Malagasy" ) },
821 // language code: mlt mt
822 { "mlt", "mt", N_( "Maltese" ) },
823 // language code: mnc
824 { "mnc", NULL, N_( "Manchu" ) },
825 // language code: mni
826 { "mni", NULL, N_( "Manipuri" ) },
827 // language code: mno
828 { "mno", NULL, N_( "Manobo Languages" ) },
829 // language code: moh
830 { "moh", NULL, N_( "Mohawk" ) },
831 // language code: mol mo
832 { "mol", "mo", N_( "Moldavian" ) },
833 // language code: mon mn
834 { "mon", "mn", N_( "Mongolian" ) },
835 // language code: mos
836 { "mos", NULL, N_( "Mossi" ) },
837 // language code: mul
838 { "mul", NULL, N_( "Multiple Languages" ) },
839 // language code: mun
840 { "mun", NULL, N_( "Munda languages" ) },
841 // language code: mus
842 { "mus", NULL, N_( "Creek" ) },
843 // language code: mwl
844 { "mwl", NULL, N_( "Mirandese" ) },
845 // language code: mwr
846 { "mwr", NULL, N_( "Marwari" ) },
847 // language code: myn
848 { "myn", NULL, N_( "Mayan Languages" ) },
849 // language code: myv
850 { "myv", NULL, N_( "Erzya" ) },
851 // language code: nah
852 { "nah", NULL, N_( "Nahuatl" ) },
853 // language code: nai
854 { "nai", NULL, N_( "North American Indian" ) },
855 // language code: nap
856 { "nap", NULL, N_( "Neapolitan" ) },
857 // language code: nau na
858 { "nau", "na", N_( "Nauru" ) },
859 // language code: nav nv
860 { "nav", "nv", N_( "Navajo" ) },
861 // language code: nbl nr
862 { "nbl", "nr", N_( "Ndebele, South" ) },
863 // language code: nde nd
864 { "nde", "nd", N_( "Ndebele, North" ) },
865 // language code: ndo ng
866 { "ndo", "ng", N_( "Ndonga" ) },
867 // language code: nds
868 { "nds", NULL, N_( "Low German" ) },
869 // language code: nep ne
870 { "nep", "ne", N_( "Nepali" ) },
871 // language code: new
872 { "new", NULL, N_( "Nepal Bhasa" ) },
873 // language code: nia
874 { "nia", NULL, N_( "Nias" ) },
875 // language code: nic
876 { "nic", NULL, N_( "Niger-Kordofanian (Other)" ) },
877 // language code: niu
878 { "niu", NULL, N_( "Niuean" ) },
879 // language code: nno nn
880 { "nno", "nn", N_( "Norwegian Nynorsk" ) },
881 // language code: nob nb
882 { "nob", "nb", N_( "Norwegian Bokmal" ) },
883 // language code: nog
884 { "nog", NULL, N_( "Nogai" ) },
885 // language code: non
886 { "non", NULL, N_( "Norse, Old" ) },
887 // language code: nor no
888 { "nor", "no", N_( "Norwegian" ) },
889 // language code: nso
890 { "nso", NULL, N_( "Northern Sotho" ) },
891 // language code: nub
892 { "nub", NULL, N_( "Nubian Languages" ) },
893 // language code: nwc
894 { "nwc", NULL, N_( "Classical Newari" ) },
895 // language code: nya ny
896 { "nya", "ny", N_( "Chichewa" ) },
897 // language code: nym
898 { "nym", NULL, N_( "Nyamwezi" ) },
899 // language code: nyn
900 { "nyn", NULL, N_( "Nyankole" ) },
901 // language code: nyo
902 { "nyo", NULL, N_( "Nyoro" ) },
903 // language code: nzi
904 { "nzi", NULL, N_( "Nzima" ) },
905 // language code: oci oc
906 { "oci", "oc", N_( "Occitan (post 1500)" ) },
907 // language code: oji oj
908 { "oji", "oj", N_( "Ojibwa" ) },
909 // language code: ori or
910 { "ori", "or", N_( "Oriya" ) },
911 // language code: orm om
912 { "orm", "om", N_( "Oromo" ) },
913 // language code: osa
914 { "osa", NULL, N_( "Osage" ) },
915 // language code: oss os
916 { "oss", "os", N_( "Ossetian" ) },
917 // language code: ota
918 { "ota", NULL, N_( "Turkish, Ottoman (1500-1928)" ) },
919 // language code: oto
920 { "oto", NULL, N_( "Otomian Languages" ) },
921 // language code: paa
922 { "paa", NULL, N_( "Papuan (Other)" ) },
923 // language code: pag
924 { "pag", NULL, N_( "Pangasinan" ) },
925 // language code: pal
926 { "pal", NULL, N_( "Pahlavi" ) },
927 // language code: pam
928 { "pam", NULL, N_( "Pampanga" ) },
929 // language code: pan pa
930 { "pan", "pa", N_( "Panjabi" ) },
931 // language code: pap
932 { "pap", NULL, N_( "Papiamento" ) },
933 // language code: pau
934 { "pau", NULL, N_( "Palauan" ) },
935 // language code: peo
936 { "peo", NULL, N_( "Persian, Old (ca.600-400 B.C.)" ) },
937 // language code: per fas fa
938 { "per", "fa", N_( "Persian" ) },
939 // language code: per fas fa
940 { "fas", NULL, N_( "Persian" ) },
941 // language code: phi
942 { "phi", NULL, N_( "Philippine (Other)" ) },
943 // language code: phn
944 { "phn", NULL, N_( "Phoenician" ) },
945 // language code: pli pi
946 { "pli", "pi", N_( "Pali" ) },
947 // language code: pol pl
948 { "pol", "pl", N_( "Polish" ) },
949 // language code: pon
950 { "pon", NULL, N_( "Pohnpeian" ) },
951 // language code: por pt
952 { "por", "pt", N_( "Portuguese" ) },
953 // language code: pra
954 { "pra", NULL, N_( "Prakrit Languages" ) },
955 // language code: pro
956 { "pro", NULL, N_( "Provencal, Old (to 1500)" ) },
957 // language code: pus ps
958 { "pus", "ps", N_( "Pushto" ) },
959 // language code: que qu
960 { "que", "qu", N_( "Quechua" ) },
961 // language code: raj
962 { "raj", NULL, N_( "Rajasthani" ) },
963 // language code: rap
964 { "rap", NULL, N_( "Rapanui" ) },
965 // language code: rar
966 { "rar", NULL, N_( "Rarotongan" ) },
967 // language code: roa
968 { "roa", NULL, N_( "Romance (Other)" ) },
969 // language code: roh rm
970 { "roh", "rm", N_( "Raeto-Romance" ) },
971 // language code: rom
972 { "rom", NULL, N_( "Romany" ) },
973 // language code: rum ron ro
974 { "rum", "ro", N_( "Romanian" ) },
975 // language code: rum ron ro
976 { "ron", NULL, N_( "Romanian" ) },
977 // language code: run rn
978 { "run", "rn", N_( "Rundi" ) },
979 // language code: rus ru
980 { "rus", "ru", N_( "Russian" ) },
981 // language code: sad
982 { "sad", NULL, N_( "Sandawe" ) },
983 // language code: sag sg
984 { "sag", "sg", N_( "Sango" ) },
985 // language code: sah
986 { "sah", NULL, N_( "Yakut" ) },
987 // language code: sai
988 { "sai", NULL, N_( "South American Indian (Other)" ) },
989 // language code: sal
990 { "sal", NULL, N_( "Salishan Languages" ) },
991 // language code: sam
992 { "sam", NULL, N_( "Samaritan Aramaic" ) },
993 // language code: san sa
994 { "san", "sa", N_( "Sanskrit" ) },
995 // language code: sas
996 { "sas", NULL, N_( "Sasak" ) },
997 // language code: sat
998 { "sat", NULL, N_( "Santali" ) },
999 // language code: scc srp sr
1000 { "scc", "sr", N_( "Serbian" ) },
1001 // language code: scc srp sr
1002 { "srp", NULL, N_( "Serbian" ) },
1003 // language code: scn
1004 { "scn", NULL, N_( "Sicilian" ) },
1005 // language code: sco
1006 { "sco", NULL, N_( "Scots" ) },
1007 // language code: scr hrv hr
1008 { "scr", "hr", N_( "Croatian" ) },
1009 // language code: scr hrv hr
1010 { "hrv", NULL, N_( "Croatian" ) },
1011 // language code: sel
1012 { "sel", NULL, N_( "Selkup" ) },
1013 // language code: sem
1014 { "sem", NULL, N_( "Semitic (Other)" ) },
1015 // language code: sga
1016 { "sga", NULL, N_( "Irish, Old (to 900)" ) },
1017 // language code: sgn
1018 { "sgn", NULL, N_( "Sign Languages" ) },
1019 // language code: shn
1020 { "shn", NULL, N_( "Shan" ) },
1021 // language code: sid
1022 { "sid", NULL, N_( "Sidamo" ) },
1023 // language code: sin si
1024 { "sin", "si", N_( "Sinhala" ) },
1025 // language code: sio
1026 { "sio", NULL, N_( "Siouan Languages" ) },
1027 // language code: sit
1028 { "sit", NULL, N_( "Sino-Tibetan (Other)" ) },
1029 // language code: sla
1030 { "sla", NULL, N_( "Slavic (Other)" ) },
1031 // language code: slo slk sk
1032 { "slo", "sk", N_( "Slovak" ) },
1033 // language code: slo slk sk
1034 { "slk", NULL, N_( "Slovak" ) },
1035 // language code: slv sl
1036 { "slv", "sl", N_( "Slovenian" ) },
1037 // language code: sma
1038 { "sma", NULL, N_( "Southern Sami" ) },
1039 // language code: sme se
1040 { "sme", "se", N_( "Northern Sami" ) },
1041 // language code: smi
1042 { "smi", NULL, N_( "Sami Languages (Other)" ) },
1043 // language code: smj
1044 { "smj", NULL, N_( "Lule Sami" ) },
1045 // language code: smn
1046 { "smn", NULL, N_( "Inari Sami" ) },
1047 // language code: smo sm
1048 { "smo", "sm", N_( "Samoan" ) },
1049 // language code: sms
1050 { "sms", NULL, N_( "Skolt Sami" ) },
1051 // language code: sna sn
1052 { "sna", "sn", N_( "Shona" ) },
1053 // language code: snd sd
1054 { "snd", "sd", N_( "Sindhi" ) },
1055 // language code: snk
1056 { "snk", NULL, N_( "Soninke" ) },
1057 // language code: sog
1058 { "sog", NULL, N_( "Sogdian" ) },
1059 // language code: som so
1060 { "som", "so", N_( "Somali" ) },
1061 // language code: son
1062 { "son", NULL, N_( "Songhai" ) },
1063 // language code: sot st
1064 { "sot", "st", N_( "Sotho, Southern" ) },
1065 // language code: spa es
1066 { "spa", "es", N_( "Spanish" ) },
1067 // language code: srd sc
1068 { "srd", "sc", N_( "Sardinian" ) },
1069 // language code: srr
1070 { "srr", NULL, N_( "Serer" ) },
1071 // language code: ssa
1072 { "ssa", NULL, N_( "Nilo-Saharan (Other)" ) },
1073 // language code: ssw ss
1074 { "ssw", "ss", N_( "Swati" ) },
1075 // language code: suk
1076 { "suk", NULL, N_( "Sukuma" ) },
1077 // language code: sun su
1078 { "sun", "su", N_( "Sundanese" ) },
1079 // language code: sus
1080 { "sus", NULL, N_( "Susu" ) },
1081 // language code: sux
1082 { "sux", NULL, N_( "Sumerian" ) },
1083 // language code: swa sw
1084 { "swa", "sw", N_( "Swahili" ) },
1085 // language code: swe sv
1086 { "swe", "sv", N_( "Swedish" ) },
1087 // language code: syr
1088 { "syr", NULL, N_( "Syriac" ) },
1089 // language code: tah ty
1090 { "tah", "ty", N_( "Tahitian" ) },
1091 // language code: tai
1092 { "tai", NULL, N_( "Tai (Other)" ) },
1093 // language code: tam ta
1094 { "tam", "ta", N_( "Tamil" ) },
1095 // language code: tat tt
1096 { "tat", "tt", N_( "Tatar" ) },
1097 // language code: tel te
1098 { "tel", "te", N_( "Telugu" ) },
1099 // language code: tem
1100 { "tem", NULL, N_( "Timne" ) },
1101 // language code: ter
1102 { "ter", NULL, N_( "Tereno" ) },
1103 // language code: tet
1104 { "tet", NULL, N_( "Tetum" ) },
1105 // language code: tgk tg
1106 { "tgk", "tg", N_( "Tajik" ) },
1107 // language code: tgl tl
1108 { "tgl", "tl", N_( "Tagalog" ) },
1109 // language code: tha th
1110 { "tha", "th", N_( "Thai" ) },
1111 // language code: tib bod bo
1112 { "tib", "bo", N_( "Tibetan" ) },
1113 // language code: tib bod bo
1114 { "bod", NULL, N_( "Tibetan" ) },
1115 // language code: tig
1116 { "tig", NULL, N_( "Tigre" ) },
1117 // language code: tir ti
1118 { "tir", "ti", N_( "Tigrinya" ) },
1119 // language code: tiv
1120 { "tiv", NULL, N_( "Tiv" ) },
1121 // language code: tkl
1122 { "tkl", NULL, N_( "Tokelau" ) },
1123 // language code: tlh
1124 { "tlh", NULL, N_( "Klingon" ) },
1125 // language code: tli
1126 { "tli", NULL, N_( "Tlingit" ) },
1127 // language code: tmh
1128 { "tmh", NULL, N_( "Tamashek" ) },
1129 // language code: tog
1130 { "tog", NULL, N_( "Tonga (Nyasa)" ) },
1131 // language code: ton to
1132 { "ton", "to", N_( "Tonga (Tonga Islands)" ) },
1133 // language code: tpi
1134 { "tpi", NULL, N_( "Tok Pisin" ) },
1135 // language code: tsi
1136 { "tsi", NULL, N_( "Tsimshian" ) },
1137 // language code: tsn tn
1138 { "tsn", "tn", N_( "Tswana" ) },
1139 // language code: tso ts
1140 { "tso", "ts", N_( "Tsonga" ) },
1141 // language code: tuk tk
1142 { "tuk", "tk", N_( "Turkmen" ) },
1143 // language code: tum
1144 { "tum", NULL, N_( "Tumbuka" ) },
1145 // language code: tup
1146 { "tup", NULL, N_( "Tupi Languages" ) },
1147 // language code: tur tr
1148 { "tur", "tr", N_( "Turkish" ) },
1149 // language code: tut
1150 { "tut", NULL, N_( "Altaic (Other)" ) },
1151 // language code: tvl
1152 { "tvl", NULL, N_( "Tuvalu" ) },
1153 // language code: twi tw
1154 { "twi", "tw", N_( "Twi" ) },
1155 // language code: tyv
1156 { "tyv", NULL, N_( "Tuvinian" ) },
1157 // language code: udm
1158 { "udm", NULL, N_( "Udmurt" ) },
1159 // language code: uga
1160 { "uga", NULL, N_( "Ugaritic" ) },
1161 // language code: uig ug
1162 { "uig", "ug", N_( "Uighur" ) },
1163 // language code: ukr uk
1164 { "ukr", "uk", N_( "Ukrainian" ) },
1165 // language code: umb
1166 { "umb", NULL, N_( "Umbundu" ) },
1167 // language code: und
1168 { "und", NULL, N_( "Undetermined" ) },
1169 // language code: urd ur
1170 { "urd", "ur", N_( "Urdu" ) },
1171 // language code: uzb uz
1172 { "uzb", "uz", N_( "Uzbek" ) },
1173 // language code: vai
1174 { "vai", NULL, N_( "Vai" ) },
1175 // language code: ven ve
1176 { "ven", "ve", N_( "Venda" ) },
1177 // language code: vie vi
1178 { "vie", "vi", N_( "Vietnamese" ) },
1179 // language code: vol vo
1180 { "vol", "vo", N_( "Volapuk" ) },
1181 // language code: vot
1182 { "vot", NULL, N_( "Votic" ) },
1183 // language code: wak
1184 { "wak", NULL, N_( "Wakashan Languages" ) },
1185 // language code: wal
1186 { "wal", NULL, N_( "Walamo" ) },
1187 // language code: war
1188 { "war", NULL, N_( "Waray" ) },
1189 // language code: was
1190 { "was", NULL, N_( "Washo" ) },
1191 // language code: wel cym cy
1192 { "wel", "cy", N_( "Welsh" ) },
1193 // language code: wel cym cy
1194 { "cym", NULL, N_( "Welsh" ) },
1195 // language code: wen
1196 { "wen", NULL, N_( "Sorbian Languages" ) },
1197 // language code: wln wa
1198 { "wln", "wa", N_( "Walloon" ) },
1199 // language code: wol wo
1200 { "wol", "wo", N_( "Wolof" ) },
1201 // language code: xal
1202 { "xal", NULL, N_( "Kalmyk" ) },
1203 // language code: xho xh
1204 { "xho", "xh", N_( "Xhosa" ) },
1205 // language code: yao
1206 { "yao", NULL, N_( "Yao" ) },
1207 // language code: yap
1208 { "yap", NULL, N_( "Yapese" ) },
1209 // language code: yid yi
1210 { "yid", "yi", N_( "Yiddish" ) },
1211 // language code: yor yo
1212 { "yor", "yo", N_( "Yoruba" ) },
1213 // language code: ypk
1214 { "ypk", NULL, N_( "Yupik Languages" ) },
1215 // language code: zap
1216 { "zap", NULL, N_( "Zapotec" ) },
1217 // language code: zen
1218 { "zen", NULL, N_( "Zenaga" ) },
1219 // language code: zha za
1220 { "zha", "za", N_( "Zhuang" ) },
1221 // language code: znd
1222 { "znd", NULL, N_( "Zande" ) },
1223 // language code: zul zu
1224 { "zul", "zu", N_( "Zulu" ) },
1225 // language code: zun
1226 { "zun", NULL, N_( "Zuni" ) },
1228 { NULL, NULL, NULL }
1231 for (LangInit * i = langInit; i->iso639_2 != NULL; ++i)
1233 iso639_2[i->iso639_2] = i->name;
1234 if (i->iso639_1 != NULL)
1235 iso639_1[i->iso639_1] = i->name;
1239 /////////////////////////////////////////////////////////////////
1241 ///////////////////////////////////////////////////////////////////
1243 /////////////////////////////////////////////////////////////////
1245 ///////////////////////////////////////////////////////////////////