Roxen.git / server / languages / abstract.pike

version» Context lines:

Roxen.git/server/languages/abstract.pike:2:   // --- Abstract language class ---   // Handles the conversion of numbers and dates. You have to restart the server for updates to take effect.   //      // Array(string) with the months of the year, beginning with January   constant months = ({ "", "", "", "", "", "", "", "", "", "", "", "" });      // Array(string) with the days of the week, beginning with Sunday   constant days = ({ "", "", "", "", "", "", "" });    + // Separator to implode list like ({ "foo", "bar", "fie", fum" }) => + // "foo, bar, fie SEPARATOR fum". + constant implode_conjunction = "and"; +    // Array(string) with all the language's identifiers   constant _aliases = ({});      // Array(string) with language code, the language in english   // and the native language description.   constant _id = ({ "??", "Unknown", "Unknown" });      constant languages = ([]);      array id()   {    return _id;   }      string month(int num)   {    return months[ num - 1 ];   }    -  + // Some languages (eg russian) have a different form + // of the month name if it's part of a date. + string numbered_month(int num) + { +  return month(num); + } +    string short_month(int num)   {    return months[ num - 1 ][..2];   }      string day(int num)   {    return days[ num - 1 ];   }   
Roxen.git/server/languages/abstract.pike:72:   string ordered(int i)   {    return (string)i;   }      string date(int i, mapping|void m)   {    mapping lt=localtime(i);    return sprintf("%4d-%02d-%02d", lt->year+1900, lt->mon+1, lt->mday);   } +  + string implode(array(string) items) + { +  return String.implode_nicely(items, implode_conjunction); + }