pike.git / lib / modules / Calendar.pmod / Language.pmod

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Language.pmod:307:    string islamic_year_name_from_number(int y)    {    if (y<1) return sprintf("%d BH",1-y);    return sprintf("%d AH",y);    }      //badi defaults (baha'i calendar)       string badi_month_name_from_number(int n)    { -  // Ayyám-i-Há is not a month. it is here at 0 for a lack of a better place -  // to put it. it will be ignored for now. +  // Ayyám-i-Há is not a month but the period of 4-5 days before the last +  // month. it is here at 0 to distinguish it from regular months.    return ({ "Ayyám-i-Há", "Bahá", "Jalál", "Jamál", "'Azamat", "Núr",    "Rahmat", "Kalimát", "Kamál", "Asmá", "'Izzat", "Mashíyyat",    "'Ilm", "Qudrat", "Qawl", "Masá'il", "Sharaf", "Sultán", "Mulk",    "'Alá" })[n];    }    -  +  string badi_month_shortname_from_number(int n) +  { +  // i have no idea how to abbreviate these, am just guessing here +  return ({ "Ah", "Bh", "Jl", "Jm", "Az", "Nr", "Rh", "Kl", "Km", "Am", "Iz", +  "Msh", "Ilm", "Qd", "Qw", "Ms", "Shr", "Sl", "Ml", "Al"})[n]; +  } +     int badi_month_number_from_name(string n)    {    return ([ "Bahá":1, "Baha":1, "Bh":1, "Bh":1,    "Jalál":2, "Jalal":2, "Jll":2, "Jl":2,    "Jamál":3, "Jamal":3, "Jml":3, "Jm":3,    "'Azamat":4, "Azamat":4, "Azmt":4, "Az":4,    "Núr":5, "Nur":5, "Nr":5, "Nr":5,    "Rahmat":6, "Rahmat":6, "Rhmt":6, "Rh":6,    "Kalimát":7, "Kalimat":7, "Klmt":7, "Kl":7,    "Kamál":8, "Kamal":8, "Kml":8, "Km":8,
pike.git/lib/modules/Calendar.pmod/Language.pmod:339:    "Qudrat":13, "Qudrat":13, "Qdrt":13, "Qd":13,    "Qawl":14, "Qawl":14, "Qwl":14, "Qw":14,    "Masá'il":15, "Masail":15, "Msl":15, "Ms":15,    "Sharaf":16, "Sharaf":16, "Shrf":16, "Shr":16,    "Sultán":17, "Sultan":17, "Sltn":17, "Sl":17,    "Mulk":18, "Mulk":18, "Mlk":18, "Ml":18,    "'Alá":19, "Ala":19, "Al":19, "Al":19,    ])[n];    }    -  string badi_month_shortname_from_number(int n) +  string badi_month_day_name_from_number(int n)    { -  // i have no idea how to abbreviate these, am just guessing here -  return ({ 0, "Bh", "Jl", "Jm", "Az", "Nr", "Rh", "Kl", "Km", "Am", "Iz", -  "Msh", "Ilm", "Qd", "Qw", "Ms", "Shr", "Sl", "Ml", "Al"})[n]; +  return sprintf("%d", (n>19?n-19:n));    }    -  string badi_month_day_name_from_number(int n) +  string badi_month_day_longname_from_number(int n)    {    // month day names are the same as month names    array names= ({ "Bahá", "Jalál", "Jamál", "'Azamat", "Núr", "Rahmat",    "Kalimát", "Kamál", "Asmá", "'Izzat", "Mashíyyat", "'Ilm",    "Qudrat", "Qawl", "Masá'il", "Sharaf", "Sultán", "Mulk", -  "'Alá", "Ayyám-i-Há 1", "Ayyám-i-Há 2", "Ayyám-i-Há 3", "Ayyám-i-Há 4", "Ayyám-i-Há 5" }); +  "'Alá", "", "", "", "", "" });    // not sure if the number should be included here -  return sprintf("%d (%s)", n, names[n-1]); +  return sprintf("%d (%s)", (n>19?n-19:n), names[n-1]);    }       string badi_week_day_shortname_from_number(int n)    {    // i have no idea how to abbreviate these, am just guessing here    // see badi_week_day_number_from_name for more guesses    return ({ 0, "Jl", "Jm", "Km", "Fd", "Id",    "Ij", "Iq" })[n];    }   
pike.git/lib/modules/Calendar.pmod/Language.pmod:397:    "Vidád", "Badí", "Bahí", "Abhá", "Váhid" });    if (y<1)    return sprintf("%d BB",1-y); // ? before Baha'i?    return sprintf("%d BE (%s)", y, vahid[y%19-1]); // Baha'i Era    // Váhid is a cycle of 19years with each year having a name.    // there is also the period of Kull-i-Shay which is 19 cycles of Váhid    }       int badi_year_number_from_name(string name)    { +  mapping vahid=([ "Alif":1, "Alif":1, +  "Bá":2, "Ba":2, +  "Ab":3, "Ab":3, +  "Dál":4, "Dal":4, +  "Báb":5, "Bab":5, +  "Váv":6, "Vav":6, +  "Abad":7, "Abad":7, +  "Jád":8, "Jad":8, +  "Bahá":9, "Baha":9, +  "Hubb":10, "Hubb":10, +  "Bahháj":11, "Bahhaj":11, +  "Javáb":12, "Javab":12, +  "Ahad":13, "Ahad":13, +  "Vahháb":14, "Vahhab":14, +  "Vidád":15, "Vidad":15, +  "Badí":16, "Badi":16, +  "Bahí":17, "Bahi":17, +  "Abhá":18, "Abha":18, +  "Váhid":19, "Vahid":19, +  ]); +  +  if(vahid[name]) +  return vahid[name]; +     int y;    string x;    if (sscanf(name,"%*s%d%*[ ]B%[BE]%*s",y,x)==1 || x=="")    return y>=0?y:y+1; // "-1" == integer year 0    if(stringp(x))    x-=" ";    switch (x)    {    case "E": return y;    case "B": return -y+1;