Changeset 7879 in spip-zone


Ignore:
Timestamp:
Dec 11, 2006, 5:58:44 PM (12 years ago)
Author:
bertrand@…
Message:

les _() gettext en _L() (cy_altern) le _dev_/genere_sms/ suit...

Location:
_plugins_/_dev_/sms/inc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_dev_/sms/inc/sms.php

    r7835 r7879  
    293293            $sms = &new $class($params);
    294294        } else {
    295             $sms = c_PEAR::raiseError(sprintf(_("Class definition of %s not found."), $driver));
     295            $sms = c_PEAR::raiseError(sprintf(_L("Class definition of %s not found."), $driver));
    296296        }
    297297
  • _plugins_/_dev_/sms/inc/sms/clickatell_http.php

    r7742 r7879  
    7575        $response = Net_SMS_clickatell_http::_callURL($url);
    7676        if (is_a($response, 'c_Error')) {
    77             return c_PEAR::raiseError(sprintf(_("Authentication failed. %s"), $response->getMessage()));
     77            return c_PEAR::raiseError(sprintf(_L("Authentication failed. %s"), $response->getMessage()));
    7878        }
    7979
     
    8484            return true;
    8585        } else {
    86             return $this->getError($response[1], _("Authentication failed. %s"));
     86            return $this->getError($response[1], _L("Authentication failed. %s"));
    8787        }
    8888    }
     
    181181            return trim($response[1]);
    182182        } else {
    183             return $this->getError($response[1], _("Could not check balance. %s"));
     183            return $this->getError($response[1], _L("Could not check balance. %s"));
    184184        }
    185185    }
     
    193193    {
    194194        return array(
    195             'name' => _("Clickatell via HTTP"),
    196             'desc' => _("This driver allows sending of messages through the Clickatell (http://clickatell.com) gateway, using the HTTP API"),
     195            'name' => _L("Clickatell via HTTP"),
     196            'desc' => _L("This driver allows sending of messages through the Clickatell (http://clickatell.com) gateway, using the HTTP API"),
    197197        );
    198198    }
     
    206206    {
    207207        return array(
    208             'user' => array('label' => _("Username"), 'type' => 'text'),
    209             'password' => array('label' => _("Password"), 'type' => 'text'),
    210             'api_id' => array('label' => _("API ID"), 'type' => 'text'),
     208            'user' => array('label' => _L("Username"), 'type' => 'text'),
     209            'password' => array('label' => _L("Password"), 'type' => 'text'),
     210            'api_id' => array('label' => _L("API ID"), 'type' => 'text'),
    211211        );
    212212    }
     
    224224        $params = array();
    225225        $params['from'] = array(
    226             'label' => _("Source address"),
     226            'label' => _L("Source address"),
    227227            'type' => 'text');
    228228
    229229        $params['deliv_time'] = array(
    230             'label' => _("Delivery time"),
     230            'label' => _L("Delivery time"),
    231231            'type' => 'enum',
    232             'params' => array(array('now' => _("immediate"), 'user' => _("user select"))));
    233 
    234         $types = array('SMS_TEXT' => _("Standard"), 'SMS_FLASH' => _("Flash"));
     232            'params' => array(array('now' => _L("immediate"), 'user' => _L("user select"))));
     233
     234        $types = array('SMS_TEXT' => _L("Standard"), 'SMS_FLASH' => _L("Flash"));
    235235        $params['msg_type'] = array(
    236             'label' => _("Message type"),
     236            'label' => _L("Message type"),
    237237            'type' => 'keyval_multienum',
    238238            'params' => array($types));
     
    254254        if (empty($params['from'])) {
    255255            $params['from'] = array(
    256                 'label' => _("Source address"),
     256                'label' => _L("Source address"),
    257257                'type' => 'text');
    258258        }
     
    260260        if ($params['deliv_time'] == 'user') {
    261261            $params['deliv_time'] = array(
    262                 'label' => _("Delivery time"),
     262                'label' => _L("Delivery time"),
    263263                'type' => 'int',
    264                 'desc' => _("Value in minutes from now."));
     264                'desc' => _L("Value in minutes from now."));
    265265        }
    266266
    267267        if (count($params['msg_type']) > 1) {
    268268            $params['msg_type'] = array(
    269                 'label' => _("Message type"),
     269                'label' => _L("Message type"),
    270270                'type' => 'enum',
    271271                'params' => array($params['msg_type']));
     
    297297
    298298        /* An array of error codes returned by the gateway. */
    299         $errors = array('001' => _("Authentication failed"),
    300                         '002' => _("Unknown username or password."),
    301                         '003' => _("Session ID expired."),
    302                         '004' => _("Account frozen."),
    303                         '005' => _("Missing session ID."),
    304                         '007' => _("IP lockdown violation."),
    305                         '101' => _("Invalid or missing parameters."),
    306                         '102' => _("Invalid UDH. (User Data Header)."),
    307                         '103' => _("Unknown apimsgid (API Message ID)."),
    308                         '104' => _("Unknown climsgid (Client Message ID)."),
    309                         '105' => _("Invalid destination address."),
    310                         '106' => _("Invalid source address."),
    311                         '107' => _("Empty message."),
    312                         '108' => _("Invalid or missing api_id."),
    313                         '109' => _("Missing message ID."),
    314                         '110' => _("Error with email message."),
    315                         '111' => _("Invalid protocol."),
    316                         '112' => _("Invalid msg_type."),
    317                         '113' => _("Max message parts exceeded."),
    318                         '114' => _("Cannot route message to specified number."),
    319                         '115' => _("Message expired."),
    320                         '116' => _("Invalid unicode data."),
    321                         '201' => _("Invalid batch ID."),
    322                         '202' => _("No batch template."),
    323                         '301' => _("No credit left."),
    324                         '302' => _("Max allowed credit."));
     299        $errors = array('001' => _L("Authentication failed"),
     300                        '002' => _L("Unknown username or password."),
     301                        '003' => _L("Session ID expired."),
     302                        '004' => _L("Account frozen."),
     303                        '005' => _L("Missing session ID."),
     304                        '007' => _L("IP lockdown violation."),
     305                        '101' => _L("Invalid or missing parameters."),
     306                        '102' => _L("Invalid UDH. (User Data Header)."),
     307                        '103' => _L("Unknown apimsgid (API Message ID)."),
     308                        '104' => _L("Unknown climsgid (Client Message ID)."),
     309                        '105' => _L("Invalid destination address."),
     310                        '106' => _L("Invalid source address."),
     311                        '107' => _L("Empty message."),
     312                        '108' => _L("Invalid or missing api_id."),
     313                        '109' => _L("Missing message ID."),
     314                        '110' => _L("Error with email message."),
     315                        '111' => _L("Invalid protocol."),
     316                        '112' => _L("Invalid msg_type."),
     317                        '113' => _L("Max message parts exceeded."),
     318                        '114' => _L("Cannot route message to specified number."),
     319                        '115' => _L("Message expired."),
     320                        '116' => _L("Invalid unicode data."),
     321                        '201' => _L("Invalid batch ID."),
     322                        '202' => _L("No batch template."),
     323                        '301' => _L("No credit left."),
     324                        '302' => _L("Max allowed credit."));
    325325
    326326        if (empty($error_text)) {
     
    349349        @$http->sendRequest();
    350350        if ($http->getResponseCode() != 200) {
    351             return c_PEAR::raiseError(sprintf(_("Could not open %s."), $url));
     351            return c_PEAR::raiseError(sprintf(_L("Could not open %s."), $url));
    352352        }
    353353
  • _plugins_/_dev_/sms/inc/sms/generic_smpp.php

    r7723 r7879  
    8585    {
    8686        return array(
    87             'name' => _("SMPP Gateway"),
    88             'desc' => _("This driver allows sending of messages through an SMPP gateway.")
     87            'name' => _L("SMPP Gateway"),
     88            'desc' => _L("This driver allows sending of messages through an SMPP gateway.")
    8989        );
    9090    }
     
    9999        return array(
    100100            'host' => array(
    101                 'label' => _("Host"), 'type' => 'text'),
     101                'label' => _L("Host"), 'type' => 'text'),
    102102            'port' => array(
    103                 'label' => _("Port"), 'type' => 'int'),
     103                'label' => _L("Port"), 'type' => 'int'),
    104104//             'bindParams' => array(
    105 //                 'label' => _('bind_transmitter paramaters'), 'type' => 'array'),
     105//                 'label' => _L('bind_transmitter paramaters'), 'type' => 'array'),
    106106//             'submitParams' => array(
    107 //                 'label' => _('submit_sm parameters'), 'type' => 'array'
     107//                 'label' => _L('submit_sm parameters'), 'type' => 'array'
    108108//             )
    109109        );
     
    138138        // Error sending?
    139139        if ($res === false) {
    140             return array(0, _("Error sending PDU"));
     140            return array(0, _L("Error sending PDU"));
    141141        }
    142142
    143143        $resp =& $this->_client->readPDU();
    144144        if ($resp === false) {
    145             return array(0, _("Could not read response PDU"));
     145            return array(0, _L("Could not read response PDU"));
    146146        }
    147147        if ($resp->isError()) {
    148             return array(0, sprintf(_("Sending failed: %s") . $resp->statusDesc()));
     148            return array(0, sprintf(_L("Sending failed: %s") . $resp->statusDesc()));
    149149        }
    150150
  • _plugins_/_dev_/sms/inc/sms/generic_smtp.php

    r7723 r7879  
    9090    {
    9191        return array(
    92             'name' => _("Email-to-SMS Gateway"),
    93             'desc' => _("This driver allows sending of messages through an email-to-SMS gateway, for carriers which provide this service.")
     92            'name' => _L("Email-to-SMS Gateway"),
     93            'desc' => _L("This driver allows sending of messages through an email-to-SMS gateway, for carriers which provide this service.")
    9494        );
    9595    }
     
    103103    {
    104104        return array(
    105             'carrier'     => array('label' => _("Carrier"), 'type' => 'text'),
    106             'mailBackend' => array('label' => _("c_PEAR::Mail backend"), 'type' => 'text')
     105            'carrier'     => array('label' => _L("Carrier"), 'type' => 'text'),
     106            'mailBackend' => array('label' => _L("c_PEAR::Mail backend"), 'type' => 'text')
    107107        );
    108108    }
  • _plugins_/_dev_/sms/inc/sms/sms2email_http.php

    r7742 r7879  
    101101                $to = $matches[1];
    102102            } else {
    103                 return array(0, sprintf(_("Invalid recipient: \"%s\""), $to));
     103                return array(0, sprintf(_L("Invalid recipient: \"%s\""), $to));
    104104            }
    105105        }
     
    164164            return $lines[1];
    165165        } else {
    166             return $this->getError($lines[0], _("Could not check balance. %s"));
     166            return $this->getError($lines[0], _L("Could not check balance. %s"));
    167167        }
    168168    }
     
    192192        /* Check if there was an error response. */
    193193        if (substr($response, 0, 17) != 'AQSMS-CONTACTIDOK') {
    194             return $this->getError($response, _("Could not add contact. %s"));
     194            return $this->getError($response, _L("Could not add contact. %s"));
    195195        }
    196196
     
    227227            return true;
    228228        } else {
    229             return $this->getError($response, _("Could not update contact. %s"));
     229            return $this->getError($response, _L("Could not update contact. %s"));
    230230        }
    231231    }
     
    254254            return true;
    255255        } else {
    256             return $this->getError($response, _("Could not delete contact. %s"));
     256            return $this->getError($response, _L("Could not delete contact. %s"));
    257257        }
    258258    }
     
    282282        /* Check if there was an error response. */
    283283        if (substr($response, 0, 19) != 'AQSMS-ADDRESSBOOKOK') {
    284             return $this->getError($response, _("Could not retrieve address book. %s"));
     284            return $this->getError($response, _L("Could not retrieve address book. %s"));
    285285        }
    286286
     
    291291        $length = substr($response, 19);
    292292        if (strlen($contacts_str) != $length) {
    293             return c_PEAR::raiseError(_("Could not fetch complete address book."));
     293            return c_PEAR::raiseError(_L("Could not fetch complete address book."));
    294294        }
    295295        $contacts_lines = explode("\n", $contacts_str);
     
    330330        /* Check if there was an error response. */
    331331        if (substr($response, 0, 16) != 'AQSMS-DISTITEMID') {
    332             return $this->getError($response, _("Could not create distribution list. %s"));
     332            return $this->getError($response, _L("Could not create distribution list. %s"));
    333333        }
    334334
     
    364364            return true;
    365365        } else {
    366             return $this->getError($response, _("Could not delete distribution list. %s"));
     366            return $this->getError($response, _L("Could not delete distribution list. %s"));
    367367        }
    368368    }
     
    404404            return true;
    405405        } else {
    406             return $this->getError($response, _("Could not update distribution list. %s"));
     406            return $this->getError($response, _L("Could not update distribution list. %s"));
    407407        }
    408408    }
     
    445445        /* Check if there was an error response. */
    446446        if (substr($response, 0, 22) != 'AQSMS-DISTRIBUTIONLIST') {
    447             return $this->getError($response, _("Could not retrieve distribution lists. %s"));
     447            return $this->getError($response, _L("Could not retrieve distribution lists. %s"));
    448448        }
    449449
     
    454454        $length = substr($response, 22);
    455455        if (strlen($lists_str) != $length) {
    456             return c_PEAR::raiseError(_("Could not fetch the complete list of distribution lists."));
     456            return c_PEAR::raiseError(_L("Could not fetch the complete list of distribution lists."));
    457457        }
    458458        $lists_lines = explode("\n", $lists_str);
     
    492492        /* Check if there was an error response. */
    493493        if (substr($response, 0, 22) != 'AQSMS-DISTRIBUTIONLIST') {
    494             return $this->getError($response, _("Could not retrieve distribution list. %s"));
     494            return $this->getError($response, _L("Could not retrieve distribution list. %s"));
    495495        }
    496496
     
    501501        $length = substr($response, 22);
    502502        if (strlen($list_str) != $length) {
    503             return c_PEAR::raiseError(_("Could not fetch complete distribution list."));
     503            return c_PEAR::raiseError(_L("Could not fetch complete distribution list."));
    504504        }
    505505        $list_str = trim($list_str);
     
    523523    {
    524524        return array(
    525             'name' => _("sms2email via HTTP"),
    526             'desc' => _("This driver allows sending of messages through the sms2email (http://sms2email.com) gateway, using the HTTP API"),
     525            'name' => _L("sms2email via HTTP"),
     526            'desc' => _L("This driver allows sending of messages through the sms2email (http://sms2email.com) gateway, using the HTTP API"),
    527527        );
    528528    }
     
    544544    {
    545545        $params = array();
    546         $params['user']     = array('label' => _("Username"), 'type' => 'text');
    547         $params['password'] = array('label' => _("Password"), 'type' => 'text');
    548         $params['ssl']      = array('label'    => _("Use SSL"),
     546        $params['user']     = array('label' => _L("Username"), 'type' => 'text');
     547        $params['password'] = array('label' => _L("Password"), 'type' => 'text');
     548        $params['ssl']      = array('label'    => _L("Use SSL"),
    549549                                    'type'     => 'boolean',
    550550                                    'required' => false);
    551         $params['delivery_report'] = array('label'    => _("URL for your script delivery status report"),
     551        $params['delivery_report'] = array('label'    => _L("URL for your script delivery status report"),
    552552                                           'type'     => 'text',
    553553                                           'required' => false);
     
    567567        $params = array();
    568568        $params['from'] = array(
    569             'label' => _("Source address"),
     569            'label' => _L("Source address"),
    570570            'type' => 'text');
    571571
    572572        $params['deliv_time'] = array(
    573             'label' => _("Delivery time"),
     573            'label' => _L("Delivery time"),
    574574            'type' => 'enum',
    575             'params' => array(array('now' => _("immediate"), 'user' => _("user select"))));
    576 
    577         $types = array('SMS_TEXT' => _("Standard"), 'SMS_FLASH' => _("Flash"));
     575            'params' => array(array('now' => _L("immediate"), 'user' => _L("user select"))));
     576
     577        $types = array('SMS_TEXT' => _L("Standard"), 'SMS_FLASH' => _L("Flash"));
    578578        $params['msg_type'] = array(
    579             'label' => _("Message type"),
     579            'label' => _L("Message type"),
    580580            'type' => 'keyval_multienum',
    581581            'params' => array($types));
     
    597597        if (empty($params['from'])) {
    598598            $params['from'] = array(
    599                 'label' => _("Source address"),
     599                'label' => _L("Source address"),
    600600                'type' => 'text');
    601601        }
     
    603603        if ($params['deliv_time'] == 'user') {
    604604            $params['deliv_time'] = array(
    605                 'label' => _("Delivery time"),
     605                'label' => _L("Delivery time"),
    606606                'type' => 'int',
    607                 'desc' => _("Value in minutes from now."));
     607                'desc' => _L("Value in minutes from now."));
    608608        }
    609609
    610610        if (count($params['msg_type']) > 1) {
    611611            $params['msg_type'] = array(
    612                 'label' => _("Message type"),
     612                'label' => _L("Message type"),
    613613                'type' => 'enum',
    614614                'params' => array($params['msg_type']));
     
    639639        /* An array of error codes returned by the gateway. */
    640640        $errors = array(
    641             'AQSMS-NOAUTHDETAILS'        => _("No username and/or password sent."),
    642             'AQSMS-AUTHERROR'            => _("Incorrect username and/or password."),
    643             'AQSMS-NOMSG'                => _("No message supplied."),
    644             'AQSMS-NODEST'               => _("No destination supplied."),
    645             'AQSMS-NOCREDIT'             => _("Insufficient credit."),
    646             'AQSMS-NONAMESUPPLIED'       => _("No name specified."),
    647             'AQSMS-NONUMBERSUPPLIED'     => _("No number specified."),
    648             'AQSMS-ADDRESSBOOKERROR'     => _("There was an error performing the specified address book function. Please try again later."),
    649             'AQSMS-CONTACTIDERROR'       => _("The contact ID number was not specified, left blank or was not found in the database."),
    650             'AQSMS-CONTACTUPDATEERROR'   => _("There was an error updating the contact details. Please try again later."),
    651             'AQSMS-DISTIDERROR'          => _("The distribution list ID was either not specified, left blank or not found in the database."),
    652             'AQSMS-NODISTLISTSUPPLIED'   => _("The distribution list was not specified."),
    653             'AQSMS-INSUFFICIENTCREDITS'  => _("Insufficient credit to send to the distribution list."),
    654             'AQSMS-NONUMBERLISTSUPPLIED' => _("Numbers not specified for updating in distribution list."),
    655             'AQSMS-DISTLISTUPDATEERROR'  => _("There was an error updating the distribution list. Please try again later."));
     641            'AQSMS-NOAUTHDETAILS'        => _L("No username and/or password sent."),
     642            'AQSMS-AUTHERROR'            => _L("Incorrect username and/or password."),
     643            'AQSMS-NOMSG'                => _L("No message supplied."),
     644            'AQSMS-NODEST'               => _L("No destination supplied."),
     645            'AQSMS-NOCREDIT'             => _L("Insufficient credit."),
     646            'AQSMS-NONAMESUPPLIED'       => _L("No name specified."),
     647            'AQSMS-NONUMBERSUPPLIED'     => _L("No number specified."),
     648            'AQSMS-ADDRESSBOOKERROR'     => _L("There was an error performing the specified address book function. Please try again later."),
     649            'AQSMS-CONTACTIDERROR'       => _L("The contact ID number was not specified, left blank or was not found in the database."),
     650            'AQSMS-CONTACTUPDATEERROR'   => _L("There was an error updating the contact details. Please try again later."),
     651            'AQSMS-DISTIDERROR'          => _L("The distribution list ID was either not specified, left blank or not found in the database."),
     652            'AQSMS-NODISTLISTSUPPLIED'   => _L("The distribution list was not specified."),
     653            'AQSMS-INSUFFICIENTCREDITS'  => _L("Insufficient credit to send to the distribution list."),
     654            'AQSMS-NONUMBERLISTSUPPLIED' => _L("Numbers not specified for updating in distribution list."),
     655            'AQSMS-DISTLISTUPDATEERROR'  => _L("There was an error updating the distribution list. Please try again later."));
    656656
    657657        if (empty($error_text)) {
     
    682682        @$http->sendRequest();
    683683        if ($http->getResponseCode() != 200) {
    684             return c_PEAR::raiseError(sprintf(_("Could not open %s."), $url));
     684            return c_PEAR::raiseError(sprintf(_L("Could not open %s."), $url));
    685685        }
    686686
  • _plugins_/_dev_/sms/inc/sms/vodafoneitaly_smtp.php

    r7742 r7879  
    6969            }
    7070        } else {
    71             return array(0, _("You need to provide an Italian phone number"));
     71            return array(0, _L("You need to provide an Italian phone number"));
    7272        }
    7373    }
     
    8181    {
    8282        return array(
    83             'name' => _("Vodafone Italy via SMTP"),
    84             'desc' => _("This driver allows sending of messages via SMTP through the Vodafone Italy gateway, only to Vodafone numbers. It requires an email account with Vodafone Italy (http://www.190.it)."),
     83            'name' => _L("Vodafone Italy via SMTP"),
     84            'desc' => _L("This driver allows sending of messages via SMTP through the Vodafone Italy gateway, only to Vodafone numbers. It requires an email account with Vodafone Italy (http://www.190.it)."),
    8585        );
    8686    }
     
    9393    function getParams()
    9494    {
    95         return array('user' => array('label' => _("Username"),
     95        return array('user' => array('label' => _L("Username"),
    9696                                     'type' => 'text'));
    9797    }
  • _plugins_/_dev_/sms/inc/sms/win_http.php

    r7742 r7879  
    7979                } else {
    8080                    /* If a recipient is invalid stop all further sending. */
    81                     return array(0, sprintf(_("Invalid recipient: \"%s\""), $val));
     81                    return array(0, sprintf(_L("Invalid recipient: \"%s\""), $val));
    8282                }
    8383            }
     
    8888                $to = $matches[1];
    8989            } else {
    90                 return array(0, sprintf(_("Invalid recipient: \"%s\""), $to));
     90                return array(0, sprintf(_L("Invalid recipient: \"%s\""), $to));
    9191            }
    9292        }
     
    142142    {
    143143        return array(
    144             'name' => _("WIN via HTTP"),
    145             'desc' => _("This driver allows sending of messages through the WIN (http://winplc.com) gateway, using the HTTP API"),
     144            'name' => _L("WIN via HTTP"),
     145            'desc' => _L("This driver allows sending of messages through the WIN (http://winplc.com) gateway, using the HTTP API"),
    146146        );
    147147    }
     
    158158    {
    159159        $params = array();
    160         $params['user']     = array('label' => _("Username"), 'type' => 'text');
    161         $params['password'] = array('label' => _("Password"), 'type' => 'text');
     160        $params['user']     = array('label' => _L("Username"), 'type' => 'text');
     161        $params['password'] = array('label' => _L("Password"), 'type' => 'text');
    162162
    163163        return $params;
     
    174174        $params = array();
    175175        $params['from'] = array(
    176             'label' => _("Source address"),
     176            'label' => _L("Source address"),
    177177            'type' => 'text');
    178178
    179179        $params['cost_id'] = array(
    180             'label' => _("Cost ID"),
     180            'label' => _L("Cost ID"),
    181181            'type' => 'int');
    182182
     
    197197        if (empty($params['from'])) {
    198198            $params['from'] = array(
    199                 'label' => _("Source address"),
     199                'label' => _L("Source address"),
    200200                'type' => 'text');
    201201        }
     
    203203        if (empty($params['cost_id'])) {
    204204            $params['deliv_time'] = array(
    205                 'label' => _("Cost ID"),
     205                'label' => _L("Cost ID"),
    206206                'type' => 'int');
    207207        }
     
    229229        /* An array of error codes returned by the gateway. */
    230230        $errors = array(
    231             'AQSMS-NOAUTHDETAILS'        => _("No username and/or password sent."),
    232             'AQSMS-DISTLISTUPDATEERROR'  => _("There was an error updating the distribution list. Please try again later."));
     231            'AQSMS-NOAUTHDETAILS'        => _L("No username and/or password sent."),
     232            'AQSMS-DISTLISTUPDATEERROR'  => _L("There was an error updating the distribution list. Please try again later."));
    233233
    234234        if (empty($error_text)) {
     
    267267        @$http->sendRequest();
    268268        if ($http->getResponseCode() != 200) {
    269             return c_PEAR::raiseError(sprintf(_("Could not open %s."), $this->_base_url));
     269            return c_PEAR::raiseError(sprintf(_L("Could not open %s."), $this->_base_url));
    270270        }
    271271
Note: See TracChangeset for help on using the changeset viewer.