From 5569c969eb95bedada2480dcf4b49a50945089a7 Mon Sep 17 00:00:00 2001 From: konrad Date: Sat, 1 Mar 2008 17:40:53 +0000 Subject: [PATCH] added some translatable items in PHP source git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@100 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/smoke.pro | 5 +- src/smoke_de.ts | 517 +++++++++++++++++++++++++++++++++++------- src/smoke_de_SAX.ts | 518 +++++++++++++++++++++++++++++++++++-------- www/inc/machine/host.php | 4 +- www/inc/machine/session.php | 42 ++-- www/machine.php | 10 +- 6 files changed, 892 insertions(+), 204 deletions(-) diff --git a/src/smoke.pro b/src/smoke.pro index c52c87b..1686e0e 100644 --- a/src/smoke.pro +++ b/src/smoke.pro @@ -35,6 +35,8 @@ SOURCES = \ user.cpp \ host.cpp \ checkdlg.cpp + +#some PHP files are listed below to scan them for translatable items: HEADERS = \ keygen.h \ mainwindow.h \ @@ -48,7 +50,8 @@ HEADERS = \ host.h \ checkdlg.h \ ../www/machine.php \ - ../www/inc/machine/session.php + ../www/inc/machine/session.php \ + ../www/inc/machine/host.php RESOURCES += files.qrc diff --git a/src/smoke_de.ts b/src/smoke_de.ts index ecee680..6261bd9 100644 --- a/src/smoke_de.ts +++ b/src/smoke_de.ts @@ -118,10 +118,110 @@ - + _admin + + + unable to parse XML data + + + + + Cannot delete special hosts. + + + + + missing some authentication data + + + + + Not authenticated. Can't change password. + + + + + expected exactly one passwd element + + + + + cannot set an empty password + + + + + Ooops. Unable to find user. You have been deleted. + + + + + Wrong password. Session hijacked, terminating it. + + + + + invalid user name + + + + + expected exactly 1 ACL element + + + + + unknown user name + + + + + expected exactly 1 Hosts element + + + + + Unable to change this password. + + + + + setmypasswd + + + + + setpasswd + + + + + Invalid Request, please use the MagicSmoke Client with this page. + + + + + Invalid or missing sessionid, or session timed out. + + + + + Session not yet authenticated. + + + + + You do not have the right to execute this transaction. + + + + + Internal Error: unknown command, hiccup in code structure. + + MCheckDialog @@ -300,434 +400,657 @@ At least %1 Bits of random are required. MMainWindow - + Profile: - + Alternate Hostname: - + Server URL: - + Proxy: - + Username: - + Password: - + New Profile - + Please enter a profile name. It must be non-empty and must not be used yet: - + Proxy Username: - + Proxy Password: - + Warning - + Unable to log in. Error: %1 - + &File - + &New Profile... - + &Save Profile - + &Close Window - + &Configure - + new Profile - + save Profile - + Login - + &Language... - + &Export Host Key... - + &Import Host Key... - + &Generate Host Key... - + Export Key to File - + Unable to open file %1 for writing: %2 - + Importing a key overwrites the host key that is currently used by this program. This may disable your accounts. Do you still want to continue? - + Import Key from File - + Unable to open file %1 for reading: %2 - + This is not a host key file. - + This host key file does not contain a valid key. - + The key check sum did not match. Please get a clean copy of the host key file. + + + New Host Name + + + + + Please enter a name for the new host: + + + + + The host name must only consist of letters, digits and underscore. It must start with a letter. + + + + + This host key file does not contain a valid host name. + + MOverview - + &Session - + &Re-Login - + &Close Session - + &Event - + &Customer - + C&onfigure - + Events - + Warning - + I was unable to renew the login at the server, the error was: %1 - + &Offline mode - + &New Event... - + &Show all customers - + C&art - + Add &Ticket - + Add &Voucher - + &Remove Item - + &Abort Shopping - + &Show all orders - + New Event... - + Details... - + Order Ticket... - + Shopping Cart - + Add Ticket - + Add Voucher - + Remove Item - + Customer: - + Delivery Address: - + Comments: - + Save Order - + Clear - + Start Time - + Title - + ddd MMMM d yyyy, h:mm ap time format - + &Update Event List - + &Show/Edit details... - + Users - + New User... - + Delete User... - + Description... - + Hosts... - + Roles... - + Hosts - + Login Name - + Description - + New User - + Please enter new user name (only letters, digits, and underscore allowed): - + Error - + The user name must contain only letters, digits, and underscores and must be at least one character long! - + Edit Description - + Descriptionof user %1: + + + Change my &Password + + + + + Set Password... + + + + + New Host... + + + + + Add This Host... + + + + + Delete Host... + + + + + Generate New Key... + + + + + Import... + + + + + Export... + + + + + Password + + + + + Please enter an initial password for the user: + + + + + Delete User? + + + + + Really delete user '%1'? + + + + + Error setting password: %1 + + + + + The password must be non-empty and both lines must match + + + + + Host Name + + + + + Host Key + + + + + Create New Host + + + + + Please enter a host name: + + + + + The key of this new host could only be generated with %1 bits entropy. Store anyway? + + + + + Delete this Host? + + + + + Really delete host '%1'? + + + + + Change Host Key? + + + + + Really change the key of host '%1'? + + + + + The new key of this host could only be generated with %1 bits entropy. Store anyway? + + + + + Import Key from File + + + + + Unable to open file %1 for reading: %2 + + + + + This is not a host key file. + + + + + This host key file does not contain a valid host name. + + + + + This host key file does not contain a valid key. + + + + + The key check sum did not match. Please get a clean copy of the host key file. + + + + + This host cannot be exported. + + + + + Export Key to File + + + + + Unable to open file %1 for writing: %2 + + + + + MPasswordChange + + + Change my password + + + + + Reset password of user %1 + + + + + Old Password: + + + + + New Password: + + + + + Repeat Password: + + + + + Set Password + + + + + Cancel + + MUserHost - + _any - + _online - + _anon @@ -790,10 +1113,30 @@ At least %1 Bits of random are required. - + Error parsing EventList XML data (line %1 column %2): %3 + + + Cannot change password, old password does not match! + + + + + Error parsing RoomList XML data (line %1 column %2): %3 + + + + + Error parsing UserList XML data (line %1 column %2): %3 + + + + + Error parsing HostList XML data (line %1 column %2): %3 + + initkey diff --git a/src/smoke_de_SAX.ts b/src/smoke_de_SAX.ts index 0157dd1..95388d8 100644 --- a/src/smoke_de_SAX.ts +++ b/src/smoke_de_SAX.ts @@ -1,6 +1,5 @@ - @default @@ -119,10 +118,110 @@ Lisde dor Gunden anguggn - + _admin Godd. Darf alles, gann alles, wees alles bessor. + + + unable to parse XML data + + + + + Cannot delete special hosts. + + + + + missing some authentication data + + + + + Not authenticated. Can't change password. + + + + + expected exactly one passwd element + + + + + cannot set an empty password + + + + + Ooops. Unable to find user. You have been deleted. + + + + + Wrong password. Session hijacked, terminating it. + + + + + invalid user name + + + + + expected exactly 1 ACL element + + + + + unknown user name + + + + + expected exactly 1 Hosts element + + + + + Unable to change this password. + + + + + setmypasswd + + + + + setpasswd + + + + + Invalid Request, please use the MagicSmoke Client with this page. + + + + + Invalid or missing sessionid, or session timed out. + + + + + Session not yet authenticated. + + + + + You do not have the right to execute this transaction. + + + + + Internal Error: unknown command, hiccup in code structure. + + MCheckDialog @@ -301,215 +400,235 @@ At least %1 Bits of random are required. MMainWindow - + Profile: Brofiel: - + Alternate Hostname: Andror Reschnername: - + Server URL: URL vom diggen Reschnor: - + Proxy: Web-Broggsie: - + Username: Nudsorname: - + Password: Gans doll geheimer Gohd: - + New Profile Neues Brofiel - + Please enter a profile name. It must be non-empty and must not be used yet: Bidde gäben'se 'nen Namen für das neue Brofiel ein. Der darf noch ni' benudsd sein und leer darf'or och nedd sein: - + Proxy Username: Nudsername für'n Broggsie: - + Proxy Password: Geheimer Gohd für'n Broggsie: - + Warning Dumm gelaufen - + Unable to log in. Error: %1 Isch gann nisch off'n gross'n Reschner. Der will nisch weil: %1 - + &File &Dadai - + &New Profile... &Neues Brofiel - + &Save Profile Brofiel &schbeichorn - + &Close Window Fänsdor &zumach'n - + &Configure &Gonfiguriern - + new Profile Neues Brofiel - + save Profile Brofiel schbeichorn - + Login Droff offn' Reschnor - + &Language... &Schbrache... - + &Export Host Key... - + &Import Host Key... - + &Generate Host Key... - + Export Key to File - + Unable to open file %1 for writing: %2 - + Importing a key overwrites the host key that is currently used by this program. This may disable your accounts. Do you still want to continue? - + Import Key from File - + Unable to open file %1 for reading: %2 - + This is not a host key file. - + This host key file does not contain a valid key. - + The key check sum did not match. Please get a clean copy of the host key file. + + + New Host Name + + + + + Please enter a name for the new host: + + + + + The host name must only consist of letters, digits and underscore. It must start with a letter. + + + + + This host key file does not contain a valid host name. + + MOverview - + &Session &Sidsung - + &Re-Login &Noch'ma einloggn - + &Close Session Sidsung &Zumachn - + &Event &Veranschdaldung - + &Customer &Gunde - + C&onfigure G&onfiguriern - + Events Veranschdaldungen - + Warning Dumm gelaufen - + I was unable to renew the login at the server, the error was: %1 Isch gann de' Verbindung off'n gross'n Reschner nisch erneuern. Der will nisch weil: %1 - + &Offline mode &Ohne Neds und Dobbelden Boden @@ -519,221 +638,424 @@ At least %1 Bits of random are required. &Dedails anzeigen... - + &New Event... Veranschdaldung &absach'n... - + &Show all customers &Alle Gunden anzeigen - + C&art Eing&aufswagen - + Add &Ticket Ein&driddsgarde hinzufüchen - + Add &Voucher &Gudschein hinzufüchen - + &Remove Item Doch &ni' nehm' - + &Abort Shopping &Eingauf Abbrechen - + &Show all orders &Alle Beschdellungen anzeichen - + New Event... Neue Veranschdaldung... - + Details... Dedails anzeichen... - + Order Ticket... Eindriddsgarde beschdellen... - + Shopping Cart Eingaufswagen - + Add Ticket Eindriddsgarde hinzufüchen - + Add Voucher Gudschein hinzufüchen - + Remove Item Doch ni' nehm' - + Customer: Gunde: - + Delivery Address: Adresse wo's Zeuch hin soll: - + Comments: Wischdiches Gelaber und Gerede: - + Save Order Beschdellung abschbeichern - + Clear Wechwerfen und von vorne! - + Start Time - + Title - + ddd MMMM d yyyy, h:mm ap time format ddd, d.M.yyyy hh:mm - + &Update Event List - + &Show/Edit details... - + Users - + New User... - + Delete User... - + Description... - + Hosts... - + Roles... - + Hosts - + Login Name - + Description - + New User - + Please enter new user name (only letters, digits, and underscore allowed): - + Error - + The user name must contain only letters, digits, and underscores and must be at least one character long! - + Edit Description - + Descriptionof user %1: + + + Change my &Password + + + + + Set Password... + + + + + New Host... + + + + + Add This Host... + + + + + Delete Host... + + + + + Generate New Key... + + + + + Import... + + + + + Export... + + + + + Password + + + + + Please enter an initial password for the user: + + + + + Delete User? + + + + + Really delete user '%1'? + + + + + Error setting password: %1 + + + + + The password must be non-empty and both lines must match + + + + + Host Name + + + + + Host Key + + + + + Create New Host + + + + + Please enter a host name: + + + + + The key of this new host could only be generated with %1 bits entropy. Store anyway? + + + + + Delete this Host? + + + + + Really delete host '%1'? + + + + + Change Host Key? + + + + + Really change the key of host '%1'? + + + + + The new key of this host could only be generated with %1 bits entropy. Store anyway? + + + + + Import Key from File + + + + + Unable to open file %1 for reading: %2 + + + + + This is not a host key file. + + + + + This host key file does not contain a valid host name. + + + + + This host key file does not contain a valid key. + + + + + The key check sum did not match. Please get a clean copy of the host key file. + + + + + This host cannot be exported. + + + + + Export Key to File + + + + + Unable to open file %1 for writing: %2 + + + + + MPasswordChange + + + Change my password + + + + + Reset password of user %1 + + + + + Old Password: + + + + + New Password: + + + + + Repeat Password: + + + + + Set Password + + + + + Cancel + + MUserHost - + _any Irschendeen Gombjudor - + _online De Webseidn - + _anon Annonühm @@ -796,10 +1118,30 @@ At least %1 Bits of random are required. Isch gann misch ned anmälden. - + Error parsing EventList XML data (line %1 column %2): %3 + + + Cannot change password, old password does not match! + + + + + Error parsing RoomList XML data (line %1 column %2): %3 + + + + + Error parsing UserList XML data (line %1 column %2): %3 + + + + + Error parsing HostList XML data (line %1 column %2): %3 + + initkey diff --git a/www/inc/machine/host.php b/www/inc/machine/host.php index dd1bde3..d2bd545 100644 --- a/www/inc/machine/host.php +++ b/www/inc/machine/host.php @@ -64,7 +64,7 @@ function parseHostXml($txt) $xml=new DOMDocument; if(!$xml->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } $ret=array(); foreach($xml->getElementsByTagName("Host") as $el){ @@ -86,7 +86,7 @@ function deleteHostXml($txt) //check syntax if(substr($hst,0,1)=="_"){ header("X-MagicSmoke-Status: Error"); - die("Cannot delete special hosts."); + die(tr("Cannot delete special hosts.")); } //delete Host from users $db->deleteRows("userhosts","host=".$db->escapeString($hst)); diff --git a/www/inc/machine/session.php b/www/inc/machine/session.php index 32c563b..f509ba8 100644 --- a/www/inc/machine/session.php +++ b/www/inc/machine/session.php @@ -107,7 +107,7 @@ class Session if(!$auth->loadXML($REQUESTDATA)){ header("X-MagicSmoke-Status: SyntaxError"); deleteSession(); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } $hostname="";$hostauth="";$username="";$userauth=""; foreach($auth->getElementsByTagName("HostName") as $el) @@ -129,7 +129,7 @@ class Session if($hostname=="" || $hostauth=="" || $username=="" || $userauth==""){ header("X-MagicSmoke-Status: SyntaxError"); deleteSession(); - die("missing some authentication data"); + die(tr("missing some authentication data")); } //get user data $ures=$db->select("users","*","uname=".$db->escapeString($username)); @@ -201,18 +201,18 @@ class Session //check whether I really can do that if(!$this->isAuthenticated()){ header("X-MagicSmoke-Status: Unauthenticated"); - die("Not authenticated. Can't change password."); + die(tr("Not authenticated. Can't change password.")); } //parse XML $dom=new DOMDocument; if(!$dom->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } $nl=$dom->getElementsByTagName("SetMyPasswd"); if($nl->length!=1){ header("X-MagicSmoke-Status: SyntaxError"); - die("expected exactly one passwd element"); + die(tr("expected exactly one passwd element")); } $spw=$nl->item(0); $old=$spw->getAttribute("oldpwd"); @@ -220,19 +220,19 @@ class Session //sanity check if($nwp==""){ header("X-MagicSmoke-Status: SyntaxError"); - die("cannot set an empty password"); + die(tr("cannot set an empty password")); } //check old password global $db; $res=$db->select("users","passwd","uname=".$db->escapeString($this->user)); if(count($res)!=1){ header("X-MagicSmoke-Status: Error"); - die("Ooops. Unable to find user. You have been deleted."); + die(tr("Ooops. Unable to find user. You have been deleted.")); } if($old!=$res[0]["passwd"]){ header("X-MagicSmoke-Status: Error"); deleteSession(); - die("Wrong password. Session hijacked, terminating it."); + die(tr("Wrong password. Session hijacked, terminating it.")); } //set new password $db->update("users",array("passwd"=>$nwp),"uname=".$db->escapeString($this->user)); @@ -285,7 +285,7 @@ function getUserAclXml($user) $user=trim($user); if(ereg("^[A-Za-z0-9_]+$",$user)===false){ header("X-MagicSmoke-Status: SyntaxError"); - die("invalid user name"); + die(tr("invalid user name")); } //go on... global $db,$ALLOWEDREQUESTS; @@ -318,13 +318,13 @@ function setUserAclXml($txt) $xml=new DOMDocument; if(!$xml->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } //get user name $acl=$xml->getElementsByTagName("ACL"); if($acl->length != 1){ header("X-MagicSmoke-Status: SyntaxError"); - die("expected exactly 1 ACL element"); + die(tr("expected exactly 1 ACL element")); } global $db,$ALLOWEDREQUESTS; $roles=$ALLOWEDREQUESTS; @@ -336,7 +336,7 @@ function setUserAclXml($txt) if($res[0][0]!=1){ header("X-MagicSmoke-Status: SyntaxError"); $db->rollbackTransaction(); - die("unknown user name"); + die(tr("unknown user name")); } //update roles $acl=$xml->getElementsByTagName("Role"); @@ -364,7 +364,7 @@ function getUserHostsXml($user) $user=trim($user); if(ereg("^[A-Za-z0-9_]+$",$user)===false){ header("X-MagicSmoke-Status: SyntaxError"); - die("invalid user name"); + die(tr("invalid user name")); } //go on... global $db; @@ -400,13 +400,13 @@ function setUserHostsXml($txt) $xml=new DOMDocument; if(!$xml->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } //get user name $acl=$xml->getElementsByTagName("Hosts"); if($acl->length != 1){ header("X-MagicSmoke-Status: SyntaxError"); - die("expected exactly 1 Hosts element"); + die(tr("expected exactly 1 Hosts element")); } global $db; //create list of hosts @@ -422,7 +422,7 @@ function setUserHostsXml($txt) if($res[0][0]!=1){ header("X-MagicSmoke-Status: SyntaxError"); $db->rollbackTransaction(); - die("unknown user name"); + die(tr("unknown user name")); } //update roles $acl=$xml->getElementsByTagName("Host"); @@ -449,7 +449,7 @@ function parseUserXml($txt) $xml=new DOMDocument; if(!$xml->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } $ret=array(); foreach($xml->getElementsByTagName("User") as $el){ @@ -528,12 +528,12 @@ function setPasswdXml($txt) $dom=new DOMDocument; if(!$dom->loadXML($txt)){ header("X-MagicSmoke-Status: SyntaxError"); - die("unable to parse XML data"); + die(tr("unable to parse XML data")); } $nl=$dom->getElementsByTagName("SetPasswd"); if($nl->length!=1){ header("X-MagicSmoke-Status: SyntaxError"); - die("expected exactly one passwd element"); + die(tr("expected exactly one passwd element")); } $spw=$nl->item(0); $usr=$spw->getAttribute("user"); @@ -541,12 +541,12 @@ function setPasswdXml($txt) //sanity check if($nwp==""){ header("X-MagicSmoke-Status: SyntaxError"); - die("cannot set an empty password"); + die(tr("cannot set an empty password")); } //set new password if($db->update("users",array("passwd"=>$nwp),"uname=".$db->escapeString($usr))===false){ header("X-MagicSmoke-Status: Error"); - die("Unable to change this password."); + die(tr("Unable to change this password.")); }else header("X-MagicSmoke-Status: Ok"); } diff --git a/www/machine.php b/www/machine.php index b52adc3..fecdf9e 100644 --- a/www/machine.php +++ b/www/machine.php @@ -28,7 +28,7 @@ $ALLOWEDREQUESTS=array( $SMOKEREQUEST=strtolower($_SERVER["HTTP_X_MAGICSMOKE_REQUEST"]); if(!in_array($SMOKEREQUEST,$ALLOWEDREQUESTS)){ header("X-MagicSmoke-Status: InvalidRequest"); - die("Invalid Request, please use the MagicSmoke Client with this page."); + die(tr("Invalid Request, please use the MagicSmoke Client with this page.")); } /**contains the low-level request data from the client*/ $REQUESTDATA=""; @@ -78,7 +78,7 @@ if($SMOKEREQUEST=="closesession"){ $session=new Session; if(!$session->isValid()){ header("X-MagicSmoke-Status: Unauthenticated"); - die("Invalid or missing sessionid, or session timed out."); + die(tr("Invalid or missing sessionid, or session timed out.")); } //request session authentication @@ -90,7 +90,7 @@ if($SMOKEREQUEST=="sessionauth"){ //remainder must be authenticated if(!$session->isAuthenticated()){ header("X-MagicSmoke-Status: Unauthenticated"); - die("Session not yet authenticated."); + die(tr("Session not yet authenticated.")); } //get roles of myself @@ -102,7 +102,7 @@ if($SMOKEREQUEST=="getmyroles"){ //check that we actually are allowed to do this if(!$session->canExecute($SMOKEREQUEST)){ header("X-MagicSmoke-Status: NotAllowed"); - die("You do not have the right to execute this transaction."); + die(tr("You do not have the right to execute this transaction.")); } //get a list of events @@ -218,5 +218,5 @@ if($SMOKEREQUEST=="deletehost"){ //EOF header("X-MagicSmoke-Status: Error"); -die("Internal Error: unknown command, hiccup in code structure."); +die(tr("Internal Error: unknown command, hiccup in code structure.")); ?> \ No newline at end of file -- 1.7.2.5