User Tools

Site Tools

Translations of this page:

Sidebar

Documentation index

  • New Style Rotation
multilingual_sites

Multilingual Sites

It's pretty easy to create a multilingual site.

First of all, open Rotation Settings, multilingual tab. Add as many languages as you want. Note, that each language is basically a new slave site so your DB will grow accordingly.

Since this moment you'll ba able t edit descriptions for each gallery in each language. And you can see each gallery in each language using following link (w\o rewrites so you can grasp an idea) http://domain/scj/tube/?slug=...&force_lng=

An easy way to create links is to have following lines in you .htaccess file

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]{2})/(.*)$ $2?force_lng=$1&%{QUERY_STRING} [L]

and links like http://domains/de/gallery/cool/index.html

but feel free to modify links and rewrite in anyway.

Site Internationalization (i18n)

If you also want to translate site's menu you can do the following

1. create custom template , let's say languages

<?php 
$my_keywords['en'] = array(
  'most_popular' => 'Most popular',
  'order_by_date' => 'Order By Date',
  and so on
);

$my_keywords['de'] = array(
  'most_popular' => 'Populärste',
  'order_by_date' => 'Sortiert nach Datum',
  and so on
);

and so on as many languages as you want



if ($_GET['force_lng'] and isset($my_keywords[$_GET['force_lng']])) {
  $lang = $my_keywords[$_GET['force_lng']];
} else $lang = $my_keywords[$_GET['en']];

That's it.
As you can see here if you have &force_lng in URL – it will load appropriate language, otherwise it will be english.

2. In each template, where you need any translations add

<!--INCLUDE_TEMPLATE_languages-->

3. in templates replace actual phrases with variables

Most popular => <?=$lang['most_popular']?>
Order By Date =>  <?=$lang['order_by_date']?>
and so on

So at this point you should see translations if you open let's say index page as http://domain/?force_lng=

multilingual_sites.txt · Last modified: 2015/07/02 17:09 by admin