User Tools

Site Tools


Translations of this page:



multilingual_sites

Multilingual Sites

The purpose of this feature is to create multiple language versions of a site on a single domain. Instructions on how to translate the site’s interface are outlined in the FAQ New Rotation Hints, under the section “Translating the site menu (i18n).” In this section, we will focus on translating the actual content.

First, navigate to Rotation - Settings - Multilingual to create the required number of languages. Once this is done, each gallery will include the option to edit its description for each language. However, in most cases, automatic translation will be enough.

You can use Google Translate. Let’s assume you have added two languages: de and es, for the main site, which is in English.

The language is switched by adding &force_lng=… (e.g., de or es in our example) to the URL.

There are two options for displaying the preferred language, and consequently, two options in Rotation - Settings - Multilingual:

When the page URL does not change but varies depending on the browser's language settings — Auto Switch language. When the page URL changes, displaying the page in a specific language regardless of the browser’s language — Auto redirect to existing language.

Auto Switch language

The script detects the language specified in the browser's headers and displays the page accordingly, without changing the URL. This option is straightforward: once enabled, the same page is displayed in different languages based on the browser’s language settings.

Auto redirect to existing language

The Auto redirect to existing language option redirects the user to a language-specific URL. The default format is:

http://{DOMAIN}/{LANGUAGE}/{ORIGINAL_REQUEST}

For example, if a request is made to http://domain/category/asd/ with the language set to ru, the user will be redirected to http://domain/ru/category/asd/ (assuming ru is configured in the settings). The URL http://domain/ru/category/asd/ will always display the page in Russian, regardless of the browser's language.

To enable these rewrites, a default rewrite rule must be added to the beginning of the .htaccess file:

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

Of course, you can create your own version to accommodate different link variations.

For each language, there are several options for collecting statistics, mainly differing in two parameters: Own category stats and Own thumb stats.

If both Own category stats and Own thumb stats are disabled, you essentially get a simple translation of the site. This approach is beneficial for SEO.

Own category stats — when it's set to “yes” this means that when category thumbnails are displayed and sorted by clicks, they will be shown based on the click statistics for that specific language page. For instance, clicks on category thumbnails on http://domain/ and http://domain/de/ will be counted separately.

Own thumb stats — this means that gallery thumbnails will have their own independent statistics. Please note that in this case, an additional set of category thumbnails is created, ensuring that the category thumbnails are positioned prominently within their respective categories. If this option is enabled without enabling Own category stats, the category thumbnail order may differ from the first thumbnails shown in that category.

Auto Switch language

There is a second option for displaying translations — at the same URL.

For example, if a user with the DE language setting (and the DE language is available on your site) visits the site, the page will automatically display in DE without changing the URL (i.e., without a redirect).

To clarify: Auto redirect to existing language is a redirect to a URL where the language is visible in the URL. Auto Switch language displays the page in the selected language without a redirect, and the language is not visible in the URL.

Save language preferences

This option saves the user’s language preference in a cookie. It is only applicable to the Auto Switch language option.

If you need to redirect the user to the default language—ignoring the language saved in the cookie—you should use &force_lng=main in the URL.

GeoIP-Based Language Detection

The basic language detection method is based on the browser’s language settings. However, it is also possible to configure it based on the user’s country (using GeoIP).

To do this, create a language, such as FR. While translating the content is optional, enabling Own thumb stats is required since we will create separate statistics for French traffic. Next, configure the GeoIP settings by specifying that if a user's IP address is detected as being from France (or Belgium, for example), the system will count the impressions, clicks, and click-through rate (CTR) for the FR language. This can be done by entering the GeoIP codes (such as FR, BE) in the “+ GeoIP Codes” field of the newly created language.

Please note that this setting takes priority. For instance, if you have both FR and DE languages configured, but a user with the DE language setting visits from a Belgian IP address, the statistics will be recorded under FR, not DE.

This approach allows you to group countries together for language statistics.

However, be cautious about creating separate rotations for each language. You will need to rotate the database for each group separately, and it's essential to assess whether you have sufficient traffic to support this.

Translations

It is fairly simple to translate the site’s menu (e.g., the links like “Most Popular,” “Order By date,” etc.) into other languages.

In Rotation - CMS Templates - Tpl Custom Var, add custom variables such as most_popular. This variable can then be used in templates like <!–CUSTOM_VAR_MOST_POPULAR–>, and a separate translation can be provided for each language.

multilingual_sites.txt · Last modified: 2024/09/13 18:01 by admin