Skip to content

Commit 0e54615

Browse files
committed
update test
1 parent c488943 commit 0e54615

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

i18n.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
// Ensure variables are global even if this file is included within a function/method (like in PHPUnit)
4+
global $currentLang, $translations;
5+
36
if (!function_exists('getBrowserLanguage')) {
47
function getBrowserLanguage()
58
{
@@ -27,6 +30,6 @@ function getBrowserLanguage()
2730
function __($key)
2831
{
2932
global $translations;
30-
return isset($translations[$key]) ? $translations[$key] : $key;
33+
return (isset($translations) && isset($translations[$key])) ? $translations[$key] : $key;
3134
}
3235
}

0 commit comments

Comments
 (0)