diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-08-10 11:08:30 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-08-10 11:08:30 +0200 |
commit | 7b653dbca69e1d69898f2ea9b63759a495ef98b0 (patch) | |
tree | 1a064ddd39c3aafb90d5587cec5dd92634f0e298 /lib/l10n.php | |
parent | 74be4644edf4c13cd4e36779d8caa821865b7512 (diff) | |
download | nextcloud-server-7b653dbca69e1d69898f2ea9b63759a495ef98b0.tar.gz nextcloud-server-7b653dbca69e1d69898f2ea9b63759a495ef98b0.zip |
use sprintf for translations
Diffstat (limited to 'lib/l10n.php')
-rw-r--r-- | lib/l10n.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/l10n.php b/lib/l10n.php index 5271bd4e589..2d565ad0799 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -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 ); } /** |