Roxen.git / server / modules / tags / translation_mod.pike

version» Context lines:

Roxen.git/server/modules/tags/translation_mod.pike:4:   #include <module.h>   inherit "module";         // ---------------- Module registration stuff ----------------      constant module_type = MODULE_TAG;   constant module_name = "Tags: Translation module";   constant module_doc = "This module provides an RXML API to the Pike localization system.";   constant thread_safe = 1; - constant cvs_version = "$Id: translation_mod.pike,v 1.14 2004/06/30 16:59:27 mast Exp $"; + constant cvs_version = "$Id: translation_mod.pike,v 1.15 2006/03/01 13:53:02 jonasw Exp $";               // ------------------------ The tags -------------------------      class TagTranslationRegistration {    inherit RXML.Tag;    constant name = "trans-reg";    constant flags = RXML.FLAG_EMPTY_ELEMENT;
Roxen.git/server/modules/tags/translation_mod.pike:40:    result = "";    return 0;    }    }   }      class TagTranslate {    inherit RXML.Tag;    constant name = "translate";    +  array(RXML.Type) result_types = ({ RXML.t_html(RXML.PXml) }); +     mapping(string:RXML.Type) opt_arg_types = ([    "id":RXML.t_text(RXML.PEnt),    "project":RXML.t_text(RXML.PEnt),    "variable":RXML.t_text(RXML.PEnt),    "scope":RXML.t_text(RXML.PEnt) ]);       class Frame {    inherit RXML.Frame;       array do_return( RequestID id ) {    string proj = args->project || id->misc->translation_proj;    string trans = Locale.translate(proj, roxen.locale->get(),    (int)args->id || args->id,    content);       if(args->variable) {    RXML.user_set_var(args->variable, trans, args->scope);    return 0;    }    -  result = trans; -  return 0; +  return ({ trans });    }    }   }   TAGDOCUMENTATION;   #ifdef manual   constant tagdoc=([      "trans-reg":#"<desc tag='tag'><p><short>    Registers a locale project in the locale system.</short> Used    internally by Roxen. You don't know how to use this tag. </p>