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
  
import "."; 
 
static string flat(string s) 
{ 
   return replace(lower_case(s), 
                  "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'- "/1, 
                  "aaaaaaeceeeeiiiidnoooooouuuuyty"/1+({""})*3); 
} 
 
static class _language_base 
{ 
   inherit Ruleset.Language; 
 
   static mapping events_translate=0; 
 
   string translate_event(string name) 
   { 
      if (events_translate) return events_translate[name]||name; 
      return name; 
   } 
} 
 
static string roman_number(int m) 
{ 
  string res=""; 
  if (m<0) return "["+m+"]"; 
  if (m==0) return "O"; 
  if (m>100000) return "["+m+"]"; 
  while (m>999) { res+="M"; m-=1000; } 
  if (m>899) { res+="CM"; m-=900; } 
  else if (m>499) { res+="D"; m-=500; } 
  else if (m>399) { res+="CD"; m-=400; } 
  while (m>99) { res+="C"; m-=100; } 
  if (m>89) { res+="XC"; m-=90; } 
  else if (m>49) { res+="L"; m-=50; } 
  else if (m>39) { res+="XL"; m-=40; } 
  while (m>9) { res+="X"; m-=10; } 
  if (m>8) return res+"IX"; 
  else if (m>4) { res+="V"; m-=5; } 
  else if (m>3) return res+"IV"; 
  while (m) { res+="I"; m--; } 
  return res; 
} 
 
static class _ymd_base 
{ 
   inherit _language_base; 
 
   static mapping(int:string) month_n2s; 
   static mapping(int:string) month_n2ss; 
   static mapping(string:int) month_s2n; 
   static mapping(int:string) week_day_n2s; 
   static mapping(int:string) week_day_n2ss; 
   static mapping(string:int) week_day_s2n; 
 
   string month_name_from_number(int n) 
   { 
      return month_n2s[n]; 
   } 
 
   string month_shortname_from_number(int n) 
   { 
      return month_n2ss[n]; 
   } 
 
   int month_number_from_name(string name) 
   { 
      int j=(month_s2n[flat(name)]); 
      if (!j) error("no such month of year: %O\n",name); 
      return j; 
   } 
 
   string week_day_name_from_number(int n) 
   { 
      return week_day_n2s[n]; 
   } 
 
   string week_day_shortname_from_number(int n) 
   { 
      return week_day_n2ss[n]; 
   } 
 
   int week_day_number_from_name(string name) 
   { 
      int j=(week_day_s2n[flat(name)]); 
      if (!j) error("no such day of week: %O\n",name); 
      return j; 
   } 
 
   string week_name_from_number(int n) 
   { 
      return sprintf("w%d",n); 
   } 
 
   int week_number_from_name(string s) 
   { 
      int w; 
      if (sscanf(s,"w%d",w)) return w; 
      if (sscanf(s,"%d",w)) return w; 
      return 0; 
   } 
 
   string year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d BC",1-y); 
      return (string)y; 
   } 
 
   int year_number_from_name(string name) 
   { 
      int y; 
      string x; 
      if (sscanf(name,"%d%s",y,x)==1 ||  
          x=="")  
         return y>=0?y:y+1; // "-1" == integer year 0 
      switch (x) 
      { 
         case "AD": case " AD": return y;  
         case "BC": case " BC": return -y+1; 
         default: 
            error("Can't understand year.\n"); 
      } 
   } 
 
   string month_day_name_from_number(int d,int mnd) 
   { 
      return (string)d; 
   } 
 
// gregorian defaults 
 
   string gregorian_week_day_name_from_number(int n) 
   { 
      return week_day_n2s[(n+5)%7+1]; 
   } 
 
   string gregorian_week_day_shortname_from_number(int n) 
   { 
      return week_day_n2ss[(n+5)%7+1]; 
   } 
 
   int gregorian_week_day_number_from_name(string name) 
   { 
      int j=(week_day_s2n[flat(name)]); 
      if (!j) error("no such day of week: %O\n",name); 
      return j%7+1; 
   } 
 
   string gregorian_year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d BC",1-y); 
      return sprintf("%d AD",y); 
   } 
 
 
// discordian defaults 
 
   string discordian_month_name_from_number(int n) 
   { 
      return ({0,"Chaos","Discord","Confusion","Bureaucracy","The Aftermath"})[n]; 
   } 
 
   string discordian_month_shortname_from_number(int n) 
   { 
      return ({0,"Chs","Dsc","Cfn","Bcy","Afm"})[n]; 
   } 
 
   int discordian_month_number_from_name(string name) 
   { 
      return (["chaos":1,"discord":2,"confusion":3, 
               "bureaucracy":4,"the aftermath":5, 
               "chs":1,"dsc":2,"cfn":3,"bcy":4,"afm":5]) 
         [flat(name)]; 
   } 
 
   string discordian_week_day_shortname_from_number(int n) 
   { 
      return ({0,"SM","BT","PD","PP","SO","ST"})[n]; 
   } 
 
   string discordian_week_day_name_from_number(int n) 
   { 
      return ({0,"Sweetmorn","Boomtime","Pungenday","Prickle-Prickle", 
               "Setting Orange","St. Tib's day"})[n]; 
   } 
 
   int discordian_week_day_number_from_name(string name) 
   { 
      return (["sweetmorn":1,"boomtime":2,"pungenday":3,"prickle-prickle":4, 
               "setting orange":5,"st. tib's day":6, 
               "prickleprickle":4,"setting":5,"orange":5,"tib":6,"tibs":6, 
               "sttib":6,"sttibs":6,"saint tib's day":6, 
               "sm":1,"bt":2,"pd":3,"pp":4,"so":5,"st":6]) 
         [flat(name)]; 
   } 
 
   string discordian_week_name_from_number(int n) 
   { 
      return "w"+n; 
   } 
 
   string discordian_year_name_from_number(int y) 
   { 
      return (string)y; 
   } 
 
// coptic defaults 
 
   string coptic_month_name_from_number(int n) 
   { 
      return ({0,"Tout","Baba","Hator","Kiahk","Toba", 
               "Amshir","Baramhat","Baramouda","Pakho", 
               "Paona","Epep","Mesra","Nasie"})[n]; 
   } 
 
   string coptic_month_shortname_from_number(int n) 
   { 
      return ({0,"Tou","Bab","Hat","Kia","Tob", 
               "Ams","Bar","Bar","Pak", 
               "Pao","Epe","Mes","Nas"})[n]; 
   } 
 
   int coptic_month_number_from_name(string name) 
   { 
      return (["tout":1,"baba":2,"hator":3,"kiahk":4,"toba":5, 
               "amshir":6,"baramhat":7,"baramouda":8,"pakho":9, 
               "paona":10,"epep":11,"mesra":12,"nasie":13, 
               "tou":1,"bab":2,"hat":3,"kia":4,"tob":5, 
               "ams":6,"bar":7,"bar":8,"pak":9, 
               "pao":10,"epe":11,"mes":12,"nas":13]) 
         [flat(name)]; 
   } 
 
   string coptic_year_name_from_number(int y) 
   { 
      return (string)y; 
   } 
 
   int x; 
 
// islamic defaults 
 
   array(string) islamic_months= 
   ",Muharram,Safar,Rebîu'l-awwal,Rebîul-âchir," 
   "Djumâda'l-ûla,Djumâda'l-âchira,Redjeb,Shaabân,Ramadân," 
   "Schawwâl,Dhu'l-káada,Dhu'l-Hiddja"/","; 
   array(string) islamic_shortmonths= // help! :) 
   ",Muharram,Safar,Rebîu'l-awwal,Rebîul-âchir," 
   "Djumâda'l-ûla,Djumâda'l-âchira,Redjeb,Shaabân,Ramadân," 
   "Schawwâl,Dhu'l-káada,Dhu'l-Hiddja"/","; 
   mapping islamic_backmonth=0; 
   array(string) islamic_shortweekdays= 
   ",aha,ith,thu,arb,kha,dsc,sab"/","; 
   array(string) islamic_weekdays= 
   ",ahad,ithnain,thulâthâ,arbiâ,khamîs,dschuma,sabt"/","; 
   mapping islamic_backweekday=0; 
 
   string islamic_month_name_from_number(int n) 
   { 
      return islamic_months[n]; 
   } 
 
   string islamic_month_shortname_from_number(int n) 
   { 
      return islamic_shortmonths[n]; 
   } 
 
   int islamic_month_number_from_name(string name) 
   { 
      if (!islamic_backmonth) 
      { 
         islamic_backmonth= 
            mkmapping(map(islamic_months[1..],flat), 
                      enumerate(12,1,1))| 
            mkmapping(map(islamic_months[1..],flat), 
                      enumerate(12,1,1))| 
         (["rabi1":2, 
           "rabi2":3, 
           "djumada1":4, 
           "djumada2":5]); 
      } 
       
      return islamic_backmonth[`-(flat(name),"-","'"," ")]; 
   } 
 
   string islamic_week_day_name_from_number(int n) 
   { 
      return "jaum el "+islamic_weekdays[n]; 
   } 
 
   string islamic_week_day_shortname_from_number(int n) 
   { 
      return islamic_shortweekdays[n]; 
   } 
 
   int islamic_week_day_number_from_name(string name) 
   { 
      if (!islamic_backweekday) 
      { 
         islamic_backweekday= 
            mkmapping(map(map(islamic_weekdays[1..],flat),`-,"'","-"), 
                      enumerate(7,1,1))| 
            mkmapping(map(map(islamic_weekdays[1..],flat),`-,"'","-"), 
                      enumerate(7,1,1)); 
      } 
       
      sscanf(name,"jaum el %s",name); 
      return islamic_backweekday[`-(flat(name),"-","'")]; 
   } 
 
 
   string islamic_week_name_from_number(int n) 
   { 
      return "w"+n; 
   } 
 
   string islamic_year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d BH",1-y); 
      return sprintf("%d AH",y); 
   } 
} 
 
// ---------------------------------------------------------------- 
 
// this sets up the mappings from the arrays 
 
#define SETUPSTUFF                                                    \ 
      month_n2s=mkmapping(enumerate(12,1,1),month_names);               \ 
      month_n2ss=                                                       \ 
         mkmapping(enumerate(12,1,1),map(month_names,predef::`[],0,2)); \ 
      month_s2n=                                                        \ 
         mkmapping(map(map(month_names,predef::`[],0,2),flat),  \ 
                   enumerate(12,1,1))                                   \ 
         | mkmapping(map(month_names,flat),enumerate(12,1,1));  \ 
      week_day_n2s= mkmapping(enumerate(7,1,1),week_day_names);         \ 
      week_day_n2ss= mkmapping(enumerate(7,1,1),                        \ 
                               map(week_day_names,predef::`[],0,2));    \ 
      week_day_s2n=                                                     \ 
         mkmapping(map(map(week_day_names,predef::`[],0,2),flat),       \ 
                   enumerate(7,1,1))                                    \ 
         | mkmapping(map(week_day_names,flat),enumerate(7,1,1)) 
 
// ---------------------------------------------------------------- 
// now the real classes: 
 
// this should probably be called UK_en or something: 
 
constant cENGLISH=cISO; 
class cISO 
{ 
   inherit _ymd_base; 
    
   constant month_names= 
   ({"January","February","March","April","May","June","July","August", 
     "September","October","November","December"}); 
 
   constant week_day_names= 
   ({"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}); 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
 
   string week_name_from_number(int n) 
   { 
      return sprintf("w%d",n); 
   } 
 
   int week_number_from_name(string s) 
   { 
      int w; 
      if (sscanf(s,"w%d",w)) return w; 
      if (sscanf(s,"%d",w)) return w; 
      return 0; 
   } 
 
   string year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d BC",1-y); 
      return (string)y; 
   } 
}; 
 
// swedish (note: all name as cLANG where LANG is in caps) 
 
constant cSE_SV=cSWEDISH; 
class cSWEDISH 
{ 
   inherit _ymd_base; 
 
   static private constant month_names= 
   ({"januari","februari","mars","april","maj","juni","juli","augusti", 
     "september","oktober","november","december"}); 
 
   static private constant week_day_names= 
   ({"måndag","tisdag","onsdag","torsdag", 
     "fredag","lördag","söndag"}); 
 
   static mapping events_translate= 
   ([ 
      "New Year's Day":             "Nyårsdagen", 
      "Epiphany":           "Trettondag jul", 
      "King's Nameday":             "H K M Konungens namnsdag", 
      "Candlemas":          "Kyndelsmässodagen", 
      "St. Valentine":              "Alla hjärtans dag", 
      "Int. Women's Day":   "Internationella kvinnodagen", 
      "Crown Princess' Nameday":"H K M Kronprinsessans namnsdag", 
      "Waffle Day":         "Våffeldagen", 
      "Annunciation":               "Marie bebådelsedag", 
      "Labor Day":          "Första maj", 
      "Sweden's Flag Day":  "Svenska flaggans dag", 
      "St. John the Baptist":       "Johannes Döpares dag", 
      "Crown Princess' Birthday":"H K M Kronprinsessans födelsedag", 
      "Queen's Nameday":    "H K M Drottningens namnsdag", 
      "UN Day":                     "FN-dagen", 
      "All saints Day":             "Allhelgonadagen", 
      "King's Nameday":             "H K M Konungens namnsdag", 
      "King's Birthday":    "H K M Konungens födelsedag", 
      "St. Lucy":           "Luciadagen", 
      "Queen's Birthday":   "H K M Drottningens födelsedag", 
      "Christmas Eve":              "Julafton", 
      "Christmas Day":              "Juldagen", 
      "St. Stephen":                "Annandagen", 
      "New Year's Eve":             "Nyårsafton", 
      "Midsummer's Eve":    "Midsommarafton", 
      "Midsummer's Day":    "Midsommardagen", 
      "All Saints Day":             "Allhelgonadagen", 
 
      "Fat Tuesday":                "Fettisdagen", 
      "Palm Sunday":                "Palmsöndagen", 
      "Good Friday":                "Långfredagen", 
      "Easter Eve":         "Påskafton", 
      "Easter":                     "Påskdagen", 
      "Easter Monday":              "Annandag påsk", 
      "Ascension":          "Kristi himmelsfärd", 
      "Pentecost Eve":              "Pingstafton", 
      "Pentecost":          "Pingst", 
      "Pentecost Monday":   "Annandag pingst", 
      "Advent 1":           "Första advent", 
      "Advent 2":           "Andra advent", 
      "Advent 3":           "Tredje advent", 
      "Advent 4":           "Fjärde advent", 
      "Mother's Day":               "Mors dag", 
      "Father's Day":               "Fars dag", 
 
      "Summer Solstice":    "Sommarsolstånd", 
      "Winter Solstice":    "Vintersolstånd", 
      "Spring Equinox":             "Vårdagjämning", 
      "Autumn Equinox":             "Höstdagjämning", 
 
// not translated: 
//    "Halloween" 
//    "Alla helgons dag" 
//    "Valborgsmässoafton" 
   ]); 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
 
   string week_name_from_number(int n) 
   { 
      return sprintf("v%d",n); 
   } 
 
   int week_number_from_name(string s) 
   { 
      if (sscanf(s,"v%d",int w)) return w; 
      return ::week_number_from_name(s); 
   } 
 
   string year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d fk",1-y); 
      return (string)y; 
   } 
} 
 
// austrian 
// Martin Baehr <mbaehr@email.archlab.tuwien.ac.at> 
 
class cAUSTRIAN 
{ 
   inherit _ymd_base; 
 
   static private constant month_names= 
      ({"jänner","feber","märz","april","mai","juni","juli","august", 
        "september","oktober","november","dezember"}); 
 
   static private constant week_day_names= 
      ({"montag","dienstag","mittwoch","donnerstag", 
        "freitag","samstag","sonntag"}); 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
} 
 
// Welsh 
 
class cWELSH 
{ 
   inherit _ymd_base; 
 
   static private constant month_names= 
   ({"ionawr","chwefror","mawrth","ebrill","mai","mehefin", 
     "gorffenaf","awst","medi","hydref","tachwedd","rhagfyr"}); 
 
   static private constant week_day_names= 
   ({"Llun","Mawrth","Mercher","Iau","Gwener","Sadwrn","Sul"}); 
 
   string week_day_name_from_number(int n) 
   { 
      return "dydd "+::week_day_name_from_number(n); 
   } 
 
   int week_day_number_from_name(string name) 
   { 
      sscanf(name,"dydd %s",name); 
      return week_day_number_from_name(name); 
   } 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
} 
 
// Spanish 
// Julio César Gázquez <jgazquez@dld.net> 
 
class cSPANISH 
{ 
   inherit _ymd_base; 
 
   static private constant month_names= 
   ({"enero","febrero","marzo","abril","mayo","junio", 
     "julio","agosto","setiembre","octubre","noviembre","diciembre"}); 
 
   static private constant week_day_names= 
   ({"lunes","martes","miércoles","jueves", 
     "viernes","sábado","domingo"}); 
 
// contains argentina for now 
   static mapping events_translate= 
   ([ 
      "Epiphany":"Día de Reyes", // Epifania 
      "Malvinas Day":"Día de las Malvinas", 
      "Labor Day":"Aniversario de la Revolución", 
      "Soberany's Day":"Día de la soberania", 
      "Flag's Day":"Día de la bandera", 
      "Independence Day":"Día de la independencia", 
      "Assumption Day":"Día de la asunción", // ? 
      "Gral San Martín decease": 
      "Aniversario del fallecimiento del Gral. San Martin", 
      "Race's Day":"Día de la Raza", 
      "All Saints Day":"Día de todos los santos", 
      "Immaculate Conception":"Inmaculada Concepción", 
      "Christmas Day":"Natividad del Señor", 
      "New Year's Day":"Año Nuevo", 
      "Holy Thursday":"Jueves Santo", 
      "Good Friday":"Viernes Santo", 
      "Holy Saturday":"Sãbado de gloria", 
      "Easter":"Domingo de resurrección", 
      "Corpus Christi":"Corpus Christi" 
   ]); 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
} 
 
// portugese; don't know other then the holidays 
// source: Sérgio Araújo <sergio@projecto-oasis.cx> 
 
class cPORTUGESE 
{ 
   inherit _ymd_base; 
 
//     static private constant month_names= 
//     ({"enero","febrero","marzo","abril","mayo","junio", 
//       "julio","agosto","setiembre","octubre","noviembre","diciembre"}); 
 
//     static private constant week_day_names= 
//     ({"lunes","martes","miércoles","jueves", 
//       "viernes","sábado","domingo"}); 
 
// contains argentina for now 
   static mapping events_translate= 
   ([ 
      "New Year's Day":"Ano Novo", 
      "Sexta-Feira Santa":"Sexta-Feira Santa", 
      "Liberty Day":"Dia da Liberdade", 
      "Labor Day":"Dia do Trabalhador", 
      "Portugal Day":"Dia de Portugal", 
      "Corpus Christi":"Corpo de Deus", 
      "Assumption Day":"Assunção", 
      "Republic Day":"Implantação da República", 
      "All Saints Day":"Todos-os-Santos", 
      "Restoration of the Independence":"Restauração da Independência", 
      "Immaculate Conception":"Imaculada Conceição", 
      "Christmas":"Natal" 
   ]); 
 
//     void create() 
//     { 
//        SETUPSTUFF; 
//     } 
} 
 
// Hungarian 
// Csongor Fagyal <concept@conceptonline.hu> 
 
class cHUNGARIAN 
{ 
   inherit _ymd_base; 
 
   static private constant month_names= 
   ({"Január","Február","Március","Április","Május","Június", 
     "Július","August","September","October","November","December"}); 
 
   static private constant week_day_names= 
   ({"Hétfo","Kedd","Szerda","Csütörtkök","Péntek","Szombat","Vasárnap"}); 
 
// contains argentina for now 
   static mapping events_translate= 
   ([ 
      "New Year's Day":"Úb év ünnepe", 
      "1848 Revolution Day":"Az 'Az 1848-as Forradalom Napja", 
      "Holiday of Labor":"A munka ünnepe", 
      "Constitution Day":"Az alkotmány ünnepe", 
      "'56 Revolution Day":"Az '56-os Forradalom ünnepe", 
      "Easter":"Húsvét", 
      "Easter monday":"Húsvét", 
      "Whitsunday":"Pünkösd", 
      "Whitmonday":"Pünkösd", 
      "Christmas":"Christmas", 
   ]); 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
} 
 
// Modern Latin 
 
class cLATIN 
{ 
   inherit _ymd_base; 
 
   static array(string) month_names= 
   ({"Ianuarius", "Februarius", "Martius", "Aprilis", "Maius", "Iunius",  
     "Iulius", "Augustus", "September", "October", "November", "December" }); 
 
   static private constant week_day_names= 
   ({"lunae","Martis","Mercurii","Jovis","Veneris","Saturni","solis"}); 
 
   string week_day_name_from_number(int n) 
   { 
      return ::week_day_name_from_number(n)+" dies"; 
   } 
 
   int week_day_number_from_name(string name) 
   { 
      sscanf(name,"%s dies",name); 
      return week_day_number_from_name(name); 
   } 
 
   string gregorian_year_name_from_number(int y) 
   { 
      return year_name_from_number(y); 
   } 
 
   string year_name_from_number(int y) 
   { 
      if (y<1) return sprintf("%d BC",1-y); // ? 
      return sprintf("anno ab Incarnatione Domini %s",roman_number(y)); 
   } 
 
   void create() 
   { 
      SETUPSTUFF; 
   } 
} 
 
// Roman latin 
 
class cROMAN 
{ 
   inherit cLATIN; 
 
   static array(string) month_names= 
   ({"Ianuarius", "Februarius", "Martius", "Aprilis", "Maius", "Iunius", 
     "Quintilis", // Iulius 
     "Sextilis",  // Augustus 
     "September", "October", "November", "December" 
   }); 
 
   string year_name_from_number(int y) 
   { 
      return sprintf("%s ab urbe condita",roman_number(y+752)); 
   } 
    
   string month_day_name_from_number(int d,int mnd) 
   { 
// this is not really correct, I've seen but 
// i can't find it - they did something like 4 from the start of the 
// months, 19 from the end of the month. 
      return roman_number(d);  
   } 
} 
 
 
 
 
// ---------------------------------------------------------------- 
 
// find & compile language 
 
static mapping _cache=([]); 
 
Ruleset.Language `[](string lang) 
{ 
   lang=upper_case(lang); 
   Ruleset.Language l=_cache[lang]; 
   if (l) return l; 
   program cl=::`[]("c"+lang); 
 
   if (!cl) { return ([])[0]; } 
 
   l=_cache[lang]=cl(); 
    
   return l; 
}