Merge
This commit is contained in:
commit
bbdf4a432e
4 changed files with 276 additions and 3 deletions
5
base.php
5
base.php
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue