[Show/Hide Right Column]

Vary text based on the page language
Print

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

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: lindon2331 points  , sylvie4333 points  and Marc Laporte5511 points  .
Page last modified on Saturday 06 March, 2010 04:06:48 UTC by lindon2331 points .

Find by Page Name

Exact match

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki documentation and should correspond to development keywords (bug reports and feature requests):