pike.git / lib / modules / Tools.pmod / Standalone.pmod / extract_locale.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/extract_locale.pike:1: - #! /usr/bin/env pike + // Locale Extractor Utility + //   // By Martin Nilsson and Andreas Lange   // - // $Id: extract_locale.pike,v 1.17 2004/01/21 18:53:58 grubba Exp $ - // + // $Id: extract_locale.pike,v 1.18 2004/01/21 19:01:32 grubba Exp $    -  + #pike __REAL_VERSION__ +    constant description = "Pike locale extractor utility";      // The arguments given to the program   mapping args = ([]);   // All the files to gather strings from   array(string) files = ({});   // All ids used, id:mapping(info)   mapping ids = ([]);   // Reversed id mapping, text:id   mapping(string:string|int) r_ids = ([]);
pike.git/lib/modules/Tools.pmod/Standalone.pmod/extract_locale.pike:684:    if(!args->nocopy)    filename += ".new"; // Create new file instead of overwriting    write("-> Writing %s (%d new)", filename, sizeof(id_pike_order));    if(!file->open(filename, "cw")) {    werror("\n* Error: Could not open %s for writing\n", filename);    exit(1);    }       foreach(id_pike_order, array id) {    // Insert ids based on tokens and the now regexp-safe string -  object(Regexp) RE; +  Regexp.SimpleRegexp RE;    // RE = ^(.*TOKEN\( ")(", string \).*)$    RE = Regexp("^(.*" + id[1] + "\\([ \n\t]*)[\"0]*" +    "([ ,\n\t]*"+id[2]+"[ \t\n]*\\).*)$");    array hits = RE->split(indata);    if(hits)    indata = hits[0] + (intp(id[0])?id[0]:"\""+id[0]+"\"") + hits[1];    else {    werror("\n* Warning: Failed to set id %O for string %O in %s",    id[0], ids[id[0]]->original, filename);    if(sizeof(ids[id[0]]->origin)<2)
pike.git/lib/modules/Tools.pmod/Standalone.pmod/extract_locale.pike:1041:    configname = args->project+".xml";    string filename = parse_config(configname);    if(!xml_name || xml_name=="")    if(filename!="")    xml_name = filename;    else if(args->xmlpath && args->baselang)    xml_name = replace(args->xmlpath, "%L", args->baselang);       if( (!(xml_name && args->sync && args->xmlpath && args->baselang)) &&    (!sizeof(files) || args->help) ) { -  sscanf("$Revision: 1.17 $", "$"+"Revision: %s $", string v); +  sscanf("$Revision: 1.18 $", "$"+"Revision: %s $", string v);    werror("\n Locale Extractor Utility "+v+"\n\n");    werror(" Syntax: pike -x extract_locale [arguments] infile(s)\n\n");    werror(" Arguments: --project=name default: first found in infile\n");    werror(" --config=file default: [project].xml\n");    werror(" --out=file default: [project]_eng.xml\n");    werror(" --nocopy update infile instead of infile.new\n");    werror(" --notime don't include dump time in xml files\n");    werror(" --wipe remove unused ids from xml\n");    werror(" --sync synchronize all locale projects\n");    werror(" --encoding=enc default: ISO-8859-1\n");