gnucash-htdocs master: Use previous ignored lang parameter

Frank H.Ellenberger fell at code.gnucash.org
Sat Feb 11 13:19:57 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash-htdocs/commit/d05115d9 (commit)
	from  https://github.com/Gnucash/gnucash-htdocs/commit/6ba02891 (commit)



commit d05115d94b29122899d3496dda7abc1608ca5d9f
Author: fell <frank.h.ellenberger at gmail.com>
Date:   Sat Feb 11 19:19:54 2017 +0100

    Use previous ignored lang parameter

diff --git a/viewdoc.phtml b/viewdoc.phtml
index 176b1b4..1ab3190 100644
--- a/viewdoc.phtml
+++ b/viewdoc.phtml
@@ -1,4 +1,9 @@
 <?php                                                    
+# Determine which documentation to show based on 3 parameters:
+# - language (lang)
+# - help or guide (doc)
+# - doc version (rev)
+
 include("emulate_globals_on.php");
 include("lang.php");
 $title = T_("View document");
@@ -11,25 +16,24 @@ $helpdoc        = "gnucash-help/help.html";
 $tcdoc          = "gnucash-guide/index.html";
 $current_stable = "2.6";
 
-# Determine which documentation to show based on 3 parameters:
-# - language
-# - help or guide (doc)
-# - doc version (rev)
-
 # Show current stable helpdoc, in overall set language by default
 $showdoc     = $tcdoc;
 $req_doc_ok  = true;
 $showrev     = $current_stable;
 $req_rev_ok  = true;
 
-# Requested language is set in $locale by included lang.php
-if ($locale == "en_US") {
-  $showlang  = "C";
-} else {
-  $showlang  = $locale;
-}
+if (isset ($_GET["lang"])) {
+	$showlang  = $_GET["lang"];
+  }	else {
+  # Fallback: Requested language is set in $locale by included lang.php
+  if ($locale == "en_US") {
+    $showlang  = "C";
+  } else {
+    $showlang  = $locale;
+  }
 $req_lang_ok = true;
 
+
 # Parse requested document
 if (isset ($_GET["doc"])) {
   switch ($_GET["doc"]) {
@@ -86,8 +90,8 @@ if (isset ($_GET["rev"])) {
 # updated if list of languages in which the documentation is available changes
 if ($showrev == "trunk") {
   $basepath = "https://lists.gnucash.org/docs";
-  $trunk_langs = array ( $helpdoc => array( "C", "de_DE", "it_IT"),
-                         $tcdoc   => array( "C", "de_DE", "it_IT", "ja_JP"));
+  $trunk_langs = array ( $helpdoc => array( "C", "de", "it"),
+                         $tcdoc   => array( "C", "de", "it", "ja"));
   if (!in_array ($showlang, $trunk_langs[$showdoc])) {
     $showlang    = "C";
     $req_lang_ok = false;



Summary of changes:
 viewdoc.phtml | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)



More information about the gnucash-changes mailing list