~drgeo-developers/drgeo/trunk

1097 by Hilaire Fernandes
Move in necessary packages
1
'From Cuis 6.0 [latest update: #5347] on 3 July 2022 at 1:31:40 pm'!
2
'Description '!
3
!provides: 'System-Locales' 1 8!
4
SystemOrganization addCategory: 'System-Locales'!
5
6
7
!classDefinition: #ISOLanguageDefinition category: 'System-Locales'!
8
Object subclass: #ISOLanguageDefinition
9
	instanceVariableNames: 'iso3 iso2 iso3Alternate language'
10
	classVariableNames: 'ISO2Countries ISO2Table ISO3Countries ISO3Table'
11
	poolDictionaries: ''
12
	category: 'System-Locales'!
13
!classDefinition: 'ISOLanguageDefinition class' category: 'System-Locales'!
14
ISOLanguageDefinition class
15
	instanceVariableNames: ''!
16
17
!classDefinition: #Locale category: 'System-Locales'!
18
Object subclass: #Locale
19
	instanceVariableNames: 'id'
20
	classVariableNames: 'Activated Current CurrentPlatform KnownLocales LanguageSymbols LocaleChangeListeners PlatformEncodings Previous'
21
	poolDictionaries: ''
22
	category: 'System-Locales'!
23
!classDefinition: 'Locale class' category: 'System-Locales'!
24
Locale class
25
	instanceVariableNames: ''!
26
27
!classDefinition: #LocaleID category: 'System-Locales'!
28
Object subclass: #LocaleID
29
	instanceVariableNames: 'isoLanguage isoCountry'
30
	classVariableNames: ''
31
	poolDictionaries: 'nil'
32
	category: 'System-Locales'!
33
!classDefinition: 'LocaleID class' category: 'System-Locales'!
34
LocaleID class
35
	instanceVariableNames: ''!
36
37
38
!ISOLanguageDefinition commentStamp: '' prior: 0!
39
The language definitions from International Organization for Standardization.
40
41
You can obtain the list of the all the ISOCountries and languages.!
42
43
!Locale commentStamp: '<historical>' prior: 0!
44
Locale current
45
Locale current isoLanguage
46
Locale current isoCountry
47
48
49
References:
50
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
51
http://www.oasis-open.org/cover/iso639a.html
52
http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/language_code_issues.html
53
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.10
54
	
55
ISO 3166
56
http://mitglied.lycos.de/buran/knowhow/codes/locales/!
57
58
!LocaleID commentStamp: '' prior: 0!
59
The ID for localization!
60
61
!ISOLanguageDefinition methodsFor: 'accessing'!
62
iso2
63
	^iso2 ifNil: [self iso3]! !
64
65
!ISOLanguageDefinition methodsFor: 'accessing'!
66
iso2: aString
67
	iso2 _ aString ifEmpty: [nil] ifNotEmpty: [aString]! !
68
69
!ISOLanguageDefinition methodsFor: 'accessing'!
70
iso3
71
	^iso3 ifNil: ['']! !
72
73
!ISOLanguageDefinition methodsFor: 'accessing'!
74
iso3: aString
75
	iso3 _ aString ifEmpty: [nil] ifNotEmpty: [aString]! !
76
77
!ISOLanguageDefinition methodsFor: 'accessing'!
78
iso3Alternate
79
	^iso3Alternate ifNil: ['']! !
80
81
!ISOLanguageDefinition methodsFor: 'accessing'!
82
iso3Alternate: aString
83
	iso3Alternate _ aString ifEmpty: [nil] ifNotEmpty: [aString]! !
84
85
!ISOLanguageDefinition methodsFor: 'accessing'!
86
language
87
	^ language! !
88
89
!ISOLanguageDefinition methodsFor: 'accessing'!
90
language: aString
91
	language _ aString! !
92
93
!ISOLanguageDefinition class methodsFor: 'initialization'!
94
initialize
95
	"self initialize"
96
97
	ISO3Table _ nil.
98
	ISO2Table _ nil! !
99
100
!ISOLanguageDefinition class methodsFor: 'private'!
101
initISOCountries
102
	"self initISOCountries"
103
	| iso3166Table |
104
	iso3166Table _ self buildIso3166CodesTables.
105
	ISO2Countries _ Dictionary new.
106
	ISO3Countries _ Dictionary new.
107
	iso3166Table do: [:entry | 
108
		ISO2Countries at: (entry at: 2) put: (entry at: 1).
109
		ISO3Countries at: (entry at: 3) put: (entry at: 1)].
110
	! !
111
112
!ISOLanguageDefinition class methodsFor: 'private'!
113
isoLanguages
114
	"ISO 639: 3-letter codes"
115
	^'abk	ab	Abkhazian
116
ace		Achinese
117
ach		Acoli
118
ada		Adangme
119
aar	aa	Afar
120
afh		Afrihili
121
afr	af	Afrikaans
122
afa		Afro-Asiatic (Other)
123
aka		Akan
124
akk		Akkadian
125
alb/sqi	sq	Albanian
126
ale		Aleut
127
alg		Algonquian languages
128
tut		Altaic (Other)
129
amh	am	Amharic
130
apa		Apache languages
131
ara	ar	Arabic
132
arc		Aramaic
133
arp		Arapaho
134
arn		Araucanian
135
arw		Arawak
136
arm/hye	hy	Armenian
137
art		Artificial (Other)
138
asm	as	Assamese
139
ath		Athapascan languages
140
map		Austronesian (Other)
141
ava		Avaric
142
ave		Avestan
143
awa		Awadhi
144
aym	ay	Aymara
145
aze	az	Azerbaijani
146
nah		Aztec
147
ban		Balinese
148
bat		Baltic (Other)
149
bal		Baluchi
150
bam		Bambara
151
bai		Bamileke languages
152
bad		Banda
153
bnt		Bantu (Other)
154
bas		Basa
155
bak	ba	Bashkir
156
baq/eus	eu	Basque
157
bej		Beja
158
bem		Bemba
159
ben	bn	Bengali
160
ber		Berber (Other)
161
bho		Bhojpuri
162
bih	bh	Bihari
163
bik		Bikol
164
bin		Bini
165
bis	bi	Bislama
166
bra		Braj
167
bre	be	Breton
168
bug		Buginese
169
bul	bg	Bulgarian
170
bua		Buriat
171
bur/mya	my	Burmese
172
bel	be	Byelorussian
173
cad		Caddo
174
car		Carib
175
cat	ca	Catalan
176
cau		Caucasian (Other)
177
ceb		Cebuano
178
cel		Celtic (Other)
179
cai		Central American Indian (Other)
180
chg		Chagatai
181
cha		Chamorro
182
che		Chechen
183
chr		Cherokee
184
chy		Cheyenne
185
chb		Chibcha
186
chi/zho	zh	Chinese
187
chn		Chinook jargon
188
cho		Choctaw
189
chu		Church Slavic
190
chv		Chuvash
191
cop		Coptic
192
cor		Cornish
193
cos	co	Corsican
194
cre		Cree
195
mus		Creek
196
crp		Creoles and Pidgins (Other)
197
cpe		Creoles and Pidgins, English-based (Other)
198
cpf		Creoles and Pidgins, French-based (Other)
199
cpp		Creoles and Pidgins, Portuguese-based (Other)
200
cus		Cushitic (Other)
201
	hr	Croatian
202
ces/cze	cs	Czech
203
dak		Dakota
204
dan	da	Danish
205
del		Delaware
206
din		Dinka
207
div		Divehi
208
doi		Dogri
209
dra		Dravidian (Other)
210
dua		Duala
211
dut/nla	nl	Dutch
212
dum		Dutch, Middle (ca. 1050-1350)
213
dyu		Dyula
214
dzo	dz	Dzongkha
215
efi		Efik
216
egy		Egyptian (Ancient)
217
eka		Ekajuk
218
elx		Elamite
219
eng	en	English
220
enm		English, Middle (ca. 1100-1500)
221
ang		English, Old (ca. 450-1100)
222
esk		Eskimo (Other)
223
epo	eo	Esperanto
224
est	et	Estonian
225
ewe		Ewe
226
ewo		Ewondo
227
fan		Fang
228
fat		Fanti
229
fao	fo	Faroese
230
fij	fj	Fijian
231
fin	fi	Finnish
232
fiu		Finno-Ugrian (Other)
233
fon		Fon
234
fra/fre	fr	French
235
frm		French, Middle (ca. 1400-1600)
236
fro		French, Old (842- ca. 1400)
237
fry	fy	Frisian
238
ful		Fulah
239
gaa		Ga
240
gae/gdh		Gaelic (Scots)
241
glg	gl	Gallegan
242
lug		Ganda
243
gay		Gayo
244
gez		Geez
245
geo/kat	ka	Georgian
246
deu/ger	de	German
247
gmh		German, Middle High (ca. 1050-1500)
248
goh		German, Old High (ca. 750-1050)
249
gem		Germanic (Other)
250
gil		Gilbertese
251
gon		Gondi
252
got		Gothic
253
grb		Grebo
254
grc		Greek, Ancient (to 1453)
255
ell/gre	el	Greek, Modern (1453-)
256
kal	kl	Greenlandic
257
grn	gn	Guarani
258
guj	gu	Gujarati
259
hai		Haida
260
hau	ha	Hausa
261
haw		Hawaiian
262
heb	he	Hebrew
263
her		Herero
264
hil		Hiligaynon
265
him		Himachali
266
hin	hi	Hindi
267
hmo		Hiri Motu
268
hun	hu	Hungarian
269
hup		Hupa
270
iba		Iban
271
ice/isl	is	Icelandic
272
ibo		Igbo
273
ijo		Ijo
274
ilo		Iloko
275
inc		Indic (Other)
276
ine		Indo-European (Other)
277
ind	id	Indonesian
278
ina	ia	Interlingua (International Auxiliary language Association)
279
ine		 Interlingue
280
iku	iu	Inuktitut
281
ipk	ik	Inupiak
282
ira		Iranian (Other)
283
gai/iri	ga	Irish
284
sga		Irish, Old (to 900)
285
mga		Irish, Middle (900 - 1200)
286
iro		Iroquoian languages
287
ita	it	Italian
288
jpn	ja	Japanese
289
jav/jaw	jv/jw Javanese
290
jrb		Judeo-Arabic
291
jpr		Judeo-Persian
292
kab		Kabyle
293
kac		Kachin
294
kam		Kamba
295
kan	kn	Kannada
296
kau		Kanuri
297
kaa		Kara-Kalpak
298
kar		Karen
299
kas	ks	Kashmiri
300
kaw		Kawi
301
kaz	kk	Kazakh
302
kha		Khasi
303
khm	km	Khmer
304
khi		Khoisan (Other)
305
kho		Khotanese
306
kik		Kikuyu
307
kin	rw	Kinyarwanda
308
kir	ky	Kirghiz
309
kom		Komi
310
kon		Kongo
311
kok		Konkani
312
kor	ko	Korean
313
kpe		Kpelle
314
kro		Kru
315
kua		Kuanyama
316
kum		Kumyk
317
kur	ku	Kurdish
318
kru		Kurukh
319
kus		Kusaie
320
kut		Kutenai
321
lad		Ladino
322
lah		Lahnda
323
lam		Lamba
324
oci	oc	Langue d''Oc (post 1500)
325
lao	lo	Lao
326
lat	la	Latin
327
lav	lv	Latvian
328
ltz		Letzeburgesch
329
lez		Lezghian
330
lin	ln	Lingala
331
lit	lt	Lithuanian
332
loz		Lozi
333
lub		Luba-Katanga
334
lui		Luiseno
335
lun		Lunda
336
luo		Luo (Kenya and Tanzania)
337
mac/mak	mk	Macedonian
338
mad		Madurese
339
mag		Magahi
340
mai		Maithili
341
mak		Makasar
342
mlg	mg	Malagasy
343
may/msa	ms	Malay
344
mal		Malayalam
345
mlt	ml	Maltese
346
man		Mandingo
347
mni		Manipuri
348
mno		Manobo languages
349
max		Manx
350
mao/mri	mi	Maori
351
mar	mr	Marathi
352
chm		Mari
353
mah		Marshall
354
mwr		Marwari
355
mas		Masai
356
myn		Mayan languages
357
men		Mende
358
mic		Micmac
359
min		Minangkabau
360
mis		Miscellaneous (Other)
361
moh		Mohawk
362
mol	mo	Moldavian
363
mkh		Mon-Kmer (Other)
364
lol		Mongo
365
mon	mn	Mongolian
366
mos		Mossi
367
mul		Multiple languages
368
mun		Munda languages
369
nau	na	Nauru
370
nav		Navajo
371
nde		Ndebele, North
372
nbl		Ndebele, South
373
ndo		Ndongo
374
nep	ne	Nepali
375
new		Newari
376
nic		Niger-Kordofanian (Other)
377
ssa		Nilo-Saharan (Other)
378
niu		Niuean
379
non		Norse, Old
380
nai		North American Indian (Other)
381
nor	no	Norwegian
382
nno		Norwegian (Nynorsk)
383
nub		Nubian languages
384
nym		Nyamwezi
385
nya		Nyanja
386
nyn		Nyankole
387
nyo		Nyoro
388
nzi		Nzima
389
oji		Ojibwa
390
ori	or	Oriya
391
orm	om	Oromo
392
osa		Osage
393
oss		Ossetic
394
oto		Otomian languages
395
pal		Pahlavi
396
pau		Palauan
397
pli		Pali
398
pam		Pampanga
399
pag		Pangasinan
400
pan	pa	Panjabi
401
pap		Papiamento
402
paa		Papuan-Australian (Other)
403
fas/per	fa	Persian
404
peo		Persian, Old (ca 600 - 400 B.C.)
405
phn		Phoenician
406
pol	pl	Polish
407
pon		Ponape
408
por	pt	Portuguese
409
pra		Prakrit languages
410
pro		Provencal, Old (to 1500)
411
pus	ps	Pushto
412
que	qu	Quechua
413
roh	rm	Rhaeto-Romance
414
raj		Rajasthani
415
rar		Rarotongan
416
roa		Romance (Other)
417
ron/rum	ro	Romanian
418
rom		Romany
419
run	rn	Rundi
420
rus	ru	Russian
421
sal		Salishan languages
422
sam		Samaritan Aramaic
423
smi		Sami languages
424
smo	sm	Samoan
425
sad		Sandawe
426
sag	sg	Sango
427
san	sa	Sanskrit
428
srd		Sardinian
429
sco		Scots
430
sel		Selkup
431
sem		Semitic (Other)
432
	sr	Serbian
433
scr	sh	Serbo-Croatian
434
srr		Serer
435
shn		Shan
436
sna	sn	Shona
437
sid		Sidamo
438
bla		Siksika
439
snd	sd	Sindhi
440
sin	si	Singhalese
441
sit		Sino-Tibetan (Other)
442
sio		Siouan languages
443
sla		Slavic (Other)
444
ssw	ss	Siswant
445
slk/slo	sk	Slovak
446
slv	sl	Slovenian
447
sog		Sogdian
448
som	so	Somali
449
son		Songhai
450
wen		Sorbian languages
451
nso		Sotho, Northern
452
sot	st	Sotho, Southern
453
sai		South American Indian (Other)
454
esl/spa	es	Spanish
455
suk		Sukuma
456
sux		Sumerian
457
sun	su	Sudanese
458
sus		Susu
459
swa	sw	Swahili
460
ssw		Swazi
461
sve/swe	sv	Swedish
462
syr		Syriac
463
tgl	tl	Tagalog
464
tah		Tahitian
465
tgk	tg	Tajik
466
tmh		Tamashek
467
tam	ta	Tamil
468
tat	tt	Tatar
469
tel	te	Telugu
470
ter		Tereno
471
tha	th	Thai
472
bod/tib	bo	Tibetan
473
tig		Tigre
474
tir	ti	Tigrinya
475
tem		Timne
476
tiv		Tivi
477
tli		Tlingit
478
tog	to	Tonga (Nyasa)
479
ton		Tonga (Tonga Islands)
480
tru		Truk
481
tsi		Tsimshian
482
tso	ts	Tsonga
483
tsn	tn	Tswana
484
tum		Tumbuka
485
tur	tr	Turkish
486
ota		Turkish, Ottoman (1500 - 1928)
487
tuk	tk	Turkmen
488
tyv		Tuvinian
489
twi	tw	Twi
490
uga		Ugaritic
491
uig	ug	Uighur
492
ukr	uk	Ukrainian
493
umb		Umbundu
494
und		Undetermined
495
urd	ur	Urdu
496
uzb	uz	Uzbek
497
vai		Vai
498
ven		Venda
499
vie	vi	Vietnamese
500
vol	vo	Volapük
501
vot		Votic
502
wak		Wakashan languages
503
wal		Walamo
504
war		Waray
505
was		Washo
506
cym/wel	cy	Welsh
507
wol	wo	Wolof
508
xho	xh	Xhosa
509
sah		Yakut
510
yao		Yao
511
yap		Yap
512
yid	yi	Yiddish
513
yor	yo	Yoruba
514
zap		Zapotec
515
zen		Zenaga
516
zha	za	Zhuang
517
zul	zu	Zulu
518
zun		Zuni'! !
519
520
!ISOLanguageDefinition class methodsFor: 'private'!
521
readISOLanguagesFrom: stream
522
	"self readISOLanguagesFrom: self isoLanguages readStream "
523
	| languages language code3 index line |
524
	languages _ Dictionary new.
525
	[stream atEnd
526
		or: [(line _ stream nextLine readStream) atEnd]]
527
		whileFalse: [
528
			language _ self new.
529
			code3 _ line upTo: Character tab.
530
			(index _ code3 indexOf: $/) > 0
531
				ifTrue: [
532
					language iso3: (code3 copyFrom: 1 to: index-1).
533
					language iso3Alternate: (code3 copyFrom: index+1 to: code3 size)]
534
				ifFalse: [language iso3: code3].
535
			language
536
				iso2: (line upTo: Character tab);
537
				language: line upToEnd.
538
			languages at: language iso3 put: language].
539
	^languages! !
540
541
!ISOLanguageDefinition class methodsFor: 'accessing'!
542
iso2LanguageDefinition: aString
543
	^self iso2LanguageTable at: aString! !
544
545
!ISOLanguageDefinition class methodsFor: 'accessing'!
546
iso3LanguageDefinition: aString
547
	^self iso3LanguageTable at: aString! !
548
549
!ISOLanguageDefinition class methodsFor: 'private - ISO 2'!
550
iso2Countries
551
	"self iso2Countries"
552
	"ISO2Countries _ nil. ISO3Countries := nil"
553
554
	ISO2Countries ifNil: [self initISOCountries].
555
	^ISO2Countries! !
556
557
!ISOLanguageDefinition class methodsFor: 'private - ISO 2'!
558
iso2LanguageTable
559
	"self iso2LanguageTable"
560
561
	ISO2Table ifNotNil: [^ISO2Table].
562
	ISO2Table _ Dictionary new: self iso3LanguageTable basicSize.
563
	self iso3LanguageTable do: [:entry |
564
		ISO2Table at: entry iso2 put: entry].
565
	^ISO2Table! !
566
567
!ISOLanguageDefinition class methodsFor: 'private - ISO 3166'!
568
buildIso3166CodesTables
569
	"ISOLanguageDefinition buildIso3166CodesTables"
570
	| rawdata stream country isoa2 isoa3 unNumeric macName macCode windowsName windowsCode empty table |
571
	rawdata _ self iso3166Codes.
572
	table _ OrderedCollection new: 200. 
573
	stream _ rawdata readStream.
574
	empty _ 160 asCharacter asString.
575
	[stream atEnd] whileFalse: 
576
		[country _ stream nextLine.
577
		isoa2 _ stream nextLine.
578
		isoa3 _ stream nextLine.
579
		unNumeric _ stream nextLine.
580
		windowsName _ stream nextLine.
581
		windowsName = empty ifTrue: [windowsName _ nil].
582
		windowsCode _ stream nextLine. 
583
		windowsCode = empty ifTrue: [windowsCode _ nil].
584
		macName _ stream nextLine.
585
		macName = empty ifTrue: [macName _ nil].
586
		macCode _ stream nextLine.
587
		macCode = empty ifTrue: [macCode _ nil].
588
		table add: { country.  isoa2. isoa3.  unNumeric. windowsName.  windowsCode.  macName. macCode. }].
589
	^table! !
590
591
!ISOLanguageDefinition class methodsFor: 'private - ISO 3166'!
592
initISO3LanguageTable
593
	"self  initISO3LanguageTable"
594
	
595
	^ self readISOLanguagesFrom: self isoLanguages readStream.
596
	! !
597
598
!ISOLanguageDefinition class methodsFor: 'private - ISO 3166'!
599
iso3166Codes
600
	"http://www.unicode.org/onlinedat/countries.html"
601
602
^'Ã…LAND ISLANDS
603
AX
604
605
606
 
607
 
608
 
609
 
610
AFGHANISTAN
611
AF
612
AFG
613
004
614
 
615
 
616
 
617
 
618
ALBANIA
619
AL
620
ALB
621
008
622
CTRY_ALBANIA
623
355
624
 
625
 
626
ALGERIA
627
DZ
628
DZA
629
012
630
CTRY_ALGERIA
631
213
632
verArabic
633
16
634
AMERICAN SAMOA
635
AS
636
ASM
637
016
638
 
639
 
640
 
641
 
642
ANDORRA
643
AD
644
AND
645
020
646
 
647
 
648
 
649
 
650
ANGOLA
651
AO
652
AGO
653
024
654
 
655
 
656
 
657
 
658
ANGUILLA
659
AI
660
AIA
661
660
662
 
663
 
664
 
665
 
666
ANTARCTICA
667
AQ
668
ATA
669
010
670
 
671
 
672
 
673
 
674
ANTIGUA AND BARBUDA
675
AG
676
ATG
677
028
678
 
679
 
680
 
681
 
682
ARGENTINA
683
AR
684
ARG
685
032
686
CTRY_ARGENTINA
687
54
688
 
689
 
690
ARMENIA
691
AM
692
ARM
693
051
694
CTRY_ARMENIA
695
374
696
verArmenian
697
84
698
ARUBA
699
AW
700
ABW
701
533
702
 
703
 
704
 
705
 
706
AUSTRALIA
707
AU
708
AUS
709
036
710
CTRY_AUSTRALIA
711
61
712
verAustralia
713
15
714
AUSTRIA
715
AT
716
AUT
717
040
718
CTRY_AUSTRIA
719
43
720
verAustria
721
92
722
AZERBAIJAN
723
AZ
724
AZE
725
031
726
CTRY_AZERBAIJAN
727
994
728
 
729
 
730
BAHAMAS
731
BS
732
BHS
733
044
734
 
735
 
736
 
737
 
738
BAHRAIN
739
BH
740
BHR
741
048
742
CTRY_BAHRAIN
743
973
744
 
745
 
746
BANGLADESH
747
BD
748
BGD
749
050
750
 
751
 
752
verBengali
753
60
754
BARBADOS
755
BB
756
BRB
757
052
758
 
759
 
760
 
761
 
762
BELARUS
763
BY
764
BLR
765
112
766
CTRY_BELARUS
767
375
768
 
769
 
770
BELGIUM
771
BE
772
BEL
773
056
774
CTRY_BELGIUM
775
32
776
verFrBelgium, verFlemish
777
98
778
BELIZE
779
BZ
780
BLZ
781
084
782
CTRY_BELIZE
783
501
784
 
785
 
786
BENIN
787
BJ
788
BEN
789
204
790
 
791
 
792
 
793
 
794
BERMUDA
795
BM
796
BMU
797
060
798
 
799
 
800
 
801
 
802
BHUTAN
803
BT
804
BTN
805
064
806
 
807
 
808
verBhutan
809
83
810
BOLIVIA
811
BO
812
BOL
813
068
814
CTRY_BOLIVIA
815
591
816
 
817
 
818
BOSNIA AND HERZEGOVINA
819
BA
820
BIH
821
070
822
 
823
 
824
 
825
 
826
BOTSWANA
827
BW
828
BWA
829
072
830
 
831
 
832
 
833
 
834
BOUVET ISLAND
835
BV
836
BVT
837
074
838
 
839
 
840
 
841
 
842
BRAZIL
843
BR
844
BRA
845
076
846
CTRY_BRAZIL
847
55
848
verBrazil
849
71
850
BRITISH INDIAN OCEAN TERRITORY
851
IO
852
IOT
853
086
854
 
855
 
856
 
857
 
858
BRUNEI DARUSSALAM
859
BN
860
BRN
861
096
862
CTRY_BRUNEI_DARUSSALAM
863
673
864
 
865
 
866
BULGARIA
867
BG
868
BGR
869
100
870
CTRY_BULGARIA
871
359
872
verBulgaria 
873
72
874
BURKINA FASO
875
BF
876
BFA
877
854
878
 
879
 
880
 
881
 
882
BURUNDI
883
BI
884
BDI
885
108
886
 
887
 
888
 
889
 
890
CAMBODIA
891
KH
892
KHM
893
116
894
 
895
 
896
 
897
 
898
CAMEROON
899
CM
900
CMR
901
120
902
 
903
 
904
 
905
 
906
CANADA
907
CA
908
CAN
909
124
910
CTRY_CANADA
911
2
912
verFrCanada, verEndCanada
913
82
914
CAPE VERDE
915
CV
916
CPV
917
132
918
 
919
 
920
 
921
 
922
CAYMAN ISLANDS
923
KY
924
CYM
925
136
926
 
927
 
928
 
929
 
930
CENTRAL AFRICAN REPUBLIC
931
CF
932
CAF
933
140
934
 
935
 
936
 
937
 
938
CHAD
939
TD
940
TCD
941
148
942
 
943
 
944
 
945
 
946
CHILE
947
CL
948
CHL
949
152
950
CTRY_CHILE
951
56
952
 
953
 
954
CHINA
955
CN
956
CHN
957
156
958
CTRY_PRCHINA
959
86
960
verChina
961
52
962
CHRISTMAS ISLAND
963
CX
964
CXR
965
162
966
 
967
 
968
 
969
 
970
COCOS (KEELING) ISLANDS
971
CC
972
CCK
973
166
974
 
975
 
976
 
977
 
978
COLOMBIA
979
CO
980
COL
981
170
982
CTRY_COLOMBIA
983
57
984
 
985
 
986
COMOROS
987
KM
988
COM
989
174
990
 
991
 
992
 
993
 
994
CONGO
995
CG
996
COG
997
178
998
 
999
 
1000
 
1001
 
1002
CONGO, THE DEMOCRATIC REPUBLIC OF THE
1003
CD
1004
1005
1006
 
1007
 
1008
 
1009
 
1010
COOK ISLANDS
1011
CK
1012
COK
1013
184
1014
 
1015
 
1016
 
1017
 
1018
COSTA RICA
1019
CR
1020
CRI
1021
188
1022
CTRY_COSTA_RICA
1023
506
1024
 
1025
 
1026
COTE D''IVOIRE
1027
CI
1028
CIV
1029
384
1030
 
1031
 
1032
 
1033
 
1034
CROATIA (local name: Hrvatska)
1035
HR
1036
HRV
1037
191
1038
CTRY_CROATIA
1039
385
1040
verCroatia, verYugoCroatian
1041
68 (c), 25 (y)
1042
CUBA
1043
CU
1044
CUB
1045
192
1046
 
1047
 
1048
 
1049
 
1050
CYPRUS
1051
CY
1052
CYP
1053
196
1054
 
1055
 
1056
verCyprus
1057
23
1058
CZECH REPUBLIC
1059
CZ
1060
CZE
1061
203
1062
CTRY_CZECH
1063
420
1064
verCzech 
1065
56
1066
DENMARK
1067
DK
1068
DNK
1069
208
1070
CTRY_DENMARK
1071
45
1072
verDenmark(da), verFaeroeIsl(fo)
1073
9(da), 47(fo)
1074
DJIBOUTI
1075
DJ
1076
DJI
1077
262
1078
 
1079
 
1080
 
1081
 
1082
DOMINICA
1083
DM
1084
DMA
1085
212
1086
 
1087
 
1088
 
1089
 
1090
DOMINICAN REPUBLIC
1091
DO
1092
DOM
1093
214
1094
CTRY_DOMINICAN_REPUBLIC
1095
1
1096
 
1097
 
1098
EAST TIMOR
1099
TL
1100
TLS
1101
626
1102
 
1103
 
1104
 
1105
 
1106
ECUADOR
1107
EC
1108
ECU
1109
218
1110
CTRY_ECUADOR
1111
593
1112
 
1113
 
1114
EGYPT
1115
EG
1116
EGY
1117
818
1118
CTRY_EGYPT
1119
20
1120
verArabic
1121
16
1122
EL SALVADOR
1123
SV
1124
SLV
1125
222
1126
CTRY_EL_SALVADOR
1127
503
1128
 
1129
 
1130
EQUATORIAL GUINEA
1131
GQ
1132
GNQ
1133
226
1134
 
1135
 
1136
 
1137
 
1138
ERITREA
1139
ER
1140
ERI
1141
232
1142
 
1143
 
1144
 
1145
 
1146
ESTONIA
1147
EE
1148
EST
1149
233
1150
CTRY_ESTONIA
1151
372
1152
verEstonia
1153
44
1154
ETHIOPIA
1155
ET
1156
ETH
1157
210
1158
 
1159
 
1160
 
1161
 
1162
FALKLAND ISLANDS (MALVINAS)
1163
FK
1164
FLK
1165
238
1166
 
1167
 
1168
 
1169
 
1170
FAROE ISLANDS
1171
FO
1172
FRO
1173
234
1174
CTRY_FAEROE_ISLANDS
1175
298
1176
 
1177
 
1178
FIJI
1179
FJ
1180
FJI
1181
242
1182
 
1183
 
1184
 
1185
 
1186
FINLAND
1187
FI
1188
FIN
1189
246
1190
CTRY_FINLAND
1191
358
1192
verFinland
1193
17
1194
FRANCE
1195
FR
1196
FRA
1197
250
1198
CTRY_FRANCE
1199
33
1200
verFrance
1201
1
1202
FRANCE, METROPOLITAN
1203
FX
1204
FXX
1205
249
1206
 
1207
 
1208
 
1209
 
1210
FRENCH GUIANA
1211
GF
1212
GUF
1213
254
1214
 
1215
 
1216
 
1217
 
1218
FRENCH POLYNESIA
1219
PF
1220
PYF
1221
258
1222
 
1223
 
1224
 
1225
 
1226
FRENCH SOUTHERN TERRITORIES
1227
TF
1228
ATF
1229
260
1230
 
1231
 
1232
 
1233
 
1234
GABON
1235
GA
1236
GAB
1237
266
1238
 
1239
 
1240
 
1241
 
1242
GAMBIA
1243
GM
1244
GMB
1245
270
1246
 
1247
 
1248
 
1249
 
1250
GEORGIA
1251
GE
1252
GEO
1253
268
1254
CTRY_GEORGIA
1255
995
1256
verGeorgian
1257
85
1258
GERMANY
1259
DE
1260
DEU
1261
276
1262
CTRY_GERMANY
1263
49
1264
verGermany
1265
3
1266
GHANA
1267
GH
1268
GHA
1269
288
1270
 
1271
 
1272
 
1273
 
1274
GIBRALTAR
1275
GI
1276
GIB
1277
292
1278
 
1279
 
1280
 
1281
 
1282
GREECE
1283
GR
1284
GRC
1285
300
1286
CTRY_GREECE
1287
30
1288
verGreece, verGreecePoly
1289
20, 40
1290
GREENLAND
1291
GL
1292
GRL
1293
304
1294
 
1295
 
1296
verGreenland
1297
107
1298
GRENADA
1299
GD
1300
GRD
1301
308
1302
 
1303
 
1304
 
1305
 
1306
GUADELOUPE
1307
GP
1308
GLP
1309
312
1310
 
1311
 
1312
 
1313
 
1314
GUAM
1315
GU
1316
GUM
1317
316
1318
 
1319
 
1320
 
1321
 
1322
GUATEMALA
1323
GT
1324
GTM
1325
320
1326
CTRY_GUATEMALA
1327
502
1328
 
1329
 
1330
GUINEA
1331
GN
1332
GIN
1333
324
1334
 
1335
 
1336
 
1337
 
1338
GUINEA-BISSAU
1339
GW
1340
GNB
1341
624
1342
 
1343
 
1344
 
1345
 
1346
GUYANA
1347
GY
1348
GUY
1349
328
1350
 
1351
 
1352
 
1353
 
1354
HAITI
1355
HT
1356
HTI
1357
332
1358
 
1359
 
1360
 
1361
 
1362
HEARD ISLAND & MCDONALD ISLANDS
1363
HM
1364
HMD
1365
334
1366
 
1367
 
1368
 
1369
 
1370
HONDURAS
1371
HN
1372
HND
1373
340
1374
CTRY_HONDURAS
1375
504
1376
 
1377
 
1378
HONG KONG
1379
HK
1380
HKG
1381
344
1382
CTRY_HONG_KONG
1383
852
1384
 
1385
 
1386
HUNGARY
1387
HU
1388
HUN
1389
348
1390
CTRY_HUNGARY
1391
36
1392
verHungary
1393
43
1394
ICELAND
1395
IS
1396
ISL
1397
352
1398
CTRY_ICELAND
1399
354
1400
verIceland
1401
21
1402
INDIA
1403
IN
1404
IND
1405
356
1406
CTRY_INDIA
1407
91
1408
verIndiaHindi(hi)
1409
33
1410
INDONESIA
1411
ID
1412
IDN
1413
360
1414
CTRY_INDONESIA
1415
62
1416
 
1417
 
1418
IRAN, ISLAMIC REPUBLIC OF
1419
IR
1420
IRN
1421
364
1422
CTRY_IRAN
1423
981
1424
verIran
1425
48
1426
IRAQ
1427
IQ
1428
IRQ
1429
368
1430
CTRY_IRAQ
1431
964
1432
verArabic
1433
16
1434
IRELAND
1435
IE
1436
IRL
1437
372
1438
CTRY_IRELAND
1439
353
1440
verIreland
1441
50
1442
ISRAEL
1443
IL
1444
ISR
1445
376
1446
CTRY_ISRAEL
1447
972
1448
verIsrael
1449
13
1450
ITALY
1451
IT
1452
ITA
1453
380
1454
CTRY_ITALY
1455
39
1456
verItaly
1457
4
1458
JAMAICA
1459
JM
1460
JAM
1461
388
1462
CTRY_JAMAICA
1463
1
1464
 
1465
 
1466
JAPAN
1467
JP
1468
JPN
1469
392
1470
CTRY_JAPAN
1471
81
1472
verJapan
1473
14
1474
JORDAN
1475
JO
1476
JOR
1477
400
1478
CTRY_JORDAN
1479
962
1480
 
1481
 
1482
KAZAKHSTAN
1483
KZ
1484
KAZ
1485
398
1486
CTRY_KAZAKSTAN
1487
7
1488
 
1489
 
1490
KENYA
1491
KE
1492
KEN
1493
404
1494
CTRY_KENYA
1495
254
1496
 
1497
 
1498
KIRIBATI
1499
KI
1500
KIR
1501
296
1502
 
1503
 
1504
 
1505
 
1506
KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF
1507
KP
1508
PRK
1509
408
1510
 
1511
 
1512
verKorea
1513
51
1514
KOREA, REPUBLIC OF
1515
KR
1516
KOR
1517
410
1518
CTRY_SOUTH_KOREA
1519
82
1520
verKorea
1521
 
1522
KUWAIT
1523
KW
1524
KWT
1525
414
1526
CTRY_KUWAIT
1527
965
1528
 
1529
 
1530
KYRGYZSTAN
1531
KG
1532
KGZ
1533
417
1534
CTRY_KYRGYZSTAN
1535
996
1536
 
1537
 
1538
LAO PEOPLE''S DEMOCRATIC REPUBLIC
1539
LA
1540
LAO
1541
418
1542
 
1543
 
1544
 
1545
 
1546
LATVIA
1547
LV
1548
LVA
1549
428
1550
CTRY_LATVIA
1551
371
1552
verLatvia
1553
45
1554
LEBANON
1555
LB
1556
LBN
1557
422
1558
CTRY_LEBANON
1559
961
1560
 
1561
 
1562
LESOTHO
1563
LS
1564
LSO
1565
426
1566
 
1567
 
1568
 
1569
 
1570
LIBERIA
1571
LR
1572
LBR
1573
430
1574
 
1575
 
1576
 
1577
 
1578
LIBYAN ARAB JAMAHIRIYA
1579
LY
1580
LBY
1581
434
1582
CTRY_LIBYA
1583
218
1584
verArabic
1585
16
1586
LIECHTENSTEIN
1587
LI
1588
LIE
1589
438
1590
CTRY_LIECHTENSTEIN
1591
41
1592
 
1593
 
1594
LITHUANIA
1595
LT
1596
LTU
1597
440
1598
CTRY_LITHUANIA
1599
370
1600
verLithuania
1601
41
1602
LUXEMBOURG
1603
LU
1604
LUX
1605
442
1606
CTRY_LUXEMBOURG
1607
352
1608
verFrBelgiumLux
1609
6
1610
MACAU
1611
MO
1612
MAC
1613
446
1614
CTRY_MACAU
1615
853
1616
 
1617
 
1618
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF
1619
MK
1620
MKD
1621
807
1622
CTRY_MACEDONIA
1623
389
1624
verMacedonian
1625
 
1626
MADAGASCAR
1627
MG
1628
MDG
1629
450
1630
 
1631
 
1632
 
1633
 
1634
MALAWI
1635
MW
1636
MWI
1637
454
1638
 
1639
 
1640
 
1641
 
1642
MALAYSIA
1643
MY
1644
MYS
1645
458
1646
CTRY_MALAYSIA
1647
60
1648
 
1649
 
1650
MALDIVES
1651
MV
1652
MDV
1653
462
1654
CTRY_MALDIVES
1655
960
1656
 
1657
 
1658
MALI
1659
ML
1660
MLI
1661
466
1662
 
1663
 
1664
 
1665
 
1666
MALTA
1667
MT
1668
MLT
1669
470
1670
 
1671
 
1672
verMalta
1673
22
1674
MARSHALL ISLANDS
1675
MH
1676
MHL
1677
584
1678
 
1679
 
1680
 
1681
 
1682
MARTINIQUE
1683
MQ
1684
MTQ
1685
474
1686
 
1687
 
1688
 
1689
 
1690
MAURITANIA
1691
MR
1692
MRT
1693
478
1694
 
1695
 
1696
 
1697
 
1698
MAURITIUS
1699
MU
1700
MUS
1701
480
1702
 
1703
 
1704
 
1705
 
1706
MAYOTTE
1707
YT
1708
MYT
1709
175
1710
 
1711
 
1712
 
1713
 
1714
MEXICO
1715
MX
1716
MEX
1717
484
1718
CTRY_MEXICO
1719
52
1720
 
1721
 
1722
MICRONESIA, FEDERATED STATES OF
1723
FM
1724
FSM
1725
583
1726
 
1727
 
1728
 
1729
 
1730
MOLDOVA, REPUBLIC OF
1731
MD
1732
MDA
1733
498
1734
 
1735
 
1736
 
1737
 
1738
MONACO
1739
MC
1740
MCO
1741
492
1742
CTRY_MONACO
1743
33
1744
 
1745
 
1746
MONGOLIA
1747
MN
1748
MNG
1749
496
1750
CTRY_MONGOLIA
1751
976
1752
 
1753
 
1754
MONTSERRAT
1755
MS
1756
MSR
1757
500
1758
 
1759
 
1760
 
1761
 
1762
MOROCCO
1763
MA
1764
MAR
1765
504
1766
CTRY_MOROCCO
1767
212
1768
verArabic
1769
16
1770
MOZAMBIQUE
1771
MZ
1772
MOZ
1773
508
1774
 
1775
 
1776
 
1777
 
1778
MYANMAR
1779
MM
1780
MMR
1781
104
1782
 
1783
 
1784
 
1785
 
1786
NAMIBIA
1787
NA
1788
NAM
1789
516
1790
 
1791
 
1792
 
1793
 
1794
NAURU
1795
NR
1796
NRU
1797
520
1798
 
1799
 
1800
 
1801
 
1802
NEPAL
1803
NP
1804
NPL
1805
524
1806
 
1807
 
1808
verNepal
1809
106
1810
NETHERLANDS
1811
NL
1812
NLD
1813
528
1814
CTRY_NETHERLANDS
1815
31
1816
verNetherlands
1817
5
1818
NETHERLANDS ANTILLES
1819
AN
1820
ANT
1821
530
1822
 
1823
 
1824
 
1825
 
1826
NEW CALEDONIA
1827
NC
1828
NCL
1829
540
1830
 
1831
 
1832
 
1833
 
1834
NEW ZEALAND
1835
NZ
1836
NZL
1837
554
1838
CTRY_NEW_ZEALAND
1839
64
1840
 
1841
 
1842
NICARAGUA
1843
NI
1844
NIC
1845
558
1846
CTRY_NICARAGUA
1847
505
1848
 
1849
 
1850
NIGER
1851
NE
1852
NER
1853
562
1854
 
1855
 
1856
 
1857
 
1858
NIGERIA
1859
NG
1860
NGA
1861
566
1862
 
1863
 
1864
 
1865
 
1866
NIUE
1867
NU
1868
NIU
1869
570
1870
 
1871
 
1872
 
1873
 
1874
NORFOLK ISLAND
1875
NF
1876
NFK
1877
574
1878
 
1879
 
1880
 
1881
 
1882
NORTHERN MARIANA ISLANDS
1883
MP
1884
MNP
1885
580
1886
 
1887
 
1888
 
1889
 
1890
NORWAY
1891
NO
1892
NOR
1893
578
1894
CTRY_NORWAY
1895
47
1896
verNorway
1897
12
1898
OMAN
1899
OM
1900
OMN
1901
512
1902
CTRY_OMAN
1903
968
1904
 
1905
 
1906
PAKISTAN
1907
PK
1908
PAK
1909
586
1910
CTRY_PAKISTAN
1911
92
1912
verPakistanUrdu, verPunjabi
1913
34 (U), 95 (P)
1914
PALAU
1915
PW
1916
PLW
1917
585
1918
 
1919
 
1920
 
1921
 
1922
PANAMA
1923
PA
1924
PAN
1925
591
1926
CTRY_PANAMA
1927
507
1928
 
1929
 
1930
PALESTINIAN TERRITORY, OCCUPIED
1931
PS
1932
1933
1934
1935
1936
 
1937
 
1938
PAPUA NEW GUINEA
1939
PG
1940
PNG
1941
598
1942
 
1943
 
1944
 
1945
 
1946
PARAGUAY
1947
PY
1948
PRY
1949
600
1950
CTRY_PARAGUAY
1951
595
1952
 
1953
 
1954
PERU
1955
PE
1956
PER
1957
604
1958
CTRY_PERU
1959
51
1960
 
1961
 
1962
PHILIPPINES
1963
PH
1964
PHL
1965
608
1966
CTRY_PHILIPPINES
1967
63
1968
 
1969
 
1970
PITCAIRN
1971
PN
1972
PCN
1973
612
1974
 
1975
 
1976
 
1977
 
1978
POLAND
1979
PL
1980
POL
1981
616
1982
CTRY_POLAND
1983
48
1984
verPoland
1985
42
1986
PORTUGAL
1987
PT
1988
PRT
1989
620
1990
CTRY_PORTUGAL
1991
351
1992
verPortugal
1993
10
1994
PUERTO RICO
1995
PR
1996
PRI
1997
630
1998
CTRY_PUERTO_RICO
1999
1
2000
 
2001
 
2002
QATAR
2003
QA
2004
QAT
2005
634
2006
CTRY_QATAR
2007
974
2008
 
2009
 
2010
REUNION
2011
RE
2012
REU
2013
638
2014
 
2015
 
2016
 
2017
 
2018
ROMANIA
2019
RO
2020
ROU*
2021
642
2022
CTRY_ROMANIA
2023
40
2024
verRomania
2025
39
2026
RUSSIAN FEDERATION
2027
RU
2028
RUS
2029
643
2030
CTRY_RUSSIA
2031
7
2032
verRussia
2033
49
2034
RWANDA
2035
RW
2036
RWA
2037
646
2038
 
2039
 
2040
 
2041
 
2042
SAINT KITTS AND NEVIS
2043
KN
2044
KNA
2045
659
2046
 
2047
 
2048
 
2049
 
2050
SAINT LUCIA
2051
LC
2052
LCA
2053
662
2054
 
2055
 
2056
 
2057
 
2058
SAINT VINCENT AND THE GRENADINES
2059
VC
2060
VCT
2061
670
2062
 
2063
 
2064
 
2065
 
2066
SAMOA
2067
WS
2068
WSM
2069
882
2070
 
2071
 
2072
 
2073
 
2074
SAN MARINO
2075
SM
2076
SMR
2077
674
2078
 
2079
 
2080
 
2081
 
2082
SAO TOME AND PRINCIPE
2083
ST
2084
STP
2085
678
2086
 
2087
 
2088
 
2089
 
2090
SAUDI ARABIA
2091
SA
2092
SAU
2093
682
2094
CTRY_SAUDI_ARABIA
2095
966
2096
verArabic
2097
16
2098
SENEGAL
2099
SN
2100
SEN
2101
686
2102
 
2103
 
2104
 
2105
 
2106
SERBIA AND MONTENEGRO
2107
CS
2108
 
2109
 
2110
CTRY_SERBIA
2111
381
2112
 
2113
 
2114
SEYCHELLES
2115
SC
2116
SYC
2117
690
2118
 
2119
 
2120
 
2121
 
2122
SIERRA LEONE
2123
SL
2124
SLE
2125
694
2126
 
2127
 
2128
 
2129
 
2130
SINGAPORE
2131
SG
2132
SGP
2133
702
2134
CTRY_SINGAPORE
2135
65
2136
verSingapore
2137
100
2138
SLOVAKIA (Slovak Republic)
2139
SK
2140
SVK
2141
703
2142
CTRY_SLOVAK
2143
421
2144
verSlovak
2145
57 
2146
SLOVENIA
2147
SI
2148
SVN
2149
705
2150
CTRY_SLOVENIA
2151
386
2152
verSlovenian
2153
66
2154
SOLOMON ISLANDS
2155
SB
2156
SLB
2157
90
2158
 
2159
 
2160
 
2161
 
2162
SOMALIA
2163
SO
2164
SOM
2165
706
2166
 
2167
 
2168
 
2169
 
2170
SOUTH AFRICA
2171
ZA
2172
ZAF
2173
710
2174
CTRY_SOUTH_AFRICA
2175
27
2176
 
2177
 
2178
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS
2179
GS
2180
2181
2182
2183
2184
 
2185
 
2186
SPAIN
2187
ES
2188
ESP
2189
724
2190
CTRY_SPAIN
2191
34
2192
verSpain
2193
8
2194
SRI LANKA
2195
LK
2196
LKA
2197
144
2198
 
2199
 
2200
 
2201
 
2202
SAINT HELENA
2203
SH
2204
SHN
2205
654
2206
 
2207
 
2208
 
2209
 
2210
SAINT PIERRE AND MIQUELON
2211
PM
2212
SPM
2213
666
2214
 
2215
 
2216
 
2217
 
2218
SUDAN
2219
SD
2220
SDN
2221
736
2222
 
2223
 
2224
 
2225
 
2226
SURINAME
2227
SR
2228
SUR
2229
740
2230
 
2231
 
2232
 
2233
 
2234
SVALBARD AND JAN MAYEN ISLANDS
2235
SJ
2236
SJM
2237
744
2238
 
2239
 
2240
 
2241
 
2242
SWAZILAND
2243
SZ
2244
SWZ
2245
748
2246
 
2247
 
2248
 
2249
 
2250
SWEDEN
2251
SE
2252
SWE
2253
752
2254
CTRY_SWEDEN
2255
46
2256
verSweden
2257
7
2258
SWITZERLAND
2259
CH
2260
CHE
2261
756
2262
CTRY_SWITZERLAND
2263
41
2264
verFrSwiss(fr), verGrSwiss(de)
2265
18(fr), 19(de)
2266
SYRIAN ARAB REPUBLIC
2267
SY
2268
SYR
2269
760
2270
CTRY_SYRIA
2271
963
2272
 
2273
 
2274
TAIWAN, PROVINCE OF CHINA
2275
TW
2276
TWN
2277
158
2278
CTRY_TAIWAN
2279
886
2280
verTaiwan
2281
53
2282
TAJIKISTAN
2283
TJ
2284
TJK
2285
762
2286
 
2287
 
2288
 
2289
 
2290
TANZANIA, UNITED REPUBLIC OF
2291
TZ
2292
TZA
2293
834
2294
 
2295
 
2296
 
2297
 
2298
TATARSTAN
2299
2300
2301
 
2302
CTRY_TATARSTAN
2303
7
2304
 
2305
 
2306
THAILAND
2307
TH
2308
THA
2309
764
2310
CTRY_THAILAND
2311
66
2312
verThailand
2313
54
2314
TIMOR-LESTE
2315
TL
2316
2317
2318
 
2319
 
2320
 
2321
 
2322
TOGO
2323
TG
2324
TGO
2325
768
2326
 
2327
 
2328
 
2329
 
2330
TOKELAU
2331
TK
2332
TKL
2333
772
2334
 
2335
 
2336
 
2337
 
2338
TONGA
2339
TO
2340
TON
2341
776
2342
 
2343
 
2344
verTonga
2345
88
2346
TRINIDAD AND TOBAGO
2347
TT
2348
TTO
2349
780
2350
CTRY_TRINIDAD_Y_TOBAGO
2351
1
2352
 
2353
 
2354
TUNISIA
2355
TN
2356
TUN
2357
788
2358
CTRY_TUNISIA
2359
216
2360
verArabic
2361
16
2362
TURKEY
2363
TR
2364
TUR
2365
792
2366
CTRY_TURKEY
2367
90
2368
verTurkey
2369
24
2370
TURKMENISTAN
2371
TM
2372
TKM
2373
795
2374
 
2375
 
2376
 
2377
 
2378
TURKS AND CAICOS ISLANDS
2379
TC
2380
TCA
2381
796
2382
 
2383
 
2384
 
2385
 
2386
TUVALU
2387
TV
2388
TUV
2389
798
2390
 
2391
 
2392
 
2393
 
2394
UGANDA
2395
UG
2396
UGA
2397
800
2398
 
2399
 
2400
 
2401
 
2402
UKRAINE
2403
UA
2404
UKR
2405
804
2406
CTRY_UKRAINE
2407
380
2408
verUkraine 
2409
62
2410
UNITED ARAB EMIRATES
2411
AE
2412
ARE
2413
784
2414
CTRY_UAE
2415
971
2416
 
2417
 
2418
UNITED KINGDOM
2419
GB
2420
GBR
2421
826
2422
CTRY_UNITED_KINGDOM
2423
44
2424
verBritain
2425
2
2426
UNITED STATES
2427
US
2428
USA
2429
840
2430
CTRY_UNITED_STATES
2431
1
2432
verUS
2433
0
2434
UNITED STATES MINOR OUTLYING ISLANDS
2435
UM
2436
UMI
2437
581
2438
 
2439
 
2440
 
2441
 
2442
URUGUAY
2443
UY
2444
URY
2445
858
2446
CTRY_URUGUAY
2447
598
2448
 
2449
 
2450
UZBEKISTAN
2451
UZ
2452
UZB
2453
860
2454
CTRY_UZBEKISTAN
2455
7
2456
 
2457
 
2458
VANUATU
2459
VU
2460
VUT
2461
548
2462
 
2463
 
2464
 
2465
 
2466
VATICAN CITY STATE (HOLY SEE)
2467
VA
2468
VAT
2469
336
2470
 
2471
 
2472
 
2473
 
2474
VENEZUELA
2475
VE
2476
VEN
2477
862
2478
CTRY_VENEZUELA
2479
58
2480
 
2481
 
2482
VIET NAM
2483
VN
2484
VNM
2485
704
2486
CTRY_VIET_NAM
2487
84
2488
verVietnam
2489
 
2490
VIRGIN ISLANDS (BRITISH)
2491
VG
2492
VGB
2493
92
2494
 
2495
 
2496
 
2497
 
2498
VIRGIN ISLANDS (U.S.)
2499
VI
2500
VIR
2501
850
2502
 
2503
 
2504
 
2505
 
2506
WALLIS AND FUTUNA ISLANDS
2507
WF
2508
WLF
2509
876
2510
 
2511
 
2512
 
2513
 
2514
WESTERN SAHARA
2515
EH
2516
ESH
2517
732
2518
 
2519
 
2520
 
2521
 
2522
YEMEN
2523
YE
2524
YEM
2525
887
2526
CTRY_YEMEN
2527
967
2528
 
2529
 
2530
YUGOSLAVIA
2531
YU
2532
YUG
2533
891
2534
 
2535
 
2536
 
2537
 
2538
ZAIRE
2539
ZR
2540
ZAR
2541
180
2542
 
2543
 
2544
 
2545
 
2546
ZAMBIA
2547
ZM
2548
ZMB
2549
894
2550
 
2551
 
2552
 
2553
 
2554
ZIMBABWE
2555
ZW
2556
ZWE
2557
716
2558
CTRY_ZIMBABWE
2559
263
2560
 
2561
 
2562
'! !
2563
2564
!ISOLanguageDefinition class methodsFor: 'private - ISO 3'!
2565
iso3Countries
2566
	"self iso3Countries"
2567
	"ISO2Countries _ nil. ISO3Countries := nil"
2568
2569
	ISO3Countries ifNil: [self initISOCountries].
2570
	^ISO3Countries! !
2571
2572
!ISOLanguageDefinition class methodsFor: 'private - ISO 3'!
2573
iso3LanguageTable
2574
	"self iso3LanguageTable"
2575
2576
	^ISO3Table ifNil: [ISO3Table _ self initISO3LanguageTable]! !
2577
2578
!Locale methodsFor: 'printing'!
2579
printOn: aStream 
2580
	super printOn: aStream.
2581
	aStream nextPutAll:  '(' ; print: id ; nextPutAll:  ')'! !
2582
2583
!Locale methodsFor: 'private'!
2584
fetchISO2Language
2585
	"Locale current fetchISO2Language"
2586
2587
	| lang isoLang |
2588
	lang _ self primLanguage.
2589
	lang ifNil: [ ^ nil ].
2590
	lang _ lang copyUpTo: 0 asCharacter.
2591
	lang size = 2 ifTrue: [ ^ lang ].
2592
	isoLang _ ISOLanguageDefinition iso3LanguageDefinition: lang.
2593
	^ isoLang ifNotNil: [ isoLang iso2 ]! !
2594
2595
!Locale methodsFor: 'accessing'!
2596
determineLocale
2597
	self localeID: self determineLocaleID! !
2598
2599
!Locale methodsFor: 'accessing'!
2600
determineLocaleID
2601
	"Locale current determineLocaleID"
2602
	| langCode isoLang countryCode isoCountry |
2603
	langCode _ self fetchISO2Language.
2604
	isoLang _ langCode
2605
		ifNil: [^self localeID]
2606
		ifNotNil: [langCode].
2607
	countryCode _ self primCountry copyUpTo: 0 asCharacter.
2608
	isoCountry _ countryCode
2609
		ifNil: [^LocaleID isoLanguage: isoLang]
2610
		ifNotNil: [countryCode].
2611
	^LocaleID isoLanguage: isoLang isoCountry: isoCountry! !
2612
2613
!Locale methodsFor: 'accessing'!
2614
isoCountry
2615
	^self localeID isoCountry! !
2616
2617
!Locale methodsFor: 'accessing'!
2618
isoLanguage
2619
	^self localeID isoLanguage! !
2620
2621
!Locale methodsFor: 'accessing'!
2622
isoLocale
2623
	"<language>-<country>"
2624
	^self isoCountry
2625
		ifNil: [self isoLanguage]
2626
		ifNotNil: [self isoLanguage , '-' , self isoCountry]! !
2627
2628
!Locale methodsFor: 'accessing'!
2629
localeID
2630
	^id! !
2631
2632
!Locale methodsFor: 'accessing'!
2633
localeID: anID
2634
	id _ anID! !
2635
2636
!Locale methodsFor: 'system primitives'!
2637
primCountry
2638
	"Returns string with country tag according to ISO 639"
2639
	<primitive: 'primitiveCountry' module: 'LocalePlugin'>
2640
	^'FR'! !
2641
2642
!Locale methodsFor: 'system primitives'!
2643
primCurrencyNotation
2644
	"Returns boolean if symbol is pre- (true) or post-fix (false)"
2645
	<primitive: 'primitiveCurrencyNotation' module: 'LocalePlugin'>
2646
	^true! !
2647
2648
!Locale methodsFor: 'system primitives'!
2649
primCurrencySymbol
2650
	"Returns string with currency symbol"
2651
	<primitive: 'primitiveCurrencySymbol' module:'LocalePlugin'>
2652
	^'$'! !
2653
2654
!Locale methodsFor: 'system primitives'!
2655
primDST
2656
	"Returns boolean if DST  (daylight saving time) is active or not"
2657
	<primitive:'primitiveDaylightSavings' module: 'LocalePlugin'>
2658
	^false! !
2659
2660
!Locale methodsFor: 'system primitives'!
2661
primDecimalSymbol
2662
	"Returns string with e.g. '.' or ','"
2663
	<primitive:'primitiveDecimalSymbol' module: 'LocalePlugin'>
2664
	^'.'! !
2665
2666
!Locale methodsFor: 'system primitives'!
2667
primDigitGrouping
2668
	"Returns string with e.g. '.' or ',' (thousands etc)"
2669
	<primitive:'primitiveDigitGroupingSymbol' module: 'LocalePlugin'>
2670
	^','! !
2671
2672
!Locale methodsFor: 'system primitives'!
2673
primLanguage
2674
	"returns string with language tag according to ISO 639"
2675
	<primitive:'primitiveLanguage' module: 'LocalePlugin'>
2676
	^'en'! !
2677
2678
!Locale methodsFor: 'system primitives'!
2679
primLongDateFormat
2680
	"Returns the long date format
2681
	d day, m month, y year,
2682
	double symbol is null padded, single not padded (m=6, mm=06)
2683
	dddd weekday
2684
	mmmm month name"
2685
	<primitive:'primitiveLongDateFormat' module: 'LocalePlugin'>
2686
	^'dddd, mmmm d, yyyy'
2687
! !
2688
2689
!Locale methodsFor: 'system primitives'!
2690
primMeasurement
2691
	"Returns boolean denoting metric(true) or imperial(false)."
2692
	<primitive:'primitiveMeasurementMetric' module: 'LocalePlugin'>
2693
	^true
2694
! !
2695
2696
!Locale methodsFor: 'system primitives'!
2697
primShortDateFormat
2698
	"Returns the short date format
2699
	d day, m month, y year,
2700
	double symbol is null padded, single not padded (m=6, mm=06)
2701
	dddd weekday
2702
	mmmm month name"
2703
	<primitive:'primitiveShortDateFormat' module: 'LocalePlugin'>
2704
	^'m/d/yy'
2705
! !
2706
2707
!Locale methodsFor: 'system primitives'!
2708
primTimeFormat
2709
	"Returns string time format
2710
	Format is made up of 
2711
	h hour (h 12, H 24), m minute, s seconds, x (am/pm String)
2712
	double symbol is null padded, single not padded (h=6, hh=06)"
2713
	<primitive:'primitiveTimeFormat' module: 'LocalePlugin'>
2714
	^'h:mmx'
2715
! !
2716
2717
!Locale methodsFor: 'system primitives'!
2718
primTimezone
2719
	"The offset from UTC in minutes, with positive offsets being towards the east.
2720
	(San Francisco is in UTC -07*60 and Paris is in UTC +02*60 (daylight savings is not in effect)."
2721
	<primitive:'primitiveTimezoneOffset' module: 'LocalePlugin'>
2722
	^0! !
2723
2724
!Locale methodsFor: 'system primitives'!
2725
primVMOffsetToUTC
2726
	"Returns the offset in minutes between the VM and UTC.
2727
	If the VM does not support UTC times, this is 0.
2728
	Also gives us backward compatibility with old VMs as the primitive will fail and we then can return 0."
2729
	<primitive:'primitiveVMOffsetToUTC' module: 'LocalePlugin'>
2730
	^0! !
2731
2732
!Locale class methodsFor: 'system startup' stamp: 'hlsf 7/3/2022 13:08:00'!
2733
startUp: resuming
2734
	resuming ifFalse: [^self].
2735
	(Preferences at: #useLocale)
2736
		ifTrue: [
2737
			| newID |
2738
			newID := self current determineLocaleID.
2739
			newID ~= LocaleID current
2740
				ifTrue: [self switchToID: newID]]! !
2741
2742
!Locale class methodsFor: 'private' stamp: 'hlsf 2/20/2022 10:07:50'!
2743
defaultLocales
2744
	
2745
	"return IDs of default locales"
2746
	
2747
	^ #(de en es fr it)! !
2748
2749
!Locale class methodsFor: 'private'!
2750
determineCurrentLocale
2751
	"For now just return the default locale.
2752
	A smarter way would be to determine the current platforms default locale."
2753
	"Locale determineCurrentLocale"
2754
2755
	^self new determineLocale! !
2756
2757
!Locale class methodsFor: 'private'!
2758
initKnownLocales
2759
	| locales |
2760
	locales _ Dictionary new.
2761
2762
	"Init the locales for which we have translations"
2763
	self defaultLocales do: [:id |
2764
		locales at: id put: (self new localeID: id)].
2765
	^locales! !
2766
2767
!Locale class methodsFor: 'private'!
2768
knownLocales
2769
	"KnownLocales _ nil"
2770
	^KnownLocales ifNil: [KnownLocales _ self initKnownLocales]! !
2771
2772
!Locale class methodsFor: 'initialization' stamp: 'Install-System-Locales 7/3/2022 12:37:18'!
2773
initialize
2774
	Smalltalk addToStartUpList: Locale.
2775
	Preferences 
2776
		name: #useLocale
2777
		description: 'Use the system locale to set the system language, etc., at startup.  For time-zone handling, see automaticTimezone.'
2778
		category: #system
2779
		type: Boolean
2780
		value: false
2781
! !
2782
2783
!Locale class methodsFor: 'initialization'!
2784
initializePlatformEncodings
2785
	"Locale initializePlatformEncodings"
2786
2787
	| platform |
2788
	PlatformEncodings ifNil: [ PlatformEncodings _ Dictionary new ].
2789
2790
	platform _ PlatformEncodings at: 'default' ifAbsentPut: Dictionary new.
2791
	platform
2792
		at: 'default' put: 'iso8859-1';
2793
		at: 'Win32 CE' put: 'utf-8'.
2794
2795
	platform _ PlatformEncodings at: 'ja' ifAbsentPut: Dictionary new.
2796
	platform
2797
		at: 'default' put: 'shift-jis';
2798
		at: 'unix' put: 'euc-jp';
2799
		at: 'Win32 CE' put: 'utf-8'.
2800
		
2801
	platform _ PlatformEncodings at: 'ko' ifAbsentPut: Dictionary new.
2802
	platform
2803
		at: 'default' put: 'euc-kr';
2804
		at: 'Win32 CE' put: 'utf-8'.
2805
2806
	platform _ PlatformEncodings at: 'zh' ifAbsentPut: Dictionary new.
2807
	platform
2808
		at: 'default' put: 'gb2312';
2809
		at: 'unix' put: 'euc-cn';
2810
		at: 'Win32 CE' put: 'utf-8'.
2811
! !
2812
2813
!Locale class methodsFor: 'settings'!
2814
activated
2815
	^ Activated ifNil: [Activated _ false]! !
2816
2817
!Locale class methodsFor: 'settings'!
2818
activated: aBoolean
2819
	Activated _ aBoolean! !
2820
2821
!Locale class methodsFor: 'platform specific' stamp: 'hlsf 2/20/2022 10:17:30'!
2822
defaultEncodingName: languageSymbol 
2823
	| encodings platformName osVersion |
2824
	platformName _ Smalltalk platformName.
2825
	osVersion _ Smalltalk osVersion.
2826
	encodings _ self platformEncodings at: languageSymbol
2827
				ifAbsent: [self platformEncodings at: #default].
2828
	encodings at: platformName ifPresent: [:encoding | ^encoding].
2829
	encodings at: platformName , ' ' , osVersion
2830
		ifPresent: [:encoding | ^encoding].
2831
	^encodings at: #default! !
2832
2833
!Locale class methodsFor: 'accessing'!
2834
current
2835
2836
	^ Current ifNil: [ Current _ self determineCurrentLocale ]! !
2837
2838
!Locale class methodsFor: 'accessing'!
2839
currentPlatform: locale during: aBlock 
2840
	"Alter current locale during a block"
2841
	| savedLocale |
2842
	savedLocale _ self current.
2843
	[self switchTo: locale.
2844
	aBlock value]
2845
		ensure: [self switchTo: savedLocale]! !
2846
2847
!Locale class methodsFor: 'accessing'!
2848
isoLanguage: isoLanguage
2849
	^self isoLanguage: isoLanguage isoCountry: nil! !
2850
2851
!Locale class methodsFor: 'accessing'!
2852
isoLanguage: isoLanguage isoCountry: isoCountry
2853
	^self localeID: (LocaleID  isoLanguage: isoLanguage isoCountry: isoCountry)! !
2854
2855
!Locale class methodsFor: 'accessing'!
2856
languageSymbol: languageSymbol
2857
	"Locale languageSymbol: #Deutsch"
2858
2859
	^self isoLanguage: (LanguageSymbols at: languageSymbol)! !
2860
2861
!Locale class methodsFor: 'accessing'!
2862
localeID: id
2863
	^self knownLocales at: id ifAbsentPut: [Locale new localeID: id]! !
2864
2865
!Locale class methodsFor: 'accessing'!
2866
platformEncodings
2867
	PlatformEncodings isEmptyOrNil ifTrue: [ self initializePlatformEncodings ].
2868
	^PlatformEncodings
2869
! !
2870
2871
!Locale class methodsFor: 'accessing' stamp: 'hlsf 2/20/2022 10:13:01'!
2872
switchTo: locale
2873
	self switchTo: locale gently: false.
2874
! !
2875
2876
!Locale class methodsFor: 'accessing' stamp: 'hlsf 2/20/2022 10:12:21'!
2877
switchTo: locale gently: gentlyFlag
2878
	"Locale switchTo: (Locale isoLanguage: 'de')"
2879
	| availableID |
2880
	availableID := (NaturalLanguageTranslator availableForLocaleID: locale localeID) localeID.
2881
	Current localeID = availableID
2882
		ifFalse: [Previous := Current.
2883
				CurrentPlatform := Current := Locale localeID: availableID.
2884
				NaturalLanguageTranslator localeChanged.
2885
				gentlyFlag ifTrue: [self localeChangedGently] ifFalse: [self localeChanged]]! !
2886
2887
!Locale class methodsFor: 'accessing'!
2888
switchToID: localeID
2889
	"Locale switchToID: (LocaleID isoLanguage: 'de') "
2890
2891
	self switchTo: (Locale localeID: localeID)! !
2892
2893
!Locale class methodsFor: 'notification' stamp: 'hlsf 2/20/2022 09:54:39'!
2894
addLocalChangedListener: anObjectOrClass
2895
	self localeChangedListeners add: anObjectOrClass! !
2896
2897
!Locale class methodsFor: 'notification' stamp: 'hlsf 2/20/2022 09:55:07'!
2898
localeChanged
2899
"	SystemNavigation default allBehaviorsDo: [:b |
2900
		b == self ifFalse: [b localeChanged]].
2901
"! !
2902
2903
!Locale class methodsFor: 'notification' stamp: 'hlsf 2/20/2022 09:55:21'!
2904
localeChangedGently
2905
"	SystemNavigation default allBehaviorsDo: [:b | b == self ifFalse: [b localeChangedGently]].
2906
"! !
2907
2908
!Locale class methodsFor: 'notification' stamp: 'hlsf 2/20/2022 09:55:30'!
2909
localeChangedListeners
2910
	^LocaleChangeListeners ifNil: [LocaleChangeListeners := OrderedCollection new]! !
2911
2912
!LocaleID methodsFor: 'printing'!
2913
posixName
2914
	"(LocaleID isoString: 'es-MX') posixName"
2915
	"(LocaleID isoString: 'es') posixName"
2916
	"language[_territory]"
2917
	^ self isoCountry
2918
		ifNil: [self isoLanguage]
2919
		ifNotNil: [self isoLanguage , '_' , self isoCountry]! !
2920
2921
!LocaleID methodsFor: 'printing'!
2922
printOn: stream
2923
	"<language>-<country>"
2924
	stream nextPutAll: self isoLanguage.
2925
	self isoCountry
2926
		ifNotNil: [stream nextPut: $-; nextPutAll: self isoCountry]! !
2927
2928
!LocaleID methodsFor: 'printing'!
2929
storeOn: aStream 
2930
	aStream nextPut: $(.
2931
	aStream nextPutAll: self class name.
2932
	aStream nextPutAll: ' isoString: '.
2933
	aStream nextPutAll: '''' , self printString , ''''.
2934
	aStream nextPut: $).
2935
! !
2936
2937
!LocaleID methodsFor: 'comparing'!
2938
= anotherObject
2939
	self class == anotherObject class
2940
		ifFalse: [^false].
2941
	^self isoLanguage = anotherObject isoLanguage
2942
		and: [self isoCountry = anotherObject isoCountry]! !
2943
2944
!LocaleID methodsFor: 'comparing'!
2945
hash
2946
	^self isoLanguage hash bitXor: self isoCountry hash! !
2947
2948
!LocaleID methodsFor: 'testing'!
2949
hasParent
2950
	^self isoCountry notNil! !
2951
2952
!LocaleID methodsFor: 'initialize'!
2953
isoLanguage: langString isoCountry: countryStringOrNil
2954
	isoLanguage _ langString.
2955
	isoCountry _ countryStringOrNil! !
2956
2957
!LocaleID methodsFor: 'accessing'!
2958
displayCountry
2959
	^(ISOLanguageDefinition iso2Countries at: self isoCountry asUppercase ifAbsent: [ self isoCountry ]) ! !
2960
2961
!LocaleID methodsFor: 'accessing'!
2962
displayLanguage
2963
	| language |
2964
	language _ (ISOLanguageDefinition iso2LanguageTable
2965
				at: self isoLanguage
2966
				ifAbsent: [^ self isoLanguage]) language.
2967
	^ self isoCountry
2968
		ifNil: [language]
2969
		ifNotNil: [language , ' (' , self displayCountry , ')']! !
2970
2971
!LocaleID methodsFor: 'accessing'!
2972
isoCountry
2973
	^isoCountry! !
2974
2975
!LocaleID methodsFor: 'accessing'!
2976
isoLanguage
2977
	^isoLanguage! !
2978
2979
!LocaleID methodsFor: 'accessing'!
2980
isoString
2981
	^self asString! !
2982
2983
!LocaleID methodsFor: 'accessing'!
2984
parent
2985
	^self class isoLanguage: self isoLanguage! !
2986
2987
!LocaleID methodsFor: 'accessing'!
2988
translator
2989
	^ NaturalLanguageTranslator localeID: self ! !
2990
2991
!LocaleID class methodsFor: 'accessing'!
2992
current
2993
	^Locale current localeID! !
2994
2995
!LocaleID class methodsFor: 'instance creation'!
2996
isoLanguage: langString
2997
	^self isoLanguage: langString isoCountry: nil! !
2998
2999
!LocaleID class methodsFor: 'instance creation'!
3000
isoLanguage: langString isoCountry: countryStringOrNil
3001
	^self new isoLanguage: langString isoCountry: countryStringOrNil! !
3002
3003
!LocaleID class methodsFor: 'instance creation'!
3004
isoString: isoString
3005
	"Parse the isoString (<language>-<country>) into its components and return the matching LocaleID"
3006
	"LocaleID isoString: 'en' "
3007
	"LocaleID isoString: 'en-us' "
3008
3009
	| parts language country |
3010
	parts _ isoString findTokens: #($- ).
3011
	language _ parts first.
3012
	parts size > 1
3013
		ifTrue: [country _ parts second].
3014
	^self isoLanguage: language isoCountry: country! !
3015
3016
!LocaleID class methodsFor: 'instance creation'!
3017
posixName: aString 
3018
	^ self
3019
		isoString: (aString copyReplaceAll: '_' with: '-')! !
3020
3021
!LocaleID class methodsFor: 'accessing-defaults'!
3022
default
3023
	^ self isoLanguage: 'en'! !
3024
ISOLanguageDefinition initialize!
3025
Locale initialize!