Skip to content

Commit

Permalink
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@92…
Browse files Browse the repository at this point in the history
…46 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 14, 2010
1 parent 03e0d8d commit bc5a7a7
Show file tree
Hide file tree
Showing 4 changed files with 901 additions and 840 deletions.
49 changes: 49 additions & 0 deletions classes/core/language.php
Expand Up @@ -57,6 +57,55 @@ function gTview($string, $escapemode = 'html')
}
}

/**
* This function translates plural strings to their according language
*
* @param $single $string The single form of the string to translate
* @param $plural $string The plural form to translate
* @param $number $integer Depending on the number of items the right plural form is taken
* @param mixed $escapemode Different uses require the string to be escaped accordinlgy. Possible values are 'html'(default),'js' and 'unescaped'
* @return string Translated string
*/
function ngT($single, $plural, $number, $escapemode = 'html')
{
if ($this->gettextclass)
{
$basestring=str_replace('‘','\'',$this->gettextclass->ngettext($single, $plural, $number));
switch ($escapemode)
{
case 'html':
return html_escape($basestring);
break;
case 'js':
return javascript_escape($basestring);
break;
case 'unescaped':
return $basestring;
break;
default:
return "Unsupported EscapeMode in gT method";
break;
}
} else {
switch ($escapemode)
{
case 'html':
return html_escape($string);
break;
case 'js':
return javascript_escape($string);
break;
case 'unescaped':
return $string;
break;
default:
return "Unsupported EscapeMode in gT method";
break;
}
}
}


/**
* This function translates strings to their according language
*
Expand Down
Binary file modified locale/de/LC_MESSAGES/de.mo
Binary file not shown.

0 comments on commit bc5a7a7

Please sign in to comment.