While I'm still at it, here's one more patch, this time to improve the 
behaviour of the language links.

Before: clicking a language link displays the front page in the new language, 
no matter which page you clicked the language link.

After: the language link will change the current page to the new language. If 
the current page is the index page, the index page will be displayed in the 
new language. If the current page is the download page, the download page will 
be displayed in the new language.

All assume of course the chose language is availabe. If not the English 
version is still displayed.

Since the change involves no new files, this time I have attached a real 
patch, no tarball :)

Regards,

Geert
Index: externals/header.phtml
===================================================================
--- externals/header.phtml	(revision 18422)
+++ externals/header.phtml	(working copy)
@@ -5,8 +5,9 @@
 <link rel="icon" href="<?=$top_dir?>/favicon.ico" type="image/x-icon" />
 <link rel="shortcut icon" href="<?=$top_dir?>/favicon.ico" type="image/x-icon" />
 <?php echo $mimeline;  ?>
-<?php include("$top_dir/externals/global_params.php"); ?>
 <?php
+include("$top_dir/externals/global_params.php");
+$current_page = basename($_SERVER["SCRIPT_NAME"]);
 
 if (isset($homepage)) { ?>
   <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="<?=$top_dir?>/atom.php">
@@ -24,15 +25,15 @@
 <br/>
 <span id="language">
 <?= _("Language"); ?>:
-  <a class="nav" href="<?=$top_dir;?>">English</a>
-| <a class="nav" href="<?=$top_dir;?>/de/">Deutsch</a>
-| <a class="nav" href="<?=$top_dir;?>/es/">Espa&ntilde;ol</a>
-| <a class="nav" href="<?=$top_dir;?>/fr/">Fran&ccedil;ais</a>
-| <a class="nav" href="<?=$top_dir;?>/it/">Italiano</a>
-| <a class="nav" href="<?=$top_dir;?>/nb/">Norsk Bokm&aring;l</a>
-| <a class="nav" href="<?=$top_dir;?>/nl/">Nederlands</a>
+  <a class="nav" href="<?=$top_dir;?>/<?=$current_page;?>">English</a>
+| <a class="nav" href="<?=$top_dir;?>/de/<?=$current_page;?>">Deutsch</a>
+| <a class="nav" href="<?=$top_dir;?>/es/<?=$current_page;?>">Espa&ntilde;ol</a>
+| <a class="nav" href="<?=$top_dir;?>/fr/<?=$current_page;?>">Fran&ccedil;ais</a>
+| <a class="nav" href="<?=$top_dir;?>/it/<?=$current_page;?>">Italiano</a>
+| <a class="nav" href="<?=$top_dir;?>/nb/<?=$current_page;?>">Norsk Bokm&aring;l</a>
+| <a class="nav" href="<?=$top_dir;?>/nl/<?=$current_page;?>">Nederlands</a>
 <!-- | <a class="nav" href="<?=$top_dir;?>/pl/">Polska</a> -->
-| <a class="nav" href="<?=$top_dir;?>/pt_PT/">Portugu&ecirc;s</a>
+| <a class="nav" href="<?=$top_dir;?>/pt_PT/<?=$current_page;?>">Portugu&ecirc;s</a>
 </span>
 <span id="location">&nbsp; <!-- <?= _("Continent"); ?>:
  (<a class="nav" href="http://www.gnucash.org/";>US</a>)
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to