Multi-lingual website using subsites

From Lanius CMS Wiki

This tutorial explains how to create a multi-lingual website through the use of subsites.

Note: This tutorial assumes that you have basic knowledge of how to use Lanius CMS and that you are able to configure all necessary components, modules or plugins.

Main site setup

  • Create a PHP file, for example called curpage.php, with the following content:
 <?php if(!defined('_VALID')){header('Status: 404 Not Found');die;}
 $lang = in_raw('lang', $_GET, '', 2); ?>
 <a href="<?php echo $lang.'/'.CMSRequest::URI());?>">
 <img width="16" height="11" src="lang/<?php echo $lang; ?>/flag.png" border="0" alt="<?php
 echo strtoupper($lang); ?>" /></a>

Save it in the website root directory.

  • Install language packages for all languages that you are going to support (this is not mandatory but will make subsites read better)
  • Create a mod_wrapper module for each subsite that you will have and name it properly (i.e. English Translation)
    • Choose a position, access group, and select Show on all menu instances
    • For the relative url field put in curpage.php?lang=en
    • For the Show Title field choose no
    • For the include mode field select Include as a PHP Script

Repeat the creation of mod_wrapper modules for all subsites that you are going to create, varying curpage.php?lang=en. For example:

  • curpage.php?lang=de for German
  • curpage.php?lang=it for Italian
  • curpage.php?lang=gr for Greek

See a list of language identifiers here.

Subsites setup

These are the steps to be performed for each subsite (English, Language1, Language2 etc):

  1. Create a subsite (do not create it as freshly installed and have it offline) and name it en (we will use canonical language identifiers, see above)
  2. Translate content items in the subsite to English (this will be the publicly available English translation of your website)
  3. Publish the subsite

Finished, you now have a multi-lingual website!

Related pages

Personal tools
Create a book
  • Add wiki page
  • Collections help