[Mapbender-commits] r4839 - branches/2.6/core

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 20 08:27:17 EDT 2009


Author: christoph
Date: 2009-10-20 08:27:16 -0400 (Tue, 20 Oct 2009)
New Revision: 4839

Modified:
   branches/2.6/core/i18n.php
Log:
allow parameters in i18n strings

Modified: branches/2.6/core/i18n.php
===================================================================
--- branches/2.6/core/i18n.php	2009-10-20 12:26:37 UTC (rev 4838)
+++ branches/2.6/core/i18n.php	2009-10-20 12:27:16 UTC (rev 4839)
@@ -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 " . $_SESSION["mb_locale"] . ": '" . _($someString) . "'");
-			return _($someString);
+//			$e = new mb_notice("Translating '" . $someString . "' to language " . Mapbender::session()->get("mb_locale") . ": '" . _($someString) . "'");
+
+		    return vsprintf(_($someString), $arg);			
 		}
-		return $someString;
+	    return vsprintf($someString, $arg);			
 	}
 ?>



More information about the Mapbender_commits mailing list