[title sub="Written by Steve Jarvis"]Composr Tutorial: Changing the site language (for end users)[/title]

This tutorial covers how to translate your (Composr-powered) website into a different language. It is designed for the more casual webmaster who is not seeking to create their own Composr translation. We also have more thorough tutorials, linked under See Also.

To keep things simple we will assume you only want a single language on your website. The other tutorials cover the details of maintaining multiple languages.

[contents]decimal,lower-alpha[/contents]

[title="2"]Downloading languages[/title]

Composr is supplied in English as standard. Any other languages will need new language files downloading.

([i]If you have a web designer, you will want to ask them to perform the translation installation for you, if they haven't already done them[/i])

We use the Transifex platform for organising community translation. Transifex is an online system where multiple users can translate the same software, which can then be used by everyone. It is possible also to translate directly within Composr, but we discourage this. Through community translation on Transifex effort can be pooled, and translation quality maintained indefinitely.

[title="3"]From addons[/title]

When we release new versions we aim to bundle all translation from Transifex that has had significant progress into language packs, distributed as addons. These are available in the addon directory.
If you see a language on Transifex that has been translated, but there's no addon, open an issue on the [url="Tracker"]https://composr.app/tracker[/url] about that.

[title="3"]Direct from Transifex[/title]

If you need more up-to-date translations, you can get them directly from Transifex.

The Composr website hosts a copy of our [tt]transifex[/tt] addon that allows you to generate any language pack addon from the latest files on Transifex. It's a very simple process that will generate a [tt].tar[/tt] file that you can import (upload) into Composr from Admin Zone > Structure > Addons, then the Import non-bundled addon(s) link at the bottom.

[title="2"]Turning on a different language[/title]
[surround]
[media width="150" description="Changing the default site language" float="right"]data_custom/images/docs/tut_intl_users/intl_config_2.png[/media]
To change the default language used on the whole site, use the [tt]http://yourbaseurl/config_editor.php[/tt] script (load up the URL, with [tt]yourbaseurl[/tt] substituted with your real base URL).
[/surround]

[surround]
[media width="150" description="Language configuration" float="right"]data_custom/images/docs/tut_intl_users/intl_config.png[/media]
It is possible to configure Composr such that members may select which language to use on your site, and pages are then presented in this language. There are a number of ways a user may choose a language:
 - via the language block (which inserts a [tt]keep_lang[/tt] parameter into the URL, to preserve their choice until they close the browser window)
 - via their member profile (Conversr supports this better than other forum drivers, although the integration can be improved by editing the [tt]lang/map.ini[/tt] file)
 - via their web browser stated language (disabled by default, as most users unfortunately have it misconfigured)

As members can select their language by editing their member profile it may be necessary to edit your own profile to the language you're trying to check even if you changed the default, because you might already have your profile saved as the previous different language (usually English).

To test a language without editing anything you can append [tt]&keep_lang=FR[/tt] to the URL (this is an example for French). If the URL did not contain an "?" symbol already you would need to append [tt]?keep_lang=FR[/tt] instead.
If this confuses you, put the [tt]side_language[/tt] block onto one of your panels. This does the same thing.
[/surround]
[title="3"]Debugging[/title]

If you're having problems getting things working a good early diagnosis step is to check what your site is trying to do. If you look at your page source from inside your web browser, you will see something like the following near the top of the code:
[code="HTML"]
<html lang="EN" dir="ltr">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
[/code]

Here you can see the site is running for you with the language "EN" which is specifying a charset of "ISO-8859-1" and a text direction of "ltr" (left to right).

If this is not what you thought was the case it might just tell you where your problem exists.

[title="2"]Translating content[/title]

Once you have your new language set up, simply edit your content (pages etc) to be written in the language you want.

[title="2"]Cheating[/title]

If you don't want to worry about a proper translation, but do want to support multiple languages, Microsoft provide some code for Bing Translator that you can easily include in your site footer (or header, or a panel) to allow people to translate the site. Modern browsers often have translate features built directly in too.
I realise this isn't a translation solution, but it may be enough to cover the simplest cases and hence worth considering.

[title="2"]See also[/title]

 - [page="_SEARCH:tut_intl"]Localisation and internationalisation[/page]
 - [page="_SEARCH:tut_intl_content"]Translating Composr content[/page]

{$SET,tutorial_tags,language_block,core_language_editing,Internationalisation,Contributing,novice}{$SET,tutorial_add_date,Mar 2011}{$SET,tutorial_summary,How to translate your (Composr-powered) website into a different language.}[block]main_tutorial_rating[/block]
