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>
This commit is contained in:
Lukas Fleischer 2018-07-22 10:41:57 +02:00
parent c8d99bac8e
commit a7865ef5aa
3 changed files with 7 additions and 2 deletions

View file

@ -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);