Examples » Multilang plugin. Different page versions

This example demonstrates multilang plugin. There are different language versions of this page:

Multilang plugin will show the right version, using:

Page values are:

You can change preferred language, using:

URL parameter:

Language list:

English | German | French | Italian | Russian

en | de | fr | it | ru

Language combobox:

Plugin multilang v.2.0.0 | Inc v.2.0.0 | Settings: example,multilang | cache is disabled | ob is enabled | Executed in 0.03 s. | Hide source
<?php define(INC,'example,multilang'); include_once '../inc/inc.php';
$example_plugin = 'multilang';

$title = 'Multilang plugin. Different page versions';
$html_lang = 'it';
$cache_on = false;

inc();?>

<p>This example demonstrates multilang plugin. There are different language versions of this page:</p>

<ul>
  <li><a href="multilang.php">multilang.php</a> - Default, English version</li>
  <li><a href="multilang.de.php">multilang.de.php</a> - German version</li>
  <li><a href="multilang.fr.php">multilang.fr.php</a> - France version</li>
  <li><a href="multilang.it.php">multilang.it.php</a> - Italian version (<b>Current page</b></li>
  <li><a href="multilang.ru.php">multilang.ru.php</a> - Russian version</li>
</ul>

<p>Multilang plugin will show the right version, using:</p>

<ul>
  <li>URL parameter lang (current value is: <b>"<?=$_GET['lang']?>"</b>)</li>
  <li>Cookie value lang (current value is: <b>"<?=$_COOKIE['lang']?>"</b>)</li>
  <li>Web browser settings (current value is: <b>"<?=$_SERVER['HTTP_ACCEPT_LANGUAGE']?>"</b>)</li>
</ul>

<p>Page values are:</p>
<ul>
  <li>$lang=<b>"<?=$lang?>"</b></li>
  <li>$html_lang=<b>"<?=$html_lang?>"</b></li>
  <li>$charset=<b>"<?=$charset?>"</b></li>
</ul>

<p>You can change preferred language, using:</p>

<p>URL parameter:</p>

<ul>
  <li><a href="multilang.php">multilang.php</a> - Autodetect</li>
  <li><a href="multilang.php?lang=en">multilang.php?lang=en</a> - English version</li>
  <li><a href="multilang.php?lang=de">multilang.php?lang=de</a> - German version</li>
  <li><a href="multilang.php?lang=fr">multilang.php?lang=fr</a> - France version</li>
  <li><a href="multilang.php?lang=it">multilang.php?lang=it</a> - Italian version</li>
  <li><a href="multilang.php?lang=ru">multilang.php?lang=ru</a> - Russian version</li>
  <li><a href="multilang.php?lang=default">multilang.php?lang=default</a> - Default version, clear language cookie</li>
</ul>

<p>Language list:</p>

<p><?=multilang_list()?></p>
<p><?=multilang_list(true)?></p>

<p>Language combobox:</p>

<p><?=multilang_combobox()?></p>
<p><?=multilang_combobox(true)?></p>