diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2018-07-22 10:41:57 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2018-08-06 06:03:52 +0200 |
commit | a7865ef5aa0309976b5dd2642210632babe106d9 (patch) | |
tree | 457e0841021b4a8ca129de02674f86de1bfc50af /web/lib | |
parent | c8d99bac8ef96ac94bccdf3c754e7d43b3f1703c (diff) | |
download | aur-a7865ef5aa0309976b5dd2642210632babe106d9.tar.gz aur-a7865ef5aa0309976b5dd2642210632babe106d9.tar.xz |
Make the locale directory configurable
Add a new configuration option to specify the locale directory to use.
This allows the Python scripts to find the translations, even when not
being run from the source code checkout. At the same time, multiple
parallel aurweb setups can still use different sets of translations.
Fixes FS#59278.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/translator.inc.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/web/lib/translator.inc.php b/web/lib/translator.inc.php index cd944c56..334d0e76 100644 --- a/web/lib/translator.inc.php +++ b/web/lib/translator.inc.php @@ -130,7 +130,8 @@ function set_lang() { setcookie("AURLANG", $LANG, $cookie_time, "/"); } - $streamer = new FileReader('../locale/' . $LANG . + $localedir = config_get('options', 'localedir'); + $streamer = new FileReader($localedir . '/' . $LANG . '/LC_MESSAGES/aurweb.mo'); $l10n = new gettext_reader($streamer, true); |