Fix relative paths: missing / on internationalization

This commit is contained in:
Igor Scheller 2017-01-01 19:49:59 +01:00
parent a8ab9ccce1
commit 1f0ca24f5c
1 changed files with 4 additions and 4 deletions

View File

@ -26,14 +26,14 @@ function locale_short() {
function gettext_init() { function gettext_init() {
global $locales, $default_locale; global $locales, $default_locale;
if (isset($_REQUEST['set_locale']) && in_array($_REQUEST['set_locale'], array_keys($locales))) { if (isset($_REQUEST['set_locale']) && isset($locales[$_REQUEST['set_locale']])) {
$_SESSION['locale'] = $_REQUEST['set_locale']; $_SESSION['locale'] = $_REQUEST['set_locale'];
} elseif (! isset($_SESSION['locale'])) { } elseif (! isset($_SESSION['locale'])) {
$_SESSION['locale'] = $default_locale; $_SESSION['locale'] = $default_locale;
} }
gettext_locale(); gettext_locale();
bindtextdomain('default', __DIR__ . '../../locale'); bindtextdomain('default', realpath(__DIR__ . '/../../locale'));
bind_textdomain_codeset('default', 'UTF-8'); bind_textdomain_codeset('default', 'UTF-8');
textdomain('default'); textdomain('default');
} }