Author: rande
Date: 2010-03-10 01:24:12 +0100 (Wed, 10 Mar 2010)
New Revision: 28447

Modified:
   plugins/mgI18nPlugin/branches/sf1.2/lib/mgI18N.class.php
   plugins/mgI18nPlugin/branches/sf1.3/lib/mgI18N.class.php
Log:
[mgI18nPlugin] fix learning mode insert when debug is true

Modified: plugins/mgI18nPlugin/branches/sf1.2/lib/mgI18N.class.php
===================================================================
--- plugins/mgI18nPlugin/branches/sf1.2/lib/mgI18N.class.php    2010-03-09 
23:52:18 UTC (rev 28446)
+++ plugins/mgI18nPlugin/branches/sf1.2/lib/mgI18N.class.php    2010-03-10 
00:24:12 UTC (rev 28447)
@@ -66,13 +66,12 @@
       return $message;
     }
     
+    $pseudo_string = $string;
     if($this->options['debug'])
     {
-      
-      $string = 
$this->options['untranslated_prefix'].$string.$this->options['untranslated_suffix'];
+      $pseudo_string = 
$this->options['untranslated_prefix'].$string.$this->options['untranslated_suffix'];
     }
 
-
     $args = empty($args) ? array() : $args;
 
     // code from I18nHelper.php file
@@ -98,7 +97,7 @@
     // append the message, so it can be stored into the database
     $this->getMessageSource()->appendRequestedMessage($value, $catalogue);
 
-    return $message;
+    return $pseudo_string;
   }
 
   /**

Modified: plugins/mgI18nPlugin/branches/sf1.3/lib/mgI18N.class.php
===================================================================
--- plugins/mgI18nPlugin/branches/sf1.3/lib/mgI18N.class.php    2010-03-09 
23:52:18 UTC (rev 28446)
+++ plugins/mgI18nPlugin/branches/sf1.3/lib/mgI18N.class.php    2010-03-10 
00:24:12 UTC (rev 28447)
@@ -65,14 +65,13 @@
       
       return $message;
     }
-    
+
+    $pseudo_string = $string;
     if($this->options['debug'])
     {
-      
-      $string = 
$this->options['untranslated_prefix'].$string.$this->options['untranslated_suffix'];
+      $pseudo_string = 
$this->options['untranslated_prefix'].$string.$this->options['untranslated_suffix'];
     }
 
-
     $args = empty($args) ? array() : $args;
 
     // code from I18nHelper.php file
@@ -86,7 +85,7 @@
     }
     // end code from I18nHelper.php file
 
-    $pseudo_string = strtr($string, $args);
+    $pseudo_string = strtr($pseudo_string, $args);
 
     $value = array(
       'source'        => $string,
@@ -98,7 +97,7 @@
     // append the message, so it can be stored into the database
     $this->getMessageSource()->appendRequestedMessage($value, $catalogue);
 
-    return $message;
+    return $pseudo_string;
   }
 
   /**

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to