This commit is contained in:
Sébastien Lucas 2013-10-13 22:23:20 +02:00
commit bbdf4a432e
4 changed files with 276 additions and 3 deletions

View file

@ -140,7 +140,7 @@ function str_format($format) {
* This method is based on this page
* http://www.mind-it.info/2010/02/22/a-simple-approach-to-localization-in-php/
*/
function localize($phrase, $count=-1) {
function localize($phrase, $count=-1, $reset=false) {
if ($count == 0)
$phrase .= ".none";
if ($count == 1)
@ -150,6 +150,9 @@ function localize($phrase, $count=-1) {
/* Static keyword is used to ensure the file is loaded only once */
static $translations = NULL;
if ($reset) {
$translations = NULL;
}
/* If no instance of $translations has occured load the language file */
if (is_null($translations)) {
$lang = "en";