Fullscreen
Loading...
 
[Show/Hide Right Column]

Plugin Lang

Displays the text only if the language matchs lang/notlang

Example:
{LANG(lang=>en)}Hello{LANG}
{LANG(lang=>fr)}Bonjour{LANG}


If the current language is en, Hello will be displayed. If it is fr, Bonjour.

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


Will produce:
Hello world!

Note: Cached pages don't render this plugin correctly. If you use this plugin, do not cache the page.

In Tiki1.9, the language can match the param lang of the url. So if you couple this plugin with the TRANSLATED plugin, you can have a kind of multilinguism

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


For use in modules and templates
See MultilingualModulesAndTemplates

Required parameters are in bold
Preferences required: feature_multilingual, wikiplugin_lang
Parameters Accepted Values Description Default Since
lang List of languages for which the block is displayed. Languages use the two letter language codes (ex: en, fr, es, ...). Multiple languages can be specified by separating codes by + signs.
notlang List of languages for which the block is not displayed. Languages use the two letter language codes (ex: en, fr, es, ...). Multiple languages can be specified by separating codes by + signs.





Source code (version 1.9.x):
http://tikiwiki.cvs.sourceforge.net/tikiwiki/tiki/lib/wiki-plugins/wikiplugin_lang.php?view=markup&pathrev=BRANCH-1-9

Contributors to this page: Marc Laporte9146 points  and sylvie7387 points  .
Page last modified on Monday 16 April, 2012 04:46:08 UTC by Marc Laporte9146 points .
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.

Site Language

Reference Guide

Keywords

These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):



Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki