pike.git / lib / modules / Locale.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Locale.pmod/module.pmod:26:   //! #define LOCALE(X,Y) Locale.translate("my_project", \   //! get_lang(), X, Y)   //!   //! string get_lang() { return random(2)?"eng":"swe"; }   //!   //! int(0..0) main() {   //! write(LOCALE(0, "This is a line.")+"\n");   //! write(LOCALE(0, "This is another one.\n");   //! return 0;   //! } + //! + //! @note + //! In order to update your code to actually use the locale strings + //! you need to run the locale extractor. + //! + //! This is available as pike -x extract_locale + //! + //! @code + //! Syntax: pike -x extract_locale [arguments] infile(s) + //! Arguments: --project=name default: first found in infile + //! --config=file default: [project].xml + //! --out=file default: [project]_eng.xml + //! --nocopy update infile instead of infile.new + //! --notime don't include dump time in xml files + //! --wipe remove unused ids from xml + //! --sync synchronize all locale projects + //! --encoding=enc default: ISO-8859-1 + //! --verbose more informative text in xml + //! @endcode      #define CLEAN_CYCLE 60*60   //#define LOCALE_DEBUG   //#define LOCALE_DEBUG_ALL      // project_name:project_path   protected mapping(string:string) projects = ([]);   // language:(project_name:project)   protected mapping(string:mapping(string:object)) locales = ([]);   protected string default_project;
pike.git/lib/modules/Locale.pmod/module.pmod:495:    {    switch(c)    {    case 's':    return lookup();    case 'O':    return sprintf("%O(%O)", this_program, lookup());    }    }    -  protected string `+(mixed ... args) +  protected string `+(mixed arg)    { -  return predef::`+(lookup(), @args); +  return predef::`+(lookup(), arg);    }    -  protected string ``+(mixed ... args) +  protected string ``+(mixed arg)    { -  return predef::`+(@args, lookup()); +  return predef::`+(arg, lookup());    }    -  protected string `-(mixed ... args) +  protected string `-(mixed arg)    { -  return predef::`-(lookup(), @args); +  return predef::`-(lookup(), arg);    }    -  protected string ``-(mixed ... args) +  protected string ``-(mixed arg)    { -  return predef::`-(@args, lookup()); +  return predef::`-(arg, lookup());    }    -  protected string `*(mixed ... args) +  protected string `*(mixed arg)    { -  return predef::`*(lookup(), @args); +  return predef::`*(lookup(), arg);    }       protected string ``*(mixed arg)    {    return predef::`*(arg, lookup());    }       protected array(string) `/(mixed arg)    {    return predef::`/(lookup(), arg);
pike.git/lib/modules/Locale.pmod/module.pmod:556:    }       protected array(int) _values()    {    return values(lookup());    }       protected mixed cast(string to)    {    if(to=="string") return lookup(); -  if(to=="mixed" || to=="object") return this; -  error( "Cannot cast DeferredLocale to "+to+".\n" ); +  return UNDEFINED;    }       protected int _is_type(string type) {    return type=="string";    }   }