|
|
@@ -23,6 +23,10 @@ class Translation {
|
|
|
return self::$instance;
|
|
|
}
|
|
|
|
|
|
+ public static function resetInstance() {
|
|
|
+ self::$instance = null;
|
|
|
+ }
|
|
|
+
|
|
|
private function detectLanguage() {
|
|
|
// Check if language is set in cookie
|
|
|
if (isset($_COOKIE['language']) && isset($this->supportedLanguages[$_COOKIE['language']])) {
|
|
|
@@ -94,10 +98,10 @@ class Translation {
|
|
|
if (file_exists($langFile)) {
|
|
|
$this->translations = require $langFile;
|
|
|
} else {
|
|
|
- // Fall back to default language if current language file doesn't exist
|
|
|
- $defaultLangFile = __DIR__ . '/../languages/' . $this->defaultLanguage . '.php';
|
|
|
- if (file_exists($defaultLangFile)) {
|
|
|
- $this->translations = require $defaultLangFile;
|
|
|
+ // Fall back to English if current language file doesn't exist
|
|
|
+ $fallbackLangFile = __DIR__ . '/../languages/en.php';
|
|
|
+ if (file_exists($fallbackLangFile)) {
|
|
|
+ $this->translations = require $fallbackLangFile;
|
|
|
}
|
|
|
}
|
|
|
}
|