------------------------------------------------------------
revno: 1183
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Wed 2012-04-25 22:12:25 +0200
message:
  literals with __() functions
modified:
  libs/Controls.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/Controls.php'
--- libs/Controls.php	2012-03-25 20:58:04 +0000
+++ libs/Controls.php	2012-04-25 20:12:25 +0000
@@ -47,7 +47,7 @@
 			"id"     => uniqid("f_"), // by default a random unique
 			"http"   => "http", // @todo current protocol
 			"layout" => "table",
-			"submit" => t("submit"),
+			"submit" => __("submit"),
 			"enctype"=> "application/x-www-form-urlencoded "
 		);
 		$this->last_error ="";
@@ -88,12 +88,12 @@
 			if ( isset($_POST[$this->defaults["save"]]) ){
 				if ( !$this->save_data() ) {
 					$message = $this->message(
-						"Error saving/adding record " . ( is_debug_on() ? $this->last_error : "" ),
+						__("Error saving/adding record") . ( is_debug_on() ? " ". $this->last_error : "" ),
 						"error");						
 				} elseif ( $this->is_set("pkey") ){
-					$message = $this->message( "Record saved", "ok form-record-saved");
+					$message = $this->message( __("Record saved"), "ok form-record-saved");
 				} else {
-					$message = $this->message( "Record added", "ok form-record-add");
+					$message = $this->message( __("Record added"), "ok form-record-add");
 				}					
 			}
 			// to avoid re-write the form
@@ -192,7 +192,7 @@
 		$db->last_error = "";
 		$news = $db->get_row($SQL,ARRAY_A);
 		if ( $db->last_error ){
-			$this->last_error = t("Error reading data") . (is_debug_on()? ": ".  $db->last_error : "") ;
+			$this->last_error = __("Error reading data") . (is_debug_on()? ": ".  $db->last_error : "") ;
 			return $values;
 		}
 		
@@ -239,13 +239,13 @@
 		$this->last_error="";
 
 		if ( !$this->is_set("table") ){		     
-			$this->last_error = t("Missing table");
+			$this->last_error = __("Missing table");
 			return false;
 		}elseif (  !$this->is_set("fields") ||  !is_array ($this->defaults["fields"])){
-			$this->last_error = t("Missing fields definition");
+			$this->last_error = __("Missing fields definition");
 			return false;
 		} elseif ( 	$this->is_set("pkey") && !$this->is_set("pkeyfield") ){
-			$this->last_error = t("Missing key field name");
+			$this->last_error = __("Missing key field name");
 			return false;
 			
 		} elseif (  $this->is_set("pkey")) {
@@ -262,7 +262,7 @@
 				}
 			}
 			if ( count($pairs)==0){
-				$this->last_error = t("No values recollected");
+				$this->last_error = __("No values recollected");
 				return false;
 			}		
 			$SQL= "UPDATE {$this->defaults['table']} SET ".
@@ -284,7 +284,7 @@
 				}
 			}
 			if (count($fields)==0){
-				$this->last_error = t("No values recollected");
+				$this->last_error = __("No values recollected");
 				return false;
 			}
 			$SQL= "INSERT {$this->defaults['table']} (".
@@ -359,8 +359,10 @@
 		}
 
 		if ( $list=="gender")  {
+			/* @TODO translate?*/
 			return array("Male", "Female");
 		} elseif ( $list=="yn"){
+			/* @TODO translate?*/
 			return array("Yes", "No");
 		} 
 		$ret= array();

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to