From f4cca21fdf99f0cdd9be900c9190f7e5f6590828 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 17 Apr 2016 07:29:08 -0400 Subject: Recover lost language translation accommodation and doc/context restructuring --- mod/help.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mod/help.php') diff --git a/mod/help.php b/mod/help.php index fb0339cd9..8c27156ab 100644 --- a/mod/help.php +++ b/mod/help.php @@ -88,9 +88,17 @@ function load_context_help() { $path = App::$cmd; $args = App::$argv; - + $lang = App::$language; + + if(! isset($lang) || !is_dir('doc/context/' . $lang . '/')) { + $lang = 'en'; + } while($path) { - $context_help = load_doc_file('doc/context/' . $path . '/help.html'); + $context_help = load_doc_file('doc/context/' . $lang . '/' . $path . '/help.html'); + if(!$context_help) { + // Fallback to English if the translation is absent + $context_help = load_doc_file('doc/context/en/' . $path . '/help.html'); + } if($context_help) break; array_pop($args); -- cgit v1.2.3