[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1439] Make the language selector element automaticall
From: |
Michael Sheldon |
Subject: |
[Librefm-commits] [1439] Make the language selector element automatically select the currently used language regardless of how it was chosen . |
Date: |
Sat, 09 May 2009 18:45:22 +0000 |
Revision: 1439
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1439
Author: elleo
Date: 2009-05-09 18:45:22 +0000 (Sat, 09 May 2009)
Log Message:
-----------
Make the language selector element automatically select the currently used
language regardless of how it was chosen.
Modified Paths:
--------------
trunk/nixtape/templating.php
trunk/nixtape/themes/librefm/templates/language-selector.tpl
Modified: trunk/nixtape/templating.php
===================================================================
--- trunk/nixtape/templating.php 2009-05-09 15:07:22 UTC (rev 1438)
+++ trunk/nixtape/templating.php 2009-05-09 18:45:22 UTC (rev 1439)
@@ -43,7 +43,7 @@
$languages[$i] = $languages[$i] . ".UTF-8";
}
}
-setlocale(LC_ALL, $languages);
+$current_lang = setlocale(LC_ALL, $languages);
bindtextdomain("nixtape", $install_path . '/themes/' . $default_theme .
'/locale/');
textdomain("nixtape");
@@ -53,10 +53,9 @@
$smarty->compile_dir = $install_path. '/themes/' . $default_theme .
'/templates_c/';
$smarty->cache_dir = $install_path. '/cache/';
-$current_lang = isset($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang'];
+$current_lang = preg_replace('/.UTF-8/', '', $current_lang);
$smarty->assign('current_lang', $current_lang);
-$smarty->assign('current_lang_array', array($current_lang => 1));
$smarty->assign('base_url', $base_url);
$smarty->assign('this_page', $_SERVER['REQUEST_URI']);
$smarty->assign('this_page_absolute',
Modified: trunk/nixtape/themes/librefm/templates/language-selector.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/language-selector.tpl
2009-05-09 15:07:22 UTC (rev 1438)
+++ trunk/nixtape/themes/librefm/templates/language-selector.tpl
2009-05-09 18:45:22 UTC (rev 1439)
@@ -1,7 +1,7 @@
<form method='get' action=''>
<select name='lang' id='lang' onchange='this.form.submit()'>
- <option {if $current_lang_array.en_US}selected="selected"{/if}
value='en_US'>English (US)</option>
- <option {if $current_lang_array.de_DE}selected="selected"{/if}
value='de_DE'>Deutsch (Deutschland)</option>
+ <option {if $current_lang.en_US}selected="selected"{/if}
value='en_US'>English (US)</option>
+ <option {if $current_lang.de_DE}selected="selected"{/if}
value='de_DE'>Deutsch (Deutschland)</option>
</select>
<noscript>
<input type='submit' value='{t}Change Language{/t}' />
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1439] Make the language selector element automatically select the currently used language regardless of how it was chosen .,
Michael Sheldon <=