Xili-language: Getting started, prerequisites

Before to activate xili-language, it is mandatory to verify few things:

Contents

a translation ready theme

A translation ready theme is ready for localization. The code contains php functions to translate labels, items and texts according the current language used by the webmaster. xili-language will use this feature to create a multilingual context for visitors.

Caution : some themes with special customized functions are not guaranteed to be multilingual. Same case for theme that does not follow the rules of WordPress.

in theme folder

an example of wp-content/themes folder and his languages sub-folder. It contains the .mo files where translations are ready.

Xl-screenshot-1.png

Extract of theme source file with international text

Here the theme text domain is xylophone and used in function for localization like __() or _e()

Xl-creenshot-2.png


A good example is the default theme twentyeleven theme.

in functions.php file of theme

To detect if the theme is translation ready and to detect the theme text domain, xili-language try to detect the function load_theme_textdomain() as here (extract of functions.php of twentyeleven) :

function twentyeleven_setup() {

	/* Make Twenty Eleven available for translation.
	 * Translations can be added to the /languages/ directory.
	 * If you're building a theme based on Twenty Eleven, use a find and replace
	 * to change 'twentyeleven' to the name of your theme in all the template files.
	 */
	load_theme_textdomain( 'twentyeleven', TEMPLATEPATH . '/languages' );

When this function is not present, a warning appears in xili-language settings window !

notes for theme developers

Currently around less than half of themes in repository are translation ready (like twentyten and twenty eleven). If you do a localizable theme, probably the theme will more successful for people with a monolingual with other language and for webmaster wishing to do a bi or multilingual website.

notes for buyers / users of commercial themes

Since several months, some supports were requested by people who buys a commercial theme. For dev.xiligroup team, it is impossible to verify the source and file (not free !). And unfortunately when reading the features list in the shop, the theme was not translation ready or localizable.

Before to build a multilingual website, verify that the theme is well architectured and also localizable (ready for localization) with the good .mo files for the target languages.