[Mapbender-commits] r4476 - trunk/mapbender/core

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 4 11:09:57 EDT 2009


Author: christoph
Date: 2009-08-04 11:09:57 -0400 (Tue, 04 Aug 2009)
New Revision: 4476

Modified:
   trunk/mapbender/core/i18n.php
Log:
allow variables in translations

Modified: trunk/mapbender/core/i18n.php
===================================================================
--- trunk/mapbender/core/i18n.php	2009-08-04 15:09:27 UTC (rev 4475)
+++ trunk/mapbender/core/i18n.php	2009-08-04 15:09:57 UTC (rev 4476)
@@ -17,10 +17,16 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 	function _mb ($someString) {
+	    $arg = array();
+	    for($i = 1 ; $i < func_num_args(); $i++) {
+	        $arg[] = func_get_arg($i);
+	    }
+	   
 		if (USE_I18N) {
 //			$e = new mb_notice("Translating '" . $someString . "' to language " . Mapbender::session()->get("mb_locale") . ": '" . _($someString) . "'");
-			return _($someString);
+
+		    return vsprintf(_($someString), $arg);			
 		}
-		return $someString;
+	    return vsprintf($someString, $arg);			
 	}
 ?>



More information about the Mapbender_commits mailing list