Skip to content
Snippets Groups Projects
Commit 7b653dbc authored by Jakob Sack's avatar Jakob Sack
Browse files

use sprintf for translations

parent 74be4644
Branches
No related tags found
No related merge requests found
......@@ -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 );
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment