Branch: Tag:

2000-11-20

2000-11-20 13:36:37 by Per Hedbor <ph@opera.com>

Misc locale fixes

Rev: server/base_server/basic_defvar.pike:1.21
Rev: server/base_server/config_userdb.pike:1.10
Rev: server/base_server/configuration.pike:1.397
Rev: server/base_server/global_variables.pike:1.50
Rev: server/base_server/module.pike:1.101
Rev: server/base_server/module_support.pike:1.80
Rev: server/base_server/roxen.pike:1.576
Rev: server/config_interface/standard/sites/drop_site.pike:1.12
Rev: server/config_interface/standard/sites/site_content.pike:1.102
Rev: server/etc/include/module.h:1.44
Rev: server/etc/include/roxen.h:1.19
Rev: server/etc/modules/Variable.pmod/Date.pike:1.3
Rev: server/etc/modules/Variable.pmod/Email.pike:1.7
Rev: server/etc/modules/Variable.pmod/Image.pike:1.3
Rev: server/etc/modules/Variable.pmod/Upload.pike:1.3
Rev: server/etc/modules/Variable.pmod/VerifiedString.pike:1.4
Rev: server/etc/modules/Variable.pmod/module.pmod:1.36
Rev: server/modules/configuration/config_filesystem.pike:1.64
Rev: server/modules/configuration/config_userdb.pike:1.58
Rev: server/modules/configuration/update.pike:1.26
Rev: server/modules/tags/obox.pike:1.31
Rev: server/protocols/prot_hilfe.pike:2.2

1: - // $Id: module.pmod,v 1.35 2000/11/20 07:30:15 per Exp $ + // $Id: module.pmod,v 1.36 2000/11/20 13:36:36 per Exp $      #include <module.h>   #include <roxen.h>
172:    //! The default implementation queries the locale object in roxen    //! to get the documentation.    { -  return __name || LOCALE(0,"unnamed")+" "+_id; +  return __name || LOCALE(326,"unnamed")+" "+_id;    }       string type_hint( )
330:    if( q )    add_warning( q );    else -  add_warning( LOCALE(0,"Internal error: Illegal sized array " +  add_warning( LOCALE(327,"Internal error: Illegal sized array "    "from verify_set_from_form\n") );    return;    }
448:    string warn;    if( new_value > _max && _max > _min)    { -  warn = sprintf(LOCALE(0,"Value is bigger than %s, adjusted"), +  warn = sprintf(LOCALE(328,"Value is bigger than %s, adjusted"),    _format(_max) );    new_value = _max;    }    else if( new_value < _min && _min < _max)    { -  warn = sprintf(LOCALE(0,"Value is less than %s, adjusted"), +  warn = sprintf(LOCALE(329,"Value is less than %s, adjusted"),    _format(_min) );    new_value = _min;    }
507:    string warn;    if( new_value > _max && _max > _min )    { -  warn = sprintf(LOCALE(0,"Value is bigger than %s, adjusted"), +  warn = sprintf(LOCALE(328,"Value is bigger than %s, adjusted"),    (string)_max );    new_value = _max;    }    else if( new_value < _min && _min < _max)    { -  warn = sprintf(LOCALE(0,"Value is less than %s, adjusted"), +  warn = sprintf(LOCALE(329,"Value is less than %s, adjusted"),    (string)_min );    new_value = _min;    }
649:    {    if( !strlen( value ) || !((<'~','/'>)[value[-1]]) )    return ({ -  LOCALE(0,"You most likely want an ending '/' on this variable"), +  LOCALE(330,"You most likely want an ending '/' on this variable"),    value    });    return ::verify_set( value );
686:    if( !strlen( value ) )    return ::verify_set( value );    if( !(r_file_stat( value ) && (r_file_stat( value )[ ST_SIZE ] == -2 ))) -  return ({sprintf(LOCALE(0,"%s is not a directory"),value)+"\n",value}); +  return ({sprintf(LOCALE(331,"%s is not a directory"),value)+"\n",value});    return ::verify_set( value );    }   
779:    // the value doesn't change as a side-effect by another change.    res += " " + Roxen.make_container (    "option", (["value":_name(current), "selected": "selected"]), -  sprintf(LOCALE(0,"(keep stale value %s)"),_name(current))); +  sprintf(LOCALE(332,"(keep stale value %s)"),_name(current)));    return res + "</select>";    }    static void create( mixed default_value, array|mapping choices, -  int _flags, string std_name, string std_doc ) +  int _flags, string|object std_name, +  string|object std_doc )    //! Constructor.    //!    //! Choices is the list of possible choices, can be set with
875:    return roxenp()->fonts->available_fonts();    }    static void create(mixed default_value,int flags, -  string std_name,string std_doc) +  string|object std_name,string|object std_doc)    //! Constructor.    //! Flags is a bitwise or of one or more of    //!
986:    if( q )    set_warning( q );    else -  set_warning( LOCALE(0,"Internal error: Illegal sized array " +  set_warning( LOCALE(327,"Internal error: Illegal sized array "    "from verify_set_from_form\n" ));    return;    }
1055:    if(!strlen(vi)) // empty    continue;    if( !(r_file_stat( vi ) && (r_file_stat( vi )[ ST_SIZE ] == -2 ))) -  warn += sprintf(LOCALE(0,"%s is not a directory"),vi)+"\n"; +  warn += sprintf(LOCALE(331,"%s is not a directory"),vi)+"\n";    if( strlen(vi) && vi[-1] != '/' )    value = replace( value, vi, vi+"/" );    }
1218:    string warning="";    if( (int)port )    { -  warning += sprintf(LOCALE(0,"Assuming http://*:%[0]d/ for %[0]d")+"\n", +  warning += sprintf(LOCALE(333,"Assuming http://*:%[0]d/ for %[0]d")+"\n",    (int)port);    port = "http://*:"+port+"/";    }    string protocol, host, path;       if(!strlen( port ) ) -  return ({ LOCALE(0,"Empty URL field")+"\n", port }); +  return ({ LOCALE(334,"Empty URL field")+"\n", port });       if(sscanf( port, "%[^:]://%[^/]%s", protocol, host, path ) != 3) -  return ({ sprintf(LOCALE(0,"%s does not conform to URL syntax")+"\n",port), +  return ({ sprintf(LOCALE(335,"%s does not conform to URL syntax")+"\n",port),    port });       if( path == "" || path[-1] != '/' )    { -  warning += sprintf(LOCALE(0,"Added / to the end of %s")+"\n",port); +  warning += sprintf(LOCALE(336,"Added / to the end of %s")+"\n",port);    path += "/";    }    if( nofhttp && protocol == "fhttp" )    { -  warning += sprintf(LOCALE(0,"Changed %s to http")+"\n",protocol); +  warning += sprintf(LOCALE(337,"Changed %s to http")+"\n",protocol);    protocol = "http";    }    if( protocol != lower_case( protocol ) )    { -  warning += sprintf(LOCALE(0,"Changed %s to %s"), +  warning += sprintf(LOCALE(338,"Changed %s to %s"),    protocol, lower_case( protocol ))+"\n";    protocol = lower_case( protocol );    }
1254:   #else    if( (protocol == "https" || protocol == "ftps") )    warning += -  LOCALE(0,"SSL support not available in this Pike version.")+"\n"+ -  sprintf(LOCALE(0,"Please use %s instead."), +  LOCALE(339,"SSL support not available in this Pike version.")+"\n"+ +  sprintf(LOCALE(340,"Please use %s instead."),    protocol[..strlen(protocol)-2])+"\n";   #endif    }
1263:    if( sscanf( host, "%s:%d", host, pno ) == 2)    if( roxenp()->protocols[ lower_case( protocol ) ]    && (pno == roxenp()->protocols[ lower_case( protocol ) ]->default_port )) -  warning += sprintf(LOCALE(0,"Removed the default port number " +  warning += sprintf(LOCALE(341,"Removed the default port number "    "(%d) from %s"),pno,port)+"\n";    else    host = host+":"+pno;
1272:    port = protocol+"://"+host+path;       if( !roxenp()->protocols[ protocol ] ) -  warning += sprintf(LOCALE(0,"Warning: The protocol %s is not known " +  warning += sprintf(LOCALE(342,"Warning: The protocol %s is not known "    "by roxen"),protocol)+"\n";    return ({ (strlen(warning)?warning:0), port });   }