xili-language lets you create and manage multilingual WP site in several languages with yours or most famous localizable themes. Ready for CMS design.
READ CAREFULLY ALL THE README FILE AND PREREQUISITES
xili-language.phpand language files to the
_e('the term','mytheme')and no text hardcoded - and contains .mo and .po files for each target language - (application poEdit and/or plugin xili-dictionary can be used)
Some steps to prepare a rich installation:
Settings are progressively reorganized in 6 tabs:
(online help on the top right tab for each settings page)
To change the language of the frontpage according to the language of the visitor's browser, check the popup in right small box in settings. To change the default language of a new post according to the language of the author's browser, check the popup in right small box in settings.
Three widgets are created to enrich sidebar : list of languages, recent posts and recent comments with sub-selection according current language.
SHORTCODE to add a link to other language inside content of a post like:
[linked-post-in lang="fr_fr"]Voir cet article[/linked-post-in]
by default use context 'linktitle' for translation 'A similar post in %s' text of link title attribut.
SHORTCODE to display only content if current language:
[xili-show-if lang=fr_FR ]contenu de la page boutique multilingue[/xili-show-if]
param lang can be ISO or slug.
SHORTCODE to insert translated msgid content according current language
Easy to insert .mo item in your current content.
domain by default is here theme textdomain
[xili18n msgid='yes' ctxt='front' textdomain='default']
above it is the WP core textdomain
SHORTCODE to insert URL of flag set with a language:
returns url of french flag
The most current template tags don't need special work:
Possible that very special permalinks need to use hook named
Sub selection of archives for
wp_get_archives() with &lang= (see § below)
with optional query tag &lang=
xiliml_the_others_posts() function and theme tag to be used in multilingual category loop and by option (array) to return an array of linked posts in other languages (useful for CMS webmasters) (array of lang and id ) - the id is easily transformable in permalink with function
get_permalink() when using this array.
Requires knowledges in php and WP ! After class in sources files, some functions are available - see sources for details.
the_curlang()returns by default the slug of the current language of the displayed webpage (alias
xili_curlang()since 2.11+). If param is specified, return ISO, Full Name or alias of current webpage - see sources -
is_xili_curlang( $lang ) tests (returns true or false) after testing language of current webpage. Param can be a language slug (as string) or a list of slugs (as an array). Example:
is_xili_curlang( 'fr_fr' ) returns true if webpage is in french - since 2.11+
widget for recent comments that can subselect those for current language. (a function
xiliml_recent_comments() is also available if you want to create a template tag with resulting objects array).
Archives tags is a very complex template tag in his background and not very easy source hookable. So we decided to add few features : by adding query in vars of the function, it will be possible to display a monthly list of archives for a selected language -
wp_get_archives('..your.vars..&lang=fr_fr') - or the current the theme language -
wp_get_archives('..your.vars..&lang=') -. The displayed list of links will be translated and link restrited to display only archives of this language.
Requires: 4.3.5 or higher
Compatible up to: 4.5.4
Last Updated: 4 months ago
Active Installs: 4,000+
0 of 1 support threads in the last two months have been marked resolved.
Got something to say? Need help?