multilingual_sites
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| multilingual_sites [2015/07/02 17:09] – created admin | multilingual_sites [2026/03/21 10:11] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| ====== Multilingual Sites ====== | ====== Multilingual Sites ====== | ||
| + | This feature lets you create multiple translated versions of a site on one domain. See the FAQ [[New Rotation Hints]] section "Site menu translation (i18)" for interface translation. Here we'll cover translating content. | ||
| - | It' | + | Start by creating additional languages in Rotation - Settings - Multilingual. Then, when editing galleries, you can provide a description for each language. For automatic translation, |
| - | First of all, open Rotation Settings, | + | Switch |
| - | Since this moment you'll ba able t edit descriptions for each gallery in each language. And you can see each gallery | + | **There are 2 ways to display the correct |
| - | An easy way to create links is to have following lines in you .htaccess | + | 1. Auto Switch language - the URL stays the same, but the page language changes based on browser language |
| + | |||
| + | 2. Auto redirect | ||
| + | |||
| + | |||
| + | **Auto Switch language** | ||
| + | |||
| + | The script reads the browser' | ||
| + | |||
| + | **Auto redirect to existing language** | ||
| + | |||
| + | This option redirects users to a language-specific URL. The default pattern is: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | For example, a request to http:// | ||
| + | |||
| + | To enable this, add the default rewrite rule at the start of .htaccess: | ||
| < | < | ||
| Line 18: | Line 35: | ||
| </ | </ | ||
| - | and links like http:// | + | Of course, you can create your own URL patterns. |
| - | but feel free to modify links and rewrite in anyway. | ||
| + | **Subdomains** | ||
| - | ====== Site Internationalization | + | If you use language subdomains |
| - | If you also want to translate site's menu you can do the following | ||
| - | |||
| - | 1. create custom template , let's say languages | ||
| < | < | ||
| - | <? | ||
| - | $my_keywords[' | ||
| - | ' | ||
| - | ' | ||
| - | and so on | ||
| - | ); | ||
| - | $my_keywords[' | + | RewriteCond %{HTTP_HOST} ^([a-z]{2})\.domain\.com$ [NC] |
| - | ' | + | RewriteRule ^ %{REQUEST_URI}? |
| - | ' | + | |
| - | and so on | + | |
| - | ); | + | |
| - | and so on as many languages as you want | + | </ |
| + | Each language can maintain statistics separately via two options: Own category stats and Own thumb stats. | ||
| - | if ($_GET[' | + | If both are disabled, you get a simple translation. This is good for SEO. |
| - | $lang = $my_keywords[$_GET[' | + | |
| - | } else $lang = $my_keywords[$_GET[' | + | |
| - | That's it. | + | **Own category stats** - When enabled, category thumbnails are sorted by click stats for that specific language. For example, clicks on http://domain/ and http:// |
| - | As you can see here if you have & | + | |
| - | </code> | + | |
| - | 2. In each template, where you need any translations add | + | **Own thumb stats** - Gallery thumbnails get separate statistics per language. The system creates an additional set of category thumbnails to ensure category headers appear first. If you enable this without Own category stats, the category thumbnail may differ from other top thumbnails in that category. |
| - | < | + | ===== Auto Switch language ===== |
| - | < | + | |
| - | </ | + | |
| + | This option displays the translation on the same URL. | ||
| - | 3. in templates replace actual phrases with variables | + | When a user with DE language (if configured) visits the site, the page automatically displays in DE without changing the URL. |
| - | < | + | |
| - | Most popular | + | To clarify: **Auto redirect to existing language** - redirects to a language-specific URL (language visible |
| - | Order By Date => <?=$lang['order_by_date' | + | **Auto Switch language** - displays the correct language without redirecting (language not visible in the URL). |
| - | and so on | + | |
| - | </ | + | ===== Save language preferences ===== |
| + | |||
| + | Saves the user's language preference in a cookie. Only relevant for **Auto Switch language**. | ||
| + | |||
| + | To redirect users to the **main language** (ignoring their saved cookie), use **& | ||
| + | |||
| + | |||
| + | ===== GeoIP Based ===== | ||
| + | |||
| + | Beyond browser language, you can rotate by country using GeoIP. | ||
| + | |||
| + | Create a language like FR (you don't need translations, | ||
| + | |||
| + | This setting takes priority. For example, if you have FR and DE languages, a user with browser language DE but an IP from Belgium will be counted as FR, not DE. | ||
| + | |||
| + | This lets you group countries together. | ||
| - | So at this point you should see translations if you open let's say index page as http:// | + | Don't create separate rotations for every language unless necessary—you'll need to manage rotations separately for each group, and you need sufficient traffic to justify it. |
| + | ===== Translations ===== | ||
| + | Translating the site menu (links like "Most Popular", | ||
| + | Go to Rotation - CMS Templates - Tpl Custom Var and add custom variables like most_popular. Use these in templates as < | ||
multilingual_sites.1435856945.txt.gz · Last modified: (external edit)
