From 2bc7440cca677d28befb8fce700cbada37455dcb Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 19 Sep 2022 23:27:20 -0700 Subject: [PATCH] Try all languages in the ZIP file --- help.cgi | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/help.cgi b/help.cgi index 11bfe1222..d4bcb1dfb 100755 --- a/help.cgi +++ b/help.cgi @@ -70,11 +70,20 @@ if (-r $gzpath) { my $zip = $path; $zip =~ s/\/[^\/]+$/\/help.zip/; if (-r $zip) { - # XXX what about other languages? - my $out = &backquote_command( - "unzip -p ".quotemeta($zip)." ". - quotemeta($file.".html")." 2>/dev/null"); - return $? ? undef : $out; + my @files; + foreach my $o (@lang_order_list) { + next if ($o eq "en"); + push(@files, $file.".".$o.".auto.html"); + push(@files, $file.".".$o.".html"); + } + push(@files, $file.".html"); + foreach my $f (@files) { + my $out = &backquote_command( + "unzip -p ".quotemeta($zip)." ". + quotemeta($f)." 2>/dev/null"); + return $out if ($out && !$?); + } + return undef; } return undef; }