libzypp 17.38.15

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