This version 0.9.8.2 is a new step in the improvement of xili-language plugin to made a flexible multilingual website (blog or cms). – downloadable in wp repository – to create sub-groups of tags according language, it is recommended to use xili-tidy-tags plugin.
What’ new ?
1) In the background, data design has a little changed. By creating a new taxonomy, the languages are now sortable to be display as you want. Nothing to change when upgrading from previous release : only add sorting numbers.
2) In the html side, it is now possible to insert automatically one language iso code in the html tag via the hooked language_attributes template tag.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en_US"> |
in php code of home page :
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> |
(when multiple languages, the list is sorted as you have defined)
It is also possible to add a meta like this if you define it in functions.php:
<meta http-equiv="content-language" content="fr-FR" /> <meta name="language" content="fr-FR" /> <!-- end xili-language metas --> |
function my_head_insert_language_metas($curlang,$undefined) { global $xili_language; if ($undefined === false) { $lang = str_replace('_','-',substr($curlang,0,3).strtoupper(substr($curlang,-2))); } else { $listlang = array(); //$listlanguages = get_terms(TAXONAME, array('hide_empty' => false)); //$listlanguages = get_terms_with_order($xili_language->langs_group_id,TAXOLANGSGROUP); replaced by since 0.9.8.2 $listlanguages = get_terms_of_groups_lite($xili_language->langs_group_id,TAXOLANGSGROUP,'ASC'); foreach ($listlanguages as $language) { $listlang[] = str_replace('_','-',$language->name); } $lang = implode(', ',$listlang); } echo "<meta http-equiv=\"content-language\" content=\"".$lang."\" />\n"; echo "<meta name=\"language\" content=\"".$lang."\" />\n"; echo "<!-- end xili-language metas -->\n"; } add_filter('head_insert_language_metas','my_head_insert_language_metas',1,2); |
3) It is also possible to detect the language of the browser of the visitor when he arrived on your homepage by instance. (see preferences in Firefox by instance)
Only check the settings box in admin UI.
See plugin code to analyze the function.
4) …and fixes (w3c) and best way to localize the_time() without changing the theme php scripts.
Next step : some examples of scripts to enrich your multilingual theme…
MS
090404