gnucash-htdocs beta: Handle Chinese Traditional

John Ralls jralls at code.gnucash.org
Sun Sep 27 19:45:54 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash-htdocs/commit/a97cc663 (commit)
	from  https://github.com/Gnucash/gnucash-htdocs/commit/60e8d5a5 (commit)



commit a97cc66335074fc5904d54d835eba68bac949555
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Sep 27 16:44:11 2020 -0700

    Handle Chinese Traditional

diff --git a/externals/header.phtml b/externals/header.phtml
index 5bd908b..75369ea 100644
--- a/externals/header.phtml
+++ b/externals/header.phtml
@@ -22,7 +22,16 @@
   }
   
   $get_parms = $_GET;
-  if (isset($locale)) { $locale_str = substr($locale, 0, 2); } else { $locale_str = "en"; }
+
+  if (isset($locale)) {
+    if (substr($locale, 0, 2) != 'zh') {
+      $locale_str = substr($locale, 0, 2);
+    } else {
+      $locale_str = $locale  == 'zh_TW' ? 'zh-Hant' : 'zh-Hans';
+    }
+  } else {
+    $locale_str = "en";
+  }
 ?>
 
 <html lang="<?php echo $locale_str; ?>">



Summary of changes:
 externals/header.phtml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list