All posts by Michel

xili-language version 2.11 shipped

Latest release (2.11) of xili-language shipped today.

Some new things for theme’s developers:

A conditional function – is_xili_curlang():
/**
* Test the current language of displayed page.
*
* @since 2.11
* use for other function elsewhere
* @param "" for undefined, slug of tested language alone or an array list
* @return true or false
*/
function is_xili_curlang( $lang = false ) {

This function is also usable in plugin xili-postinpost widget.

The oldest function of xili-language – the_curlang() – is improved and now is able to return the desired property of current language. Useful for choosing condition of part display according language.
/**
* Return the current language of theme.
*
* @since 0.9.7
* @updated 2.11.0
* use by other function elsewhere
* @param slug, iso, full name, alias, charset, hidden, count
*
* @return by default the slug of language (used in query).
*/
function the_curlang( $by = 'slug' ) { // soon obsolete
return xili_curlang( $by );
}
function xili_curlang( $by = 'slug' ) {

More available preset languages in list:

Now using list provided by jetpack, an almost complete list of languages is available with english name, native name and more…
In the list, if the native name is followed by a *, the language is not associated with wp_locale (an official language managed by WP.)

xili-dictionary version 2.6 shipped

xili-dictionary extension is shipped (2.6) and include now plugin language file management.
With taxonomy “Origin”, msgid and msgstr are assigned to the target plugin and it is easy to import terms in dictionary and to create, update language files of the target plugin.

xili-dictionary analyse header of plugin’s sources and this two items ‘Text Domain’ and ‘Domain Path’. If author omits to define them, xili-dictionary try to specify them according language files yet available in plugin’s folder.

M.