aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-03-31 04:57:31 -0700
committerFriendika <info@friendika.com>2011-03-31 04:57:31 -0700
commit08032e04536e67dbf488654a0142350690154c57 (patch)
treebd0fc507e4e25f2f780ea2bc1eaea1a618fb920b /boot.php
parent75ad3219e67b803bebf028b69d59f26c44571b3d (diff)
downloadvolse-hubzilla-08032e04536e67dbf488654a0142350690154c57.tar.gz
volse-hubzilla-08032e04536e67dbf488654a0142350690154c57.tar.bz2
volse-hubzilla-08032e04536e67dbf488654a0142350690154c57.zip
change language dynamically - bound to F8 key
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index abbacdf4e..8a2706252 100644
--- a/boot.php
+++ b/boot.php
@@ -2669,3 +2669,23 @@ function extract_item_authors($arr,$uid) {
}
return array();
}}
+
+if(! function_exists('lang_selector')) {
+function lang_selector() {
+ global $lang;
+ $o .= '<div id="language-selector" style="display: none;" >';
+ $o .= '<form action="" method="post" ><select name="system_language" onchange="this.form.submit();" >';
+ $langs = glob('view/*/strings.php');
+ if(is_array($langs) && count($langs)) {
+ if(! in_array('view/en/strings.php',$langs))
+ $langs[] = 'view/en/';
+ foreach($langs as $l) {
+ $ll = substr($l,5);
+ $ll = substr($ll,0,strrpos($ll,'/'));
+ $selected = (($ll === $lang) ? ' selected="selected" ' : '');
+ $o .= '<option value="' . $ll . '"' . $selected . '>' . $ll . '</option>';
+ }
+ }
+ $o .= '</select></form></div>';
+ return $o;
+}}