From 1bd52867fb463a4b34cd2c4a9b9ace8b570e18b4 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 23 Jul 2024 18:52:12 +0200 Subject: Fallback to english help topic if localized topic is not found. --- Zotlabs/Lib/Traits/HelpHelperTrait.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Traits/HelpHelperTrait.php b/Zotlabs/Lib/Traits/HelpHelperTrait.php index b7711bbd5..9e4fefa4b 100644 --- a/Zotlabs/Lib/Traits/HelpHelperTrait.php +++ b/Zotlabs/Lib/Traits/HelpHelperTrait.php @@ -53,10 +53,10 @@ trait HelpHelperTrait { // Use local variable until we can use trait constants. $valid_file_ext = ['md', 'bb', 'html']; - $base_path = "doc/{$lang}/${base_path}"; + $base_path_with_lang = "doc/{$lang}/${base_path}"; foreach ($valid_file_ext as $ext) { - $path = "{$base_path}.{$ext}"; + $path = "{$base_path_with_lang}.{$ext}"; if (file_exists($path)) { $this->file_name = $path; $this->file_type = $ext; @@ -64,5 +64,9 @@ trait HelpHelperTrait { break; } } + + if (empty($this->file_name) && $lang !== 'en') { + $this->find_help_file($base_path, 'en'); + } } } -- cgit v1.2.3