-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
resource.go
2233 lines (2157 loc) · 77.6 KB
/
resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2018 Saferwall. All rights reserved.
// Use of this source code is governed by Apache v2 license
// license that can be found in the LICENSE file.
package pe
import (
"encoding/binary"
)
// ResourceType represents a resource type.
type ResourceType int
// ResourceLang represents a resource language.
type ResourceLang uint32
// ResourceSubLang represents a resource sub language.
type ResourceSubLang uint32
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f
// Special resource (sub)language identifiers.
const (
LangNeutral ResourceLang = 0x00 // Default custom (MUI) locale language
LangUserDefault ResourceLang = 0x01 // User default locale language
LangSystemDefault ResourceLang = 0x02 // System default locale language
LangInvariant ResourceLang = 0x7F // Invariant locale language
SubLangNeutral ResourceSubLang = 0x00 // Neutral sub-language
SubLangInvariant ResourceSubLang = 0x00 // Invariant sub-language
SubLangDefault ResourceSubLang = 0x01 // User default sub-language
SubLangSysDefault ResourceSubLang = 0x02 // System default sub-language
SubLangCustomDefault ResourceSubLang = 0x03 // Default custom sub-language
SubLangCustomUnspecified ResourceSubLang = 0x04 // Unspecified custom sub-language
SubLangMUICustomDefault ResourceSubLang = 0x05 // Default custom MUI sub-language
)
// All resource language identifiers.
const (
// Afrikaans (af)
LangAfrikaans ResourceLang = 0x0036
// Albanian (sq)
LangAlbanian ResourceLang = 0x001C
// Alsatian (gsw)
LangAlsatian ResourceLang = 0x0084
// Amharic (am)
LangAmharic ResourceLang = 0x005E
// Arabic (ar)
LangArabic ResourceLang = 0x0001
// Armenian (hy)
LangArmenian ResourceLang = 0x002B
// Assamese (as)
LangAssamese ResourceLang = 0x004D
// Azerbaijani (Latin) (az)
LangAzerbaijaniLatin ResourceLang = 0x002C
// Bangla (bn)
LangBangla ResourceLang = 0x0045
// Bashkir (ba)
LangBashkir ResourceLang = 0x006D
// Basque (eu)
LangBasque ResourceLang = 0x002D
// Belarusian (be)
LangBelarusian ResourceLang = 0x0023
// Bosnian (Latin) (bs)
LangBosnianLatin ResourceLang = 0x781A
// Breton (br)
LangBreton ResourceLang = 0x007E
// Bulgarian (bg)
LangBulgarian ResourceLang = 0x0002
// Burmese (my)
LangBurmese ResourceLang = 0x0055
// Catalan (ca)
LangCatalan ResourceLang = 0x0003
// Central Kurdish (ku)
LangCentralKurdish ResourceLang = 0x0092
// Cherokee (chr)
LangCherokee ResourceLang = 0x005C
// Chinese (Simplified) (zh)
LangChineseSimplified ResourceLang = 0x7804
// Corsican (co)
LangCorsican ResourceLang = 0x0083
// Croatian (hr)
LangCroatian ResourceLang = 0x001A
// Czech (cs)
LangCzech ResourceLang = 0x0005
// Danish (da)
LangDanish ResourceLang = 0x0006
// Dari (prs)
LangDari ResourceLang = 0x008C
// Divehi (dv)
LangDivehi ResourceLang = 0x0065
// Dutch (nl)
LangDutch ResourceLang = 0x0013
// English (en)
LangEnglish ResourceLang = 0x0009
// Estonian (et)
LangEstonian ResourceLang = 0x0025
// Faroese (fo)
LangFaroese ResourceLang = 0x0038
// Filipino (fil)
LangFilipino ResourceLang = 0x0064
// Finnish (fi)
LangFinnish ResourceLang = 0x000B
// French (fr)
LangFrench ResourceLang = 0x000C
// Frisian (fy)
LangFrisian ResourceLang = 0x0062
// Fulah (ff)
LangFulah ResourceLang = 0x0067
// Fulah (Latin) (ff-Latn)
LangFulahLatin ResourceLang = 0x7C67
// Galician (gl)
LangGalician ResourceLang = 0x0056
// Georgian (ka)
LangGeorgian ResourceLang = 0x0037
// German (de)
LangGerman ResourceLang = 0x0007
// Greek (el)
LangGreek ResourceLang = 0x0008
// Greenlandic (kl)
LangGreenlandic ResourceLang = 0x006F
// Guarani (gn)
LangGuarani ResourceLang = 0x0074
// Gujarati (gu)
LangGujarati ResourceLang = 0x0047
// Hausa (Latin) (ha)
LangHausaLatin ResourceLang = 0x0068
// Hawaiian (haw)
LangHawaiian ResourceLang = 0x0075
// Hebrew (he)
LangHebrew ResourceLang = 0x000D
// Hindi (hi)
LangHindi ResourceLang = 0x0039
// Hungarian (hu)
LangHungarian ResourceLang = 0x000E
// Icelandic (is)
LangIcelandic ResourceLang = 0x000F
// Igbo (ig)
LangIgbo ResourceLang = 0x0070
// Indonesian (id)
LangIndonesian ResourceLang = 0x0021
// Inuktitut (Latin) (iu)
LangInuktitutLatin ResourceLang = 0x005D
// Irish (ga)
LangIrish ResourceLang = 0x003C
// Italian (it)
LangItalian ResourceLang = 0x0010
// Japanese (ja)
LangJapanese ResourceLang = 0x0011
// Kannada (kn)
LangKannada ResourceLang = 0x004B
// Kashmiri (ks)
LangKashmiri ResourceLang = 0x0060
// Kazakh (kk)
LangKazakh ResourceLang = 0x003F
// Khmer (km)
LangKhmer ResourceLang = 0x0053
// K'iche (quc)
LangKiche ResourceLang = 0x0086
// Kinyarwanda (rw)
LangKinyarwanda ResourceLang = 0x0087
// Kiswahili (sw)
LangKiswahili ResourceLang = 0x0041
// Konkani (kok)
LangKonkani ResourceLang = 0x0057
// Korean (ko)
LangKorean ResourceLang = 0x0012
// Kyrgyz (ky)
LangKyrgyz ResourceLang = 0x0040
// Lao (lo)
LangLao ResourceLang = 0x0054
// Latvian (lv)
LangLatvian ResourceLang = 0x0026
// Lithuanian (lt)
LangLithuanian ResourceLang = 0x0027
// Lower Sorbian (dsb)
LangLowerSorbian ResourceLang = 0x7C2E
// Luxembourgish (lb)
LangLuxembourgish ResourceLang = 0x006E
// Macedonian (mk)
LangMacedonian ResourceLang = 0x002F
// Malay (ms)
LangMalay ResourceLang = 0x003E
// Malayalam (ml)
LangMalayalam ResourceLang = 0x004C
// Maltese (mt)
LangMaltese ResourceLang = 0x003A
// Maori (mi)
LangMaori ResourceLang = 0x0081
// Mapudungun (arn)
LangMapudungun ResourceLang = 0x007A
// Marathi (mr)
LangMarathi ResourceLang = 0x004E
// Mohawk (moh)
LangMohawk ResourceLang = 0x007C
// Mongolian (Cyrillic) (mn)
LangMongolianCyrillic ResourceLang = 0x0050
// Nepali (ne)
LangNepali ResourceLang = 0x0061
// Norwegian (Bokmal) (no)
LangNorwegianBokmalNo ResourceLang = 0x0014
// Norwegian (Bokmal) (nb)
LangNorwegianBokmal ResourceLang = 0x7C14
// Norwegian (Nynorsk) (nn)
LangNorwegianNynorsk ResourceLang = 0x7814
// Occitan (oc)
LangOccitan ResourceLang = 0x0082
// Odia (or)
LangOdia ResourceLang = 0x0048
// Oromo (om)
LangOromo ResourceLang = 0x0072
// Pashto (ps)
LangPashto ResourceLang = 0x0063
// Persian (fa)
LangPersian ResourceLang = 0x0029
// Polish (pl)
LangPolish ResourceLang = 0x0015
// Portuguese (pt)
LangPortuguese ResourceLang = 0x0016
// Punjabi (pa)
LangPunjabi ResourceLang = 0x0046
// Quechua (quz)
LangQuechua ResourceLang = 0x006B
// Romanian (ro)
LangRomanian ResourceLang = 0x0018
// Romansh (rm)
LangRomansh ResourceLang = 0x0017
// Russian (ru)
LangRussian ResourceLang = 0x0019
// Sakha (sah)
LangSakha ResourceLang = 0x0085
// Sami (Inari) (smn)
LangSamiInari ResourceLang = 0x703B
// Sami (Lule) (smj)
LangSamiLule ResourceLang = 0x7C3B
// Sami (Northern) (se)
LangSamiNorthern ResourceLang = 0x003B
// Sami (Skolt) (sms)
LangSamiSkolt ResourceLang = 0x743B
// Sami (Southern) (sma)
LangSamiSouthern ResourceLang = 0x783B
// Sanskrit (sa)
LangSanskrit ResourceLang = 0x004F
// Scottish Gaelic (gd)
LangScottishGaelic ResourceLang = 0x0091
// Serbian (Latin) (sr)
LangSerbianLatin ResourceLang = 0x7C1A
// Sesotho Sa Leboa (nso)
LangSesothoSaLeboa ResourceLang = 0x006C
// Setswana (tn)
LangSetswana ResourceLang = 0x0032
// Sindhi (sd)
LangSindhi ResourceLang = 0x0059
// Sinhala (si)
LangSinhala ResourceLang = 0x005B
// Slovak (sk)
LangSlovak ResourceLang = 0x001B
// Slovenian (sl)
LangSlovenian ResourceLang = 0x0024
// Somali (so)
LangSomali ResourceLang = 0x0077
// Sotho (st)
LangSotho ResourceLang = 0x0030
// Spanish (es)
LangSpanish ResourceLang = 0x000A
// Swedish (sv)
LangSwedish ResourceLang = 0x001D
// Syriac (syr)
LangSyriac ResourceLang = 0x005A
// Tajik (Cyrillic) (tg)
LangTajikCyrillic ResourceLang = 0x0028
// Tamazight (Latin) (tzm)
LangTamazightLatin ResourceLang = 0x005F
// Tamil (ta)
LangTamil ResourceLang = 0x0049
// Tatar (tt)
LangTatar ResourceLang = 0x0044
// Telugu (te)
LangTelugu ResourceLang = 0x004A
// Thai (th)
LangThai ResourceLang = 0x001E
// Tibetan (bo)
LangTibetan ResourceLang = 0x0051
// Tigrinya (ti)
LangTigrinya ResourceLang = 0x0073
// Tsonga (ts)
LangTsonga ResourceLang = 0x0031
// Turkish (tr)
LangTurkish ResourceLang = 0x001F
// Turkmen (tk)
LangTurkmen ResourceLang = 0x0042
// Ukrainian (uk)
LangUkrainian ResourceLang = 0x0022
// Upper Sorbian (hsb)
LangUpperSorbian ResourceLang = 0x002E
// Urdu (ur)
LangUrdu ResourceLang = 0x0020
// Uyghur (ug)
LangUyghur ResourceLang = 0x0080
// Uzbek (Latin) (uz)
LangUzbekLatin ResourceLang = 0x0043
// Venda (ve)
LangVenda ResourceLang = 0x0033
// Vietnamese (vi)
LangVietnamese ResourceLang = 0x002A
// Welsh (cy)
LangWelsh ResourceLang = 0x0052
// Wolof (wo)
LangWolof ResourceLang = 0x0088
// Xhosa (xh)
LangXhosa ResourceLang = 0x0034
// Yi (ii)
LangYi ResourceLang = 0x0078
// Yoruba (yo)
LangYoruba ResourceLang = 0x006A
// Zulu (zu)
LangZulu ResourceLang = 0x0035
)
// All resource sub-language identifiers.
const (
// Afrikaans South Africa (af-ZA)
SubLangAfrikaansSouthAfrica ResourceSubLang = iota
// Albanian Albania (sq-AL)
SubLangAlbanianAlbania
// Alsatian France (gsw-FR)
SubLangAlsatianFrance
// Amharic Ethiopia (am-ET)
SubLangAmharicEthiopia
// Arabic Algeria (ar-DZ)
SubLangArabicAlgeria
// Arabic Bahrain (ar-BH)
SubLangArabicBahrain
// Arabic Egypt (ar-EG)
SubLangArabicEgypt
// Arabic Iraq (ar-IQ)
SubLangArabicIraq
// Arabic Jordan (ar-JO)
SubLangArabicJordan
// Arabic Kuwait (ar-KW)
SubLangArabicKuwait
// Arabic Lebanon (ar-LB)
SubLangArabicLebanon
// Arabic Libya (ar-LY)
SubLangArabicLibya
// Arabic Morocco (ar-MA)
SubLangArabicMorocco
// Arabic Oman (ar-OM)
SubLangArabicOman
// Arabic Qatar (ar-QA)
SubLangArabicQatar
// Arabic Saudi Arabia (ar-SA)
SubLangArabicSaudiArabia
// Arabic Syria (ar-SY)
SubLangArabicSyria
// Arabic Tunisia (ar-TN)
SubLangArabicTunisia
// Arabic U.a.e. (ar-AE)
SubLangArabicUae
// Arabic Yemen (ar-YE)
SubLangArabicYemen
// Armenian Armenia (hy-AM)
SubLangArmenianArmenia
// Assamese India (as-IN)
SubLangAssameseIndia
// Azerbaijani (Cyrillic) (az-Cyrl)
SubLangAzerbaijaniCyrillic
// Azerbaijani (Cyrillic) Azerbaijan (az-Cyrl-AZ)
SubLangAzerbaijaniCyrillicAzerbaijan
// Azerbaijani (Latin) (az-Latn)
SubLangAzerbaijaniLatin
// Azerbaijani (Latin) Azerbaijan (az-Latn-AZ)
SubLangAzerbaijaniLatinAzerbaijan
// Bangla Bangladesh (bn-BD)
SubLangBanglaBangladesh
// Bangla India (bn-IN)
SubLangBanglaIndia
// Bashkir Russia (ba-RU)
SubLangBashkirRussia
// Basque Spain (eu-ES)
SubLangBasqueSpain
// Belarusian Belarus (be-BY)
SubLangBelarusianBelarus
// Bosnian (Cyrillic) (bs-Cyrl)
SubLangBosnianCyrillic
// Bosnian (Cyrillic) Bosnia And Herzegovina (bs-Cyrl-BA)
SubLangBosnianCyrillicBosniaAndHerzegovina
// Bosnian (Latin) (bs-Latn)
SubLangBosnianLatin
// Bosnian (Latin) Bosnia And Herzegovina (bs-Latn-BA)
SubLangBosnianLatinBosniaAndHerzegovina
// Breton France (br-FR)
SubLangBretonFrance
// Bulgarian Bulgaria (bg-BG)
SubLangBulgarianBulgaria
// Burmese Myanmar (my-MM)
SubLangBurmeseMyanmar
// Catalan Spain (ca-ES)
SubLangCatalanSpain
// Central Atlas Tamazight (Arabic) Morocco (tzm-ArabMA)
SubLangCentralAtlasTamazightArabicMorocco
// Central Kurdish (ku-Arab)
SubLangCentralKurdish
// Central Kurdish Iraq (ku-Arab-IQ)
SubLangCentralKurdishIraq
// Cherokee (chr-Cher)
SubLangCherokee
// Cherokee United States (chr-Cher-US)
SubLangCherokeeUnitedStates
// Chinese (Simplified) (zh-Hans)
SubLangChineseSimplified
// Chinese (Simplified) People's Republic Of China (zh-CN)
SubLangChineseSimplifiedPeoplesRepublicOfChina
// Chinese (Simplified) Singapore (zh-SG)
SubLangChineseSimplifiedSingapore
// Chinese (Traditional) (zh-Hant)
SubLangChineseTraditional
// Chinese (Traditional) Hong Kong S.a.r. (zh-HK)
SubLangChineseTraditionalHongKongSar
// Chinese (Traditional) Macao S.a.r. (zh-MO)
SubLangChineseTraditionalMacaoSar
// Chinese (Traditional) Taiwan (zh-TW)
SubLangChineseTraditionalTaiwan
// Corsican France (co-FR)
SubLangCorsicanFrance
// Croatian Croatia (hr-HR)
SubLangCroatianCroatia
// Croatian (Latin) Bosnia And Herzegovina (hr-BA)
SubLangCroatianLatinBosniaAndHerzegovina
// Czech Czech Republic (cs-CZ)
SubLangCzechCzechRepublic
// Danish Denmark (da-DK)
SubLangDanishDenmark
// Dari Afghanistan (prs-AF)
SubLangDariAfghanistan
// Divehi Maldives (dv-MV)
SubLangDivehiMaldives
// Dutch Belgium (nl-BE)
SubLangDutchBelgium
// Dutch Netherlands (nl-NL)
SubLangDutchNetherlands
// Dzongkha Bhutan (dz-BT)
SubLangDzongkhaBhutan
// English Australia (en-AU)
SubLangEnglishAustralia
// English Belize (en-BZ)
SubLangEnglishBelize
// English Canada (en-CA)
SubLangEnglishCanada
// English Caribbean (en-029)
SubLangEnglishCaribbean
// English Hong Kong (en-HK)
SubLangEnglishHongKong
// English India (en-IN)
SubLangEnglishIndia
// English Ireland (en-IE)
SubLangEnglishIreland
// English Jamaica (en-JM)
SubLangEnglishJamaica
// English Malaysia (en-MY)
SubLangEnglishMalaysia
// English New Zealand (en-NZ)
SubLangEnglishNewZealand
// English Republic Of The Philippines (en-PH)
SubLangEnglishRepublicOfThePhilippines
// English Singapore (en-SG)
SubLangEnglishSingapore
// English South Africa (en-ZA)
SubLangEnglishSouthAfrica
// English Trinidad And Tobago (en-TT)
SubLangEnglishTrinidadAndTobago
// English United Arab Emirates (en-AE)
SubLangEnglishUnitedArabEmirates
// English United Kingdom (en-GB)
SubLangEnglishUnitedKingdom
// English United States (en-US)
SubLangEnglishUnitedStates
// English Zimbabwe (en-ZW)
SubLangEnglishZimbabwe
// Estonian Estonia (et-EE)
SubLangEstonianEstonia
// Faroese Faroe Islands (fo-FO)
SubLangFaroeseFaroeIslands
// Filipino Philippines (fil-PH)
SubLangFilipinoPhilippines
// Finnish Finland (fi-FI)
SubLangFinnishFinland
// French Belgium (fr-BE)
SubLangFrenchBelgium
// French Cameroon (fr-CM)
SubLangFrenchCameroon
// French Canada (fr-CA)
SubLangFrenchCanada
// French Caribbean (fr-029)
SubLangFrenchCaribbean
// French Congo, Drc (fr-CD)
SubLangFrenchCongoDrc
// French Côte D'ivoire (fr-CI)
SubLangFrenchCôteDivoire
// French France (fr-FR)
SubLangFrenchFrance
// French Haiti (fr-HT)
SubLangFrenchHaiti
// French Luxembourg (fr-LU)
SubLangFrenchLuxembourg
// French Mali (fr-ML)
SubLangFrenchMali
// French Morocco (fr-MA)
SubLangFrenchMorocco
// French Principality Of Monaco (fr-MC)
SubLangFrenchPrincipalityOfMonaco
// French Reunion (fr-RE)
SubLangFrenchReunion
// French Senegal (fr-SN)
SubLangFrenchSenegal
// French Switzerland (fr-CH)
SubLangFrenchSwitzerland
// Frisian Netherlands (fy-NL)
SubLangFrisianNetherlands
// Fulah Nigeria (ff-NG)
SubLangFulahNigeria
// Fulah (Latin) Nigeria (ff-Latn-NG)
SubLangFulahLatinNigeria
// Fulah Senegal (ff-Latn-SN)
SubLangFulahSenegal
// Galician Spain (gl-ES)
SubLangGalicianSpain
// Georgian Georgia (ka-GE)
SubLangGeorgianGeorgia
// German Austria (de-AT)
SubLangGermanAustria
// German Germany (de-DE)
SubLangGermanGermany
// German Liechtenstein (de-LI)
SubLangGermanLiechtenstein
// German Luxembourg (de-LU)
SubLangGermanLuxembourg
// German Switzerland (de-CH)
SubLangGermanSwitzerland
// Greek Greece (el-GR)
SubLangGreekGreece
// Greenlandic Greenland (kl-GL)
SubLangGreenlandicGreenland
// Guarani Paraguay (gn-PY)
SubLangGuaraniParaguay
// Gujarati India (gu-IN)
SubLangGujaratiIndia
// Hausa (Latin) (ha-Latn)
SubLangHausaLatin
// Hausa (Latin) Nigeria (ha-Latn-NG)
SubLangHausaLatinNigeria
// Hawaiian United States (haw-US)
SubLangHawaiianUnitedStates
// Hebrew Israel (he-IL)
SubLangHebrewIsrael
// Hindi India (hi-IN)
SubLangHindiIndia
// Hungarian Hungary (hu-HU)
SubLangHungarianHungary
// Icelandic Iceland (is-IS)
SubLangIcelandicIceland
// Igbo Nigeria (ig-NG)
SubLangIgboNigeria
// Indonesian Indonesia (id-ID)
SubLangIndonesianIndonesia
// Inuktitut (Latin) (iu-Latn)
SubLangInuktitutLatin
// Inuktitut (Latin) Canada (iu-Latn-CA)
SubLangInuktitutLatinCanada
// Inuktitut (Syllabics) (iu-Cans)
SubLangInuktitutSyllabics
// Inuktitut (Syllabics) Canada (iu-Cans-CA)
SubLangInuktitutSyllabicsCanada
// Irish Ireland (ga-IE)
SubLangIrishIreland
// Italian Italy (it-IT)
SubLangItalianItaly
// Italian Switzerland (it-CH)
SubLangItalianSwitzerland
// Japanese Japan (ja-JP)
SubLangJapaneseJapan
// Kannada India (kn-IN)
SubLangKannadaIndia
// Kanuri (Latin) Nigeria (kr-Latn-NG)
SubLangKanuriLatinNigeria
// Kashmiri Perso-Arabic (ks-Arab)
SubLangKashmiriPersoArabic
// Kashmiri (Devanagari) India (ks-Deva-IN)
SubLangKashmiriDevanagariIndia
// Kazakh Kazakhstan (kk-KZ)
SubLangKazakhKazakhstan
// Khmer Cambodia (km-KH)
SubLangKhmerCambodia
// K'iche Guatemala (quc-Latn-GT)
SubLangKicheGuatemala
// Kinyarwanda Rwanda (rw-RW)
SubLangKinyarwandaRwanda
// Kiswahili Kenya (sw-KE)
SubLangKiswahiliKenya
// Konkani India (kok-IN)
SubLangKonkaniIndia
// Korean Korea (ko-KR)
SubLangKoreanKorea
// Kyrgyz Kyrgyzstan (ky-KG)
SubLangKyrgyzKyrgyzstan
// Lao Lao P.d.r. (lo-LA)
SubLangLaoLaoPdr
// Latin Vatican City (la-VA)
SubLangLatinVaticanCity
// Latvian Latvia (lv-LV)
SubLangLatvianLatvia
// Lithuanian Lithuania (lt-LT)
SubLangLithuanianLithuania
// Lower Sorbian Germany (dsb-DE)
SubLangLowerSorbianGermany
// Luxembourgish Luxembourg (lb-LU)
SubLangLuxembourgishLuxembourg
// Macedonian North Macedonia (mk-MK)
SubLangMacedonianNorthMacedonia
// Malay Brunei Darussalam (ms-BN)
SubLangMalayBruneiDarussalam
// Malay Malaysia (ms-MY)
SubLangMalayMalaysia
// Malayalam India (ml-IN)
SubLangMalayalamIndia
// Maltese Malta (mt-MT)
SubLangMalteseMalta
// Maori New Zealand (mi-NZ)
SubLangMaoriNewZealand
// Mapudungun Chile (arn-CL)
SubLangMapudungunChile
// Marathi India (mr-IN)
SubLangMarathiIndia
// Mohawk Canada (moh-CA)
SubLangMohawkCanada
// Mongolian (Cyrillic) (mn-Cyrl)
SubLangMongolianCyrillic
// Mongolian (Cyrillic) Mongolia (mn-MN)
SubLangMongolianCyrillicMongolia
// Mongolian (Traditional Mongolian) (mn-Mong)
SubLangMongolianTraditionalMongolian
// Mongolian (Traditional Mongolian) People's Republic Of China (mn-MongCN)
SubLangMongolianTraditionalMongolianPeoplesRepublicOfChina
// Mongolian (Traditional Mongolian) Mongolia (mn-MongMN)
SubLangMongolianTraditionalMongolianMongolia
// Nepali India (ne-IN)
SubLangNepaliIndia
// Nepali Nepal (ne-NP)
SubLangNepaliNepal
// Norwegian (Bokmal) Norway (nb-NO)
SubLangNorwegianBokmalNorway
// Norwegian (Nynorsk) Norway (nn-NO)
SubLangNorwegianNynorskNorway
// Occitan France (oc-FR)
SubLangOccitanFrance
// Odia India (or-IN)
SubLangOdiaIndia
// Oromo Ethiopia (om-ET)
SubLangOromoEthiopia
// Pashto Afghanistan (ps-AF)
SubLangPashtoAfghanistan
// Persian Iran (fa-IR)
SubLangPersianIran
// Polish Poland (pl-PL)
SubLangPolishPoland
// Portuguese Brazil (pt-BR)
SubLangPortugueseBrazil
// Portuguese Portugal (pt-PT)
SubLangPortuguesePortugal
// Pseudo Language Pseudo Locale For East Asian/Complex Script Localization Testing (qps-ploca)
SubLangPseudoLanguagePseudoLocaleForEastAsianComplexScriptLocalizationTesting
// Pseudo Language Pseudo Locale Used For Localization Testing (qps-ploc)
SubLangPseudoLanguagePseudoLocaleUsedForLocalizationTesting
// Pseudo Language Pseudo Locale Used For Localization Testing Of Mirrored Locales (qps-plocm)
SubLangPseudoLanguagePseudoLocaleUsedForLocalizationTestingOfMirroredLocales
// Punjabi (pa-Arab)
SubLangPunjabi
// Punjabi India (pa-IN)
SubLangPunjabiIndia
// Punjabi Islamic Republic Of Pakistan (pa-Arab-PK)
SubLangPunjabiIslamicRepublicOfPakistan
// Quechua Bolivia (quz-BO)
SubLangQuechuaBolivia
// Quechua Ecuador (quz-EC)
SubLangQuechuaEcuador
// Quechua Peru (quz-PE)
SubLangQuechuaPeru
// Romanian Moldova (ro-MD)
SubLangRomanianMoldova
// Romanian Romania (ro-RO)
SubLangRomanianRomania
// Romansh Switzerland (rm-CH)
SubLangRomanshSwitzerland
// Russian Moldova (ru-MD)
SubLangRussianMoldova
// Russian Russia (ru-RU)
SubLangRussianRussia
// Sakha Russia (sah-RU)
SubLangSakhaRussia
// Sami (Inari) Finland (smn-FI)
SubLangSamiInariFinland
// Sami (Lule) Norway (smj-NO)
SubLangSamiLuleNorway
// Sami (Lule) Sweden (smj-SE)
SubLangSamiLuleSweden
// Sami (Northern) Finland (se-FI)
SubLangSamiNorthernFinland
// Sami (Northern) Norway (se-NO)
SubLangSamiNorthernNorway
// Sami (Northern) Sweden (se-SE)
SubLangSamiNorthernSweden
// Sami (Skolt) Finland (sms-FI)
SubLangSamiSkoltFinland
// Sami (Southern) Norway (sma-NO)
SubLangSamiSouthernNorway
// Sami (Southern) Sweden (sma-SE)
SubLangSamiSouthernSweden
// Sanskrit India (sa-IN)
SubLangSanskritIndia
// Scottish Gaelic United Kingdom (gd-GB)
SubLangScottishGaelicUnitedKingdom
// Serbian (Cyrillic) (sr-Cyrl)
SubLangSerbianCyrillic
// Serbian (Cyrillic) Bosnia And Herzegovina (sr-Cyrl-BA)
SubLangSerbianCyrillicBosniaAndHerzegovina
// Serbian (Cyrillic) Montenegro (sr-Cyrl-ME)
SubLangSerbianCyrillicMontenegro
// Serbian (Cyrillic) Serbia (sr-Cyrl-RS)
SubLangSerbianCyrillicSerbia
// Serbian (Cyrillic) Serbia And Montenegro (Former) (sr-Cyrl-CS)
SubLangSerbianCyrillicSerbiaAndMontenegroFormer
// Serbian (Latin) (sr-Latn)
SubLangSerbianLatin
// Serbian (Latin) Bosnia And Herzegovina (sr-Latn-BA)
SubLangSerbianLatinBosniaAndHerzegovina
// Serbian (Latin) Montenegro (sr-Latn-ME)
SubLangSerbianLatinMontenegro
// Serbian (Latin) Serbia (sr-Latn-RS)
SubLangSerbianLatinSerbia
// Serbian (Latin) Serbia And Montenegro (Former) (sr-Latn-CS)
SubLangSerbianLatinSerbiaAndMontenegroFormer
// Sesotho Sa Leboa South Africa (nso-ZA)
SubLangSesothoSaLeboaSouthAfrica
// Setswana Botswana (tn-BW)
SubLangSetswanaBotswana
// Setswana South Africa (tn-ZA)
SubLangSetswanaSouthAfrica
// Sindhi (sd-Arab)
SubLangSindhi
// Sindhi Islamic Republic Of Pakistan (sd-Arab-PK)
SubLangSindhiIslamicRepublicOfPakistan
// Sinhala Sri Lanka (si-LK)
SubLangSinhalaSriLanka
// Slovak Slovakia (sk-SK)
SubLangSlovakSlovakia
// Slovenian Slovenia (sl-SI)
SubLangSlovenianSlovenia
// Somali Somalia (so-SO)
SubLangSomaliSomalia
// Sotho South Africa (st-ZA)
SubLangSothoSouthAfrica
// Spanish Argentina (es-AR)
SubLangSpanishArgentina
// Spanish Bolivarian Republic Of Venezuela (es-VE)
SubLangSpanishBolivarianRepublicOfVenezuela
// Spanish Bolivia (es-BO)
SubLangSpanishBolivia
// Spanish Chile (es-CL)
SubLangSpanishChile
// Spanish Colombia (es-CO)
SubLangSpanishColombia
// Spanish Costa Rica (es-CR)
SubLangSpanishCostaRica
// Spanish Cuba (es-CU)
SubLangSpanishCuba
// Spanish Dominican Republic (es-DO)
SubLangSpanishDominicanRepublic
// Spanish Ecuador (es-EC)
SubLangSpanishEcuador
// Spanish El Salvador (es-SV)
SubLangSpanishElSalvador
// Spanish Guatemala (es-GT)
SubLangSpanishGuatemala
// Spanish Honduras (es-HN)
SubLangSpanishHonduras
// Spanish Latin America (es-419)
SubLangSpanishLatinAmerica
// Spanish Mexico (es-MX)
SubLangSpanishMexico
// Spanish Nicaragua (es-NI)
SubLangSpanishNicaragua
// Spanish Panama (es-PA)
SubLangSpanishPanama
// Spanish Paraguay (es-PY)
SubLangSpanishParaguay
// Spanish Peru (es-PE)
SubLangSpanishPeru
// Spanish Puerto Rico (es-PR)
SubLangSpanishPuertoRico
// Spanish Spain (es-ES_tradnl)
SubLangSpanishSpainTraditional
// Spanish Spain (es-ES)
SubLangSpanishSpain
// Spanish United States (es-US)
SubLangSpanishUnitedStates
// Spanish Uruguay (es-UY)
SubLangSpanishUruguay
// Swedish Finland (sv-FI)
SubLangSwedishFinland
// Swedish Sweden (sv-SE)
SubLangSwedishSweden
// Syriac Syria (syr-SY)
SubLangSyriacSyria
// Tajik (Cyrillic) (tg-Cyrl)
SubLangTajikCyrillic
// Tajik (Cyrillic) Tajikistan (tg-Cyrl-TJ)
SubLangTajikCyrillicTajikistan
// Tamazight (Latin) (tzm-Latn)
SubLangTamazightLatin
// Tamazight (Latin) Algeria (tzm-Latn-DZ)
SubLangTamazightLatinAlgeria
// Tamil India (ta-IN)
SubLangTamilIndia
// Tamil Sri Lanka (ta-LK)
SubLangTamilSriLanka
// Tatar Russia (tt-RU)
SubLangTatarRussia
// Telugu India (te-IN)
SubLangTeluguIndia
// Thai Thailand (th-TH)
SubLangThaiThailand
// Tibetan People's Republic Of China (bo-CN)
SubLangTibetanPeoplesRepublicOfChina
// Tigrinya Eritrea (ti-ER)
SubLangTigrinyaEritrea
// Tigrinya Ethiopia (ti-ET)
SubLangTigrinyaEthiopia
// Tsonga South Africa (ts-ZA)
SubLangTsongaSouthAfrica
// Turkish Turkey (tr-TR)
SubLangTurkishTurkey
// Turkmen Turkmenistan (tk-TM)
SubLangTurkmenTurkmenistan
// Ukrainian Ukraine (uk-UA)
SubLangUkrainianUkraine
// Upper Sorbian Germany (hsb-DE)
SubLangUpperSorbianGermany
// Urdu India (ur-IN)
SubLangUrduIndia
// Urdu Islamic Republic Of Pakistan (ur-PK)
SubLangUrduIslamicRepublicOfPakistan
// Uyghur People's Republic Of China (ug-CN)
SubLangUyghurPeoplesRepublicOfChina
// Uzbek (Cyrillic) (uz-Cyrl)
SubLangUzbekCyrillic
// Uzbek (Cyrillic) Uzbekistan (uz-Cyrl-UZ)
SubLangUzbekCyrillicUzbekistan
// Uzbek (Latin) (uz-Latn)
SubLangUzbekLatin
// Uzbek (Latin) Uzbekistan (uz-Latn-UZ)
SubLangUzbekLatinUzbekistan
// Valencian Spain (ca-ESvalencia)
SubLangValencianSpain
// Venda South Africa (ve-ZA)
SubLangVendaSouthAfrica
// Vietnamese Vietnam (vi-VN)
SubLangVietnameseVietnam
// Welsh United Kingdom (cy-GB)
SubLangWelshUnitedKingdom
// Wolof Senegal (wo-SN)
SubLangWolofSenegal
// Xhosa South Africa (xh-ZA)
SubLangXhosaSouthAfrica
// Yi People's Republic Of China (ii-CN)
SubLangYiPeoplesRepublicOfChina
// Yiddish World (yi-001)
SubLangYiddishWorld
// Yoruba Nigeria (yo-NG)
SubLangYorubaNigeria
// Zulu South Africa (zu-ZA)
SubLangZuluSouthAfrica
)
const (
maxAllowedEntries = 0x1000
)
// Predefined Resource Types.
const (
RTCursor ResourceType = iota + 1 // Hardware-dependent cursor resource.
RTBitmap = 2 // Bitmap resource.
RTIcon = 3 // Hardware-dependent icon resource.
RTMenu = 4 // Menu resource.
RTDialog = 5 // Dialog box.
RTString = 6 // String-table entry.
RTFontDir = 7 // Font directory resource.
RTFont = 8 // Font resource.
RTAccelerator = 9 // Accelerator table.
RTRCdata = 10 // Application-defined resource (raw data).
RTMessageTable = 11 // Message-table entry.
RTGroupCursor = RTCursor + 11 // Hardware-independent cursor resource.
RTGroupIcon = RTIcon + 11 // Hardware-independent icon resource.
RTVersion = 16 // Version resource.
RTDlgInclude = 17 // Dialog include entry.
RTPlugPlay = 19 // Plug and Play resource.
RTVxD = 20 // VXD.
RTAniCursor = 21 // Animated cursor.
RTAniIcon = 22 // Animated icon.
RTHtml = 23 // HTML resource.
RTManifest = 24 // Side-by-Side Assembly Manifest.
)
// ImageResourceDirectory represents the IMAGE_RESOURCE_DIRECTORY.
// This data structure should be considered the heading of a table because the
// table actually consists of directory entries.
type ImageResourceDirectory struct {
// Resource flags. This field is reserved for future use. It is currently
// set to zero.
Characteristics uint32 `json:"characteristics"`
// The time that the resource data was created by the resource compiler.
TimeDateStamp uint32 `json:"time_date_stamp"`
// The major version number, set by the user.
MajorVersion uint16 `json:"major_version"`
// The minor version number, set by the user.
MinorVersion uint16 `json:"minor_version"`
// The number of directory entries immediately following the table that use
// strings to identify Type, Name, or Language entries (depending on the
// level of the table).
NumberOfNamedEntries uint16 `json:"number_of_named_entries"`
// The number of directory entries immediately following the Name entries
// that use numeric IDs for Type, Name, or Language entries.
NumberOfIDEntries uint16 `json:"number_of_id_entries"`
}
// ImageResourceDirectoryEntry represents an entry in the resource directory
// entries.
type ImageResourceDirectoryEntry struct {
// Name is used to identify either a type of resource, a resource name, or a
// resource's language ID.
Name uint32 `json:"name"`
// OffsetToData is always used to point to a sibling in the tree, either a
// directory node or a leaf node.
OffsetToData uint32 `json:"offset_to_data"`
}
// ImageResourceDataEntry Each Resource Data entry describes an actual unit of
// raw data in the Resource Data area.
type ImageResourceDataEntry struct {
// The address of a unit of resource data in the Resource Data area.
OffsetToData uint32 `json:"offset_to_data"`
// The size, in bytes, of the resource data that is pointed to by the Data
// RVA field.
Size uint32 `json:"size"`
// The code page that is used to decode code point values within the
// resource data. Typically, the code page would be the Unicode code page.
CodePage uint32 `json:"code_page"`
// Reserved, must be 0.
Reserved uint32 `json:"reserved"`
}
// ResourceDirectory represents resource directory information.
type ResourceDirectory struct {
// IMAGE_RESOURCE_DIRECTORY structure.
Struct ImageResourceDirectory `json:"struct"`
// list of entries.
Entries []ResourceDirectoryEntry `json:"entries"`
}
// ResourceDirectoryEntry represents a resource directory entry.
type ResourceDirectoryEntry struct {
// IMAGE_RESOURCE_DIRECTORY_ENTRY structure.
Struct ImageResourceDirectoryEntry `json:"struct"`
// If the resource is identified by name this attribute will contain the
// name string. Empty string otherwise. If identified by id, the id is
// available at `ID` field.
Name string `json:"name"`
// The resource identifier.
ID uint32 `json:"id"`
// IsResourceDir tell us if the entry is pointing to a resource directory or
// a resource data entry.
IsResourceDir bool `json:"is_resource_dir"`
// If this entry has a lower level directory this attribute will point to
// the ResourceDirData instance representing it.
Directory ResourceDirectory `json:"directory"`
// If this entry has no further lower directories and points to the actual