Composr Tutorial: Changing the site language (for end users)

Written by Steve Jarvis (ocProducts)
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.

Downloading languages

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

(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)

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.

From addons

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 Tracker about that.

Direct from Transifex

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

The Composr website hosts a copy of our transifex 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 .tar file that you can import (upload) into Composr from Admin Zone > Structure > Addons, then the Import non-bundled addon(s) link at the bottom.

Turning on a different language


Changing the default site language

Changing the default site language

(Click to enlarge)

To change the default language used on the whole site, use the http://yourbaseurl/config_editor.php script (load up the URL, with yourbaseurl substituted with your real base URL).


Language configuration

Language configuration

(Click to enlarge)

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 keep_lang 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 lang/map.ini 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 &keep_lang=FR to the URL (this is an example for French). If the URL did not contain an "?" symbol already you would need to append ?keep_lang=FR instead.
If this confuses you, put the side_language block onto one of your panels. This does the same thing.


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:


<html lang="EN" dir="ltr">
   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

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.

Translating content

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


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.

See also


Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.