Translatability improvements from Matthias Mohr.

This commit is contained in:
Matthias Mohr 2009-10-30 09:00:41 +13:00 committed by Andrew McMillan
parent 4f885d055c
commit 526d4dce6f
6 changed files with 20 additions and 17 deletions

View File

@ -8,7 +8,7 @@ require_once("interactive-page.php");
$user_no = ( isset($_GET['user_no']) ? intval($_GET['user_no']) : 0 );
if ( !$session->AllowedTo("Admin") && ($user_no == 0 || $user_no != $session->user_no) ) {
$c->messages[] = "You may only review the contents of your own collections in this interface.";
$c->messages[] = i18n('You may only review the contents of your own collections in this interface.');
include("page-header.php");
include("page-footer.php");
exit(0);

View File

@ -29,10 +29,6 @@ if(isset($_POST['import_from_directory'])){
}
include("page-header.php");
$Tools = new Tools();
$Tools->render();
class Tools {
function render(){
@ -132,17 +128,17 @@ class Tools {
if ( check_string($ics) ) {
$path = "/".substr($file,0,-4).$path_ics;
dbg_error_log( "importFromDirectory", "importing to $path");
include_once("caldav-PUT-functions.php");
require_once("caldav-PUT-functions.php");
if ( $user = getUserByName(substr($file,0,-4),'importFromDirectory',__LINE__,__FILE__)) {
$user_no = $user->user_no;
}
if(controlRequestContainer(substr($file,0,-4),$user_no, $path,false) === -1)
continue;
import_collection($ics,$user_no,$path,1);
$c->messages[] = sprintf(translate("all events of user %s were deleted and replaced by those from file %s"),substr($file,0,-4),$dir.'/'.$file);
$c->messages[] = sprintf(translate('all events of user %s were deleted and replaced by those from file %s'),substr($file,0,-4),$dir.'/'.$file);
}
else {
$c->messages[] = sprintf(translate("the file %s is not UTF-8 encoded, please check error for more details"),$dir.'/'.$file);
$c->messages[] = sprintf(translate('the file %s is not UTF-8 encoded, please check error for more details'),$dir.'/'.$file);
}
}
}
@ -151,5 +147,8 @@ class Tools {
}
}
include("page-footer.php");
$Tools = new Tools();
include("page-header.php");
$Tools->render();
include("page-footer.php");

View File

@ -464,7 +464,7 @@ EOSQL;
$c->messages[] = sprintf(translate('Calendar "%s" for user "%s" was created.'), $path_ics, $this->Get('username'));
}
else {
$c->messages[] = sprintf(translate('The file is not UTF-8 encoded, please check the error for more details.') );
$c->messages[] = i18n('The file is not UTF-8 encoded, please check the error for more details.');
}
}
return true;

View File

@ -40,7 +40,7 @@ function rollback_on_error( $caldav_context, $user_no, $path, $message='', $erro
}
global $c;
$c->messages[] = sprintf('Status: %d, Message: %s, User: %d, Path: %s', $error_no, $message, $user_no, $path);
$c->messages[] = sprintf(translate('Status: %d, Message: %s, User: %d, Path: %s'), $error_no, $message, $user_no, $path);
}

View File

@ -63,7 +63,7 @@ class ldapDrivers
$this->connect=ldap_connect($host);
if (! $this->connect){
$c->messages[] = sprintf(i18n( "drivers_ldap : Unable to connect to LDAP with port %s on host %s"), $port,$host );
$c->messages[] = sprintf(translate( 'drivers_ldap : Unable to connect to LDAP with port %s on host %s'), $port, $host );
$this->valid=false;
return ;
}
@ -73,12 +73,12 @@ class ldapDrivers
// Start TLS if desired (requires protocol version 3)
if (isset($config['startTLS'])) {
if (!ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3)) {
$c->messages[] = sprintf(i18n( "drivers_ldap : Failed to set LDAP to use protocol version 3, TLS not supported") );
$c->messages[] = i18n('drivers_ldap : Failed to set LDAP to use protocol version 3, TLS not supported');
$this->valid=false;
return;
}
if (!ldap_start_tls($this->connect)) {
$c->messages[] = sprintf(i18n( "drivers_ldap : Could not start TLS: ldap_start_tls() failed") );
$c->messages[] = i18n('drivers_ldap : Could not start TLS: ldap_start_tls() failed');
$this->valid=false;
return;
}
@ -129,8 +129,12 @@ class ldapDrivers
foreach($this->baseDNUsers as $baseDNUsers) {
$entry = $query($this->connect,$baseDNUsers,$this->filterUsers,$attributes);
if (!ldap_first_entry($this->connect,$entry))
$c->messages[] = sprintf(i18n("Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<"),$this->filterUsers,join(', ',$attributes), $baseDNUsers);
if (!ldap_first_entry($this->connect,$entry)) {
$c->messages[] = sprintf(translate('Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<'),
$this->filterUsers,
join(', ', $attributes),
$baseDNUsers);
}
for($i = ldap_first_entry($this->connect,$entry);
$i && $arr = ldap_get_attributes($this->connect,$i);

View File

@ -39,7 +39,7 @@ class squidPamDrivers
{
global $c;
if (! file_exists($config)){
$c->messages[] = sprintf(i18n( "drivers_squid_pam : Unable to find %s file"), $config );
$c->messages[] = sprintf(i18n( 'drivers_squid_pam : Unable to find %s file'), $config );
$this->valid=false;
return ;
}