]> source.dussan.org Git - nextcloud-server.git/commitdiff
use sprintf for translations
authorJakob Sack <kde@jakobsack.de>
Wed, 10 Aug 2011 09:08:30 +0000 (11:08 +0200)
committerJakob Sack <kde@jakobsack.de>
Wed, 10 Aug 2011 09:08:30 +0000 (11:08 +0200)
lib/l10n.php

index 5271bd4e58937b3be4c814c8587d0ca0aaaea587..2d565ad0799b94538d84ace98cf965068fc9e092 100644 (file)
@@ -97,16 +97,17 @@ class OC_L10N{
        /**
         * @brief Translating
         * @param $text The text we need a translation for
+        * @param $parameters default:array() Parameters for sprintf
         * @returns Translation or the same text
         *
         * Returns the translation. If no translation is found, $text will be
         * returned.
         */
-       public function t($text){
+       public function t($text, $parameters = array()){
                if(array_key_exists($text, $this->translations)){
-                       return $this->translations[$text];
+                       return vsprintf( $this->translations[$text], $parameters );
                }
-               return $text;
+               return vsprintf( $text, $parameters );
        }
 
        /**