Loading...
 

Plugin Language

Use the wiki plugin to vary content based on the page language.

Parameters

Introduced in Tiki 1.
Preferences required: feature_multilingual, wikiplugin_lang
Parameters Accepted Values Description Default Since
(body of plugin) Content to show
lang List of languages for which the block is displayed. Languages use the two letter language codes (ex: en, fr, es, ...). Use + to separate multiple languages. 1
notlang List of languages for which the block is not displayed. Languages use the two letter language codes (ex: en, fr, es, ...). Use + to separate multiple languages. 1

 Note
Cached pages don't render this plugin correctly. Do not cache the page that this plugin is used on.

Examples

Based on language

{LANG(lang="en")}Hello{LANG}
{LANG(lang="fr")}Bonjour{LANG}

If the current language is en (English), "Hello" will be displayed. If it is fr (French), "Bonjour".

Based on language and not language

This code:

{LANG(lang="fr")}Bonjour le monde!{LANG}{LANG(lang="es")}¡Hola, mundo!{LANG}{LANG(notlang="fr+es")}Hello world!{LANG}


Would produce on this site:
Hello world!

With PluginTranslated

The language can match the lang url parameter. So if you couple this plugin with the PluginTranslated, you can have a kind of multilinguism:

{LANG(lang="fr")}en Français{LANG}
{LANG(lang="en")}in English{LANG}
--- (page break)
{TRANSLATED(flag="France" lang="fr")}[./tiki-index_raw.php?page=MyPage&lang=fr|>>]{TRANSLATED}
{TRANSLATED(flag="United_States" lang="en")}[./tiki-index_raw.php?page=MyPage&lang=en|>>]{TRANSLATED}

Related pages



Created by: Last Modification: Friday 26 July, 2019 12:44:36 GMT-0000 by Yves Kipondo
List Slides