1 parent c488943 commit 0e54615Copy full SHA for 0e54615
1 file changed
i18n.php
@@ -1,5 +1,8 @@
1
<?php
2
3
+// Ensure variables are global even if this file is included within a function/method (like in PHPUnit)
4
+global $currentLang, $translations;
5
+
6
if (!function_exists('getBrowserLanguage')) {
7
function getBrowserLanguage()
8
{
@@ -27,6 +30,6 @@ function getBrowserLanguage()
27
30
function __($key)
28
31
29
32
global $translations;
- return isset($translations[$key]) ? $translations[$key] : $key;
33
+ return (isset($translations) && isset($translations[$key])) ? $translations[$key] : $key;
34
}
35
0 commit comments