2016-10-04, 18:10:09
Hey guys,
Great plugin. I just finish to modify it with :
In the file page, create a folder called "flag" and copy images of flags you need. Files must be named as code country et png format.
For instance : en.pgn ; fr.png and so on.
edit file : i18n_lang_menu.php
Into the function get_i18n_lang_menu comment original line and add this :
I juste add a CSS style to mask li heading and replace $lang->text with image call. As you can see, you can use another folder to store your flag pictures.
Great plugin. I just finish to modify it with :
- no heading
- a little flag
In the file page, create a folder called "flag" and copy images of flags you need. Files must be named as code country et png format.
For instance : en.pgn ; fr.png and so on.
edit file : i18n_lang_menu.php
Into the function get_i18n_lang_menu comment original line and add this :
PHP Code:
function get_i18n_lang_menu(){
//load config
$config=get_config();
//hook for <li> class
$langs_arr=return_i18n_languages();
$current_language=$langs_arr[0];
foreach($config->languages->children() as $lang){
#echo '<li '.($lang->code==$current_language?'class="'.$config->class.'"':'').' ><a href="'.htmlspecialchars(return_i18n_setlang_url($lang->code)).'">'.$lang->text.'</a></li>';
echo '<li style="list-style-type: none;" '.($lang->code==$current_language?'class="'.$config->class.'"':'').' ><a href="'.htmlspecialchars(return_i18n_setlang_url($lang->code)).'"> <img src="data/uploads/flag/'.$lang->code.'.png" /></a></li>';
}
}
I juste add a CSS style to mask li heading and replace $lang->text with image call. As you can see, you can use another folder to store your flag pictures.