Branch: Tag:

2003-03-10

2003-03-10 01:22:13 by Martin Nilsson <mani@lysator.liu.se>

Language is in Rule, not Ruleset. Use String.int2roman for roman conversion.

Rev: lib/modules/Calendar.pmod/Language.pmod:1.19

11:      static class _language_base   { -  inherit Ruleset.Language; +  inherit Rule.Language;       static mapping events_translate=0;   
24:      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; +  return String.int2roman(m);   }      static class _ymd_base
2014:      static mapping _cache=([]);    - Ruleset.Language `[](string lang) + Rule.Language `[](string lang)   {    lang=upper_case(lang); -  Ruleset.Language l=_cache[lang]; +  Rule.Language l=_cache[lang];    if (l) return l;    program cl=::`[]("c"+lang);