fixing language display in menu
This commit is contained in:
		
							parent
							
								
									cbab7dee96
								
							
						
					
					
						commit
						84a730d3c1
					
				|  | @ -115,7 +115,7 @@ if (isset($url) && $url)  { | |||
| 	    <?php  | ||||
| 		foreach($locales as $l) { | ||||
| 	    ?>
 | ||||
| 	    <a href="?setlang=<?php echo $l; ?>"><?php __($l); ?></a>
 | ||||
| 	    <a href="?setlang=<?php echo $l; ?>"><?php if (isset($lang_translation[$l])) echo $lang_translation[$l]; else echo $l;  ?></a>
 | ||||
| 	    <?php } ?>
 | ||||
| <br /> | ||||
| <?php | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ | |||
|   <div class="menu-content" id="menu-lang"> | ||||
|   <ul> | ||||
|    <?php foreach($locales as $l) { ?>
 | ||||
|     <li><a href="/login.php?setlang=<?php echo $l; ?>" target="_top"><?php __($l); ?></a></li>
 | ||||
|     <li><a href="/login.php?setlang=<?php echo $l; ?>" target="_top"><?php if (isset($lang_translation[$l])) echo $lang_translation[$l]; else echo $l; ?></a></li>
 | ||||
|    <?php } ?>
 | ||||
|   </ul> | ||||
|  </div> | ||||
|  |  | |||
|  | @ -1,5 +1,13 @@ | |||
| <?php | ||||
| 
 | ||||
| $lang_translation=array( | ||||
| 			"fr_FR" => "Français", | ||||
| 			"en_US" => "English", | ||||
| 			"es_ES" => "Español", | ||||
| 			"it_IT" => "Italiano", | ||||
| 			"de_DE" => "Deutsch", | ||||
| 			); | ||||
| 
 | ||||
| function update_locale($langpath) { | ||||
|   $locales=array(); | ||||
|   $file=file("/etc/locale.gen", FILE_SKIP_EMPTY_LINES); | ||||
|  |  | |||
|  | @ -383,6 +383,10 @@ if [ -x /usr/sbin/locale-gen ] ; then | |||
| 	echo "en_US.UTF-8 UTF-8" >>/etc/locale.gen | ||||
| 	LOCALECHANGED=1 | ||||
|     fi | ||||
|     if ! grep -q "^it_IT.UTF-8 UTF-8$" /etc/locale.gen ; then | ||||
| 	echo "it_IT.UTF-8 UTF-8" >>/etc/locale.gen | ||||
| 	LOCALECHANGED=1 | ||||
|     fi | ||||
|     if [ "$LOCALECHANGED" ] ; then | ||||
| 	locale-gen | ||||
|     fi | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Benjamin Sonntag
						Benjamin Sonntag