HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Translating Composr v10

Translating Composr v10 Hi all,

This week one of our awesome long-term translators approached me regarding translating v10.

This enthusiasm has prompted me to pull-forward our plans for refreshing our translation platform.

We've been using Launchpad for quite some time. Launchpad was a big step up from people manually doing translations on their own or privately between people, as it removed the chance of people dropping out without sharing partial progress, and removed the need for lots of manual coordination.

However, we found Launchpad far from perfect:
  • The development of the translation features has basically been non-existent for years, leaving a rather stale and clunky product.
  • An API was planned but never happened, meaning we had no way to automatically build out language packs for easy distribution.
  • We had to work with .po files rather than native ocPortal .ini files. This meant we had to add lots of extra documentation and tooling to an already complex process.
  • Each time we refreshed the language strings on Launchpad, it would misreport all the translation stats until each individual file was re-saved.
  • To get the translated files off Launchpad you had to put in a request to a queue, and then receive the files later on. Sometimes that queue would get stuck, but even in the best case it was annoying.
  • There was no particular support for annotating language strings with comments (in fact, the ocPortal string comments would themselves import as translatable strings, ergh).

We've therefore switched over to a new platform, Transifex.

Transifex is a much nicer system, with all the advantages to Launchpad but none of the above disadvantages.

I have been able to code up our release process so that the strings will be routinely updated each time we put out a patch release of Composr, and so that a set of language addons may automatically be maintained directly within our addon directory.

Transifex is already loaded up with the v10 language strings, and past translations from Launchpad are up there too. Translations for v10 can therefore begin right now.

A further issue is our translation tutorials really had turned into spaghetti. I've gone through and largely rewritten them.
I should also note that in v10 multi-language support is off by default. This greatly simplifies things and improves performance. All aspects relating to hosting multiple languages have been moved off into a separate tutorial.

Our new tutorials are reproduced below for immediate availability.

Composr Tutorial: Localisation and internationalisation

Written by Chris Graham, ocProducts
This tutorial is designed as a comprehensive guide to Composr's translation features, written for people wanting to make a complete Composr translation and understand the full technical details. We also have a simpler tutorial.

Composr has great support for internationalisation, including:
  • time-zones
  • translation of text into different languages (.ini files)
  • translation of text into different languages (Comcode pages)
  • translation of text into different languages (text files)
  • translation of images into different languages (e.g. buttons with some text on)
  • different character sets (for example, Cyrillic)
  • different locales, for different numbering systems (for example, European comma and decimal-point difference)
  • there is support for translating content into different languages


In Composr, time-zones can be adjusted in two ways:
  • adjusting the site time-zone (this is a site configuration option). This sets the default, and typically will be where your organisation is mainly centered around.
  • adjusting member time-zones in their account settings (Conversr only). This lets individual members set their own time-zones.

You can also have guest time-zones auto-detected (a configuration option). This is a good idea if your users are geographically-distributed.


A Composr website automatically customises the user interface based upon the language it is beng viewed in. This involves a number of language elements, but primarily language files (which include language strings). Most text in the user interface is derived from some kind of language string, which is the basic translation building block. Language strings are parameterised so as to be able to insert dynamic data within translatable sentences and paragraphs.

Translations do not need to be done fully, as Composr will automatically fallback to English elements when no translation is available. This is very fine-grained.

Coordinating your translation

The core development team really want Composr to be widely used by people in any language, but does not get involved in maintaining or developing individual translations (other than the standard English) due to a lack of language-specific knowledge and resources. Instead we maintain documentation and architecture, to empower contributors and help automate delivery, and we grant necessary access to translators.

If you have any feedback on how translation can be easier then please report it in the Internationalisation forum. An example bit of feedback to report might be if the exact grammatical context of an English language string is not clear (i.e. ambiguous), and you want us to add a description for that string. Another example is if a string is formulated in such a way that it is impossible for you to translate with grammatical correctness.

Internationalisation can be difficult and time consuming if someone has not already worked on a translation for your language. We therefore recommend that you try to plan ahead and bring together a team from your country to make translations go faster.

On the other hand, if the translation was substantially completed already it might be as simple as installing it from the Composr addon directory.

Not all language files need to be translated, and language files do not have to be complete, as if a string cannot be found and the fall-back language (English) isn't being used, Composr will look in the English language pack using the fall-back mechanism. This may hurt your sense for 'completeness', but practically speaking most sites don't expose most strings, and some are only ever seen in rare circumstances or by website staff.

Language file format (technical overview)

This section will describe the format used to store language string s in Composr. In theory, this is not needed to be known, as an interface in the Admin Zone is provided that works with this behind-the-scenes; however it is useful to know, especially if you are wishing to work through the language files in a text editor.

Composr language packs are made up of .ini files, containing mappings between special codes (based on the English) and the actual string as displayed. For example, a common string in the 'global' language file (the one containing common strings used throughout the portal), is coded as:


Composr is developed in (British) English, and this is technically known as the 'fall-back language', because English always has a complete set of language files and strings.

The .ini files for any translation are stored together in a directory that is named with the standard ISO two-letter code to denote that language; for example, English is 'EN'. A list of these codes is in lang/langs.ini. We use upper-case for the names; often other software uses lower-case, but it varies.

All bundled languages packs are located in the 'lang' directory of Composr. There is also a 'lang_custom' directory which contains files from custom language packs, or language files that 'override' those available in the 'lang' directory. Whenever language files are edited in the Admin Zone, the file is automatically overridden to a 'lang_custom' one if it has not been already.

Special strings

Language string codes that are in lower-case are special strings, that should not be translated directly. These strings contain encoded information relating to the language pack.

String codename Purpose
charset The character set needed for the language (standard code for an ASCII character set). Most people leave this as 'utf-8' (Unicode, works with any characters), although regional character sets are supported also.
locale The locale: there are standard locale codes for unix, based on language codes, but they vary across operating system: use what works on your server.
The locale code is used to prepare certain operating system date strings, and number formatting. On Linux and MacOS you can find the list of locales via the locale -a command.
dir The direction of text (usually ltr, but sometimes rtl for languages such as Arabic). An "rtl" language would likely require many few template changes as well as language changes. If someone does this we would consider integrating the changes back into a future version of Composr.
en_right Sometimes templates have to apply CSS properties values of 'left' or 'right', according to the text direction. For a rtl language, this becomes 'left' instead of 'right'. No other value than left or right may be used.
en_left As above, but opposite.
date_* / time_* / calendar_* Date/time formatting in one of the two PHP time formats (1, 2). If there are no '%' signs it's "date", if there are % signs it's "strftime".
dont_escape_trick Ignore this string, it is purely used by code, and should never have its value be changed.

Code within strings

In many cases there will be some coding symbols embedded within a specific language string. These coding symbols will be written in English (like almost all programming languages are), but shouldn't be themselves translated.

These may come up in situations such as:
  1. Hello {1}
  2. There are {2} {2|apple|apples}
  3. A <strong>good</strong> day
  4. [block="something"]menu[/block]
  5. The renderer to use (hook-type: 'blocks/main_custom_gfx')
  6. Christopher&apos;s plan
  7. {1} leads the usergroup &lsquo;{2}&rsquo;
  8. Welcome back to {$SITE_NAME}

Here's how the above sample cases would be translated:
  1. The {1} bit represents a parameter to the string (something inserted dynamically) and should be left alone. Translation in French may look like Bonjour {1}.
  2. This is similar to above, but uses our pluralisation feature ({2} would be a number in this case). Translation in French may look like Il existe {2} {2|pomme|pommes}.
  3. There is an HTML tag which must be left alone. Translation in French may look like Un <strong>bon</strong> jour.
  4. This is largely Comcode which must be left alone. Translation in French may look like [block="quelque chose"]menu[/block].
  5. This is partly referring to a Composr directory. Translation in French may look like Le moteur de rendu utiliser (du type crochets: 'blocks/main_custom_gfx').
  6. This contains an HTML entity (a smart-quotes apostrophe character). Translation in French may look like Le plan de Christopher. In this case we didn't keep the entity because the translation didn't warrant it. The purpose of this example is to show that "apos" is not some English text to translate directly, it is HTML, which would be the same in any language, but may or may not persist depending on your translation target.
  7. Again this one contains HTML entities. Translation in French may look like {1} dirige le &lsquo;{2}&rsquo; groupe d'utilisateurs.
  8. This contains some Tempcode. You would only translate the words 'Welcome back' and leave the '{$SITE_NAME}' intact. Translation in French may look like WelBienvenue {$SITE_NAME}.

The language editor (i.e. how to change strings locally)

The language editor allows you to translate 'strings' so that your website is displayed in a language other than the original British English. Alternatively, you may just wish to change language strings to change the 'style' of the website.

The language editor is very easy to use. All you need to do is go to the translation module, choose your language, choose the language file to translate, and then you are presented with an interface to translate the strings.
A small level of integration is provided for languages which Google can translate, so as to provide a guide.

You can reach the language editor from Admin Zone > Style > Translate/re-phrase the software.

We recommend doing translations via Transifex instead. See the "Collaborative translations on Transifex" section.

Contextual translation

Many users like to translate stuff just on the public part of their own website. There is an option to change the language strings that you see on a page from the page footer which really helps you speed translation up. Specifically:
  1. In the footer there is a drop down menu which is only visible to Admins. This is titled "Select page rendering tool" as standard, although it may not be visible on custom themes or could have been translated. If you are not using the default Composr theme then you can enable the default theme temporarily by adding &keep_theme=default to the end of the website address (actually it's ?keep_theme=default if there's no ? already in the URL you're at).
  2. Choose "Translate/Re-Phrase the software" from this menu and the language you want to translate to.

This will take you to the page which displays the language strings which are used on the current page.

Note that some of the strings will be re-used across different pages. Changing them on one page will affect any other page that uses them, so some care is needed. For example the word "Members" may appear on several pages. The up-side is that once it has been translated once it should not need translating on further pages.

Character sets

There are three systems that are in common usage to allow diverse characters to be displayed in a document:
  • Unicode
  • Character sets
  • HTML entities

Composr supports both character sets and Unicode. Generally everyone will want to use Unicode (utf-8) nowadays, and that's our default in Composr. PHP does not have good Unicode support, but it does have a number of common extensions and techniques for handling it (mainly mbstring and iconv), and we support all of those. If there are no extensions installed we have some basic code to 'get by okay'. If you are using a non-English language, you want to ensure your host has the PHP mbstring extension, and the vast majority of hosts do.

The British English pack can be used in both Unicode and Character set mode, so we use HTML entities in many places to make up the difference. Most language strings support HTML, so HTML entities can be used there, but it is not universal.

To understand character sets, you need to understand how strings (or text files) are composed. Each character (a symbol, represented by a 'glyph' on the screen) is essentially represented a number, 0-255; 0-127 are usually standard, and specified using the '7-bit ASCII code': the 128-255 range is essentially free, and what the numbers map to depends on the 'character set' used. As different languages use different characters (for example, accented characters, or a whole different alphabet, or even a pictographical language), different languages use different character sets.

A file that uses 'high' characters will look different when viewed in editors set to different character sets. In order to put in text in the appropriate character set, and to view it, your editor must be set to it; this is to be expected to be by default if you are translating to your native language.

utf-8 works on the principle that characters may use more than one byte. The ASCII characters all fit within one byte, but extended characters use 2 or more bytes. Normal ASCII text is therefore the same in both Unicode and a character set, but extended characters are represented very differently.

Collaborative translations on Transifex

You can use Transifex to translate Composr into your language with the help of others.

Transifex is great because:
  • You do not need to feel that you are alone translating everything yourself anymore
  • It's very easy to work together. People can be translating the same language at the same time
  • Anyone can download the current translations at any time

The process is as follows:
  1. Go to Transifex.
  2. Register as a Transifex user if you do not already have an account, or log in. If registering you'll need to set your name and role after confirming your e-mail address, choose 'Translator' as the role. Skip the steps '2' and '3' on the form, just click the button to go to your dashboard.
  3. Go to the ocProducts organisation on Transifex.
  4. Choose the version of Composr you have installed (if you're not sure, it will say on the front page of the Admin Zone). Transifex calls this the 'project'.
  5. Choose your language.
  6. Click "Join team"
  7. (Wait until the team join request has been accepted – it is a good idea to introduce yourself on the Internationalisation forum so we know who you are)
  8. Start translating individual resources (language files)

The strings are split across about 100 core resources/files, often it works well to work with other people, each doing different files. The files are actually marked by priority – the high priority or urgent priority ones are core, while files for non-bundled addons are marked normal priorities. Most users will want to ignore the non-bundled addons files. Don't feel compelled to do it all for 'completeness'.

Notes about specific language strings are automatically made available within Transifex.

To coordinate with other translators use the Internationalisation forum. We suggest you have one main topic per language, and keep editing the first post of that topic to provide basic details such as policies, translator names, and translation status.
Please try and respect the translators who have worked before you, and negotiate to a common translation standard. For example, you may need to agree on the use of formal/informal grammar within the translation to ensure everything is consistent. If you have suggestions, or are the first major translator, make them known on the forum. We have team approval turned on, i.e. you have to apply to join the translation team. The only reason for this is so that we can protect existing translators from problems caused by newbies diving right in. Generally we expect to approve all requests, unless there's already a strong language maintainer making quick progress on that language and not wanting to share the task.

Transifex is not being used for things other than language strings (within language files), such as theme images, and page templates. However for the great majority of sites, translating the language strings is enough. If you want to distribute translations for page templates etc, you can do so in the Internationalisation forum.

Speeding up translation

There is a non-bundled addon called lang_tools that can tell you which strings are used on administrative screens and which aren't. It's not perfect, however.

Downloading translations from Transifex

» See the Changing the site language tutorial.

Turning on a different language

» See the Changing the site language tutorial.

Criticising language packs

A tool to criticise language packs is provided, to identify what has not been translated, amongst other things. This tool is intended for those who translate language files without using the inbuilt editor, or for those who have upgrade the software and need to update their language packs.

It is generally better to look at outstanding translation tasks via Transifex. We update the source strings on there with each Composr patch release.

Non-ISO languages

By default Composr supplies language codes and their names, based on the ISO 639 standards. You can add new codes by overriding the lang/langs.ini file to lang_custom/langs.ini if you like. When you add a new language pack in Composr you are limited to either choosing an existing code or typing a new one of 1-4 characters – the 1-4 character code would be mapped to a nice name via langs.ini, or if no mapping exists, it would be shown as-is.

Right-to-left languages

Composr has some built-in support for right-to-left languages. You need to change the 'dir', 'en_left' and 'en_right' language strings to activate it.

However there are two issues where some extra consideration is needed.

Comcode editing

Because Comcode is written in English, and punctuation symbols are considered right-to-left punctuation when "automatic bi-directional detection" is enabled, there is a conflict between the desire to type Comcode in English and the desire to type normal right-to-left script.
The following is in our CSS, but commented out:


input[type="text"],textarea { /* So Comcode can be typed */
   unicode-bidi: bidi-override;
   direction: ltr;
Uncommenting this makes text input areas work in left-to-right. You can choose to enable it, to make Comcode easier to type, but it will make right-to-left languages harder to type and understand.

Theme layout

We have tried to make our default theme support right-to-left nicely, but unfortunately there are many cases where we could not elegantly do it because we are setting things on a pixel-way instead of a left/right-way. For example, you may see list bullets displaying on the wrong side of a list element. It is caused by CSS like:


ul.compact_list li {
   margin: 0 0 0 17px;
   padding: 0;
which would need changing to:


ul.compact_list li {
   margin: 0 17px 0 0;
   padding: 0;
Therefore to make things display neatly you will need to make a modified theme that makes these kinds of changes for margin settings, padding settings, and background settings.

If there are cases where our default theme can be improved without encumbering the left-to-right majority too much, please consider making a Pull Request on the Composr project on github. Only do this if you have brought things up to a default level and tested it. We would love regular users of right-to-left languages to contribute corrections, as it is too big and complex a task to integrate into the core development process.

Things you can translate

As well as the core .ini files, there are other things that may be translated.

Comcode pages

A Comcode page is a page like your front page that consists mostly of static text that doesn't have any particular pre-defined content structure. This is contrasted to a page that is generated from some other form of content like a news article or news archive. In the simplest case, a Comcode page is pure translatable text. In more complex cases it may have HTML and Comcode tags mixed in with the text.

When you click the "Edit this page" link beneath a Comcode page it will give you the choice of which language to edit. This is how you can edit the Comcode page text, such as the home page or an about-us page. Pages in another language will display the main version's text unless some changes have already been made for that language. Obviously any subsequent copy changes you make to the wording for a particular language, i.e. adding another sentence or paragraph, will need to be repeated for every language that you maintain a translation for (assuming you want to keep your translations consistent).

To translate a Comcode page manually copy the Comcode page .txt file (assuming you originally created it in English) from the pages/comcode_custom/EN directory, to the appropriate pages/comcode_custom/<lang> directory and then customise it.

HTML pages

As HTML pages are created outside Composr, you must manually copy the file in the equivalent way to as stated for Comcode pages.
Composr does not ship with any default HTML pages, so you only need to worry about HTML page translation if you actually made some pages.

Copy the page .htm file from the pages/html_custom/EN directory (assuming you originally created it in English), to the appropriate pages/html_custom/<lang> directory and then customise it.

Text files

There are some other text files you might want to translate are, in a similar way to Comcode pages (see above):
  • text/EN/quotes.txt
  • data/modules/cms_comcode_pages/EN/*.txt
And these files don't need translating but could be replaced with equivalents in your language:
  • text/EN/too_common_words.txt (a list of words that should not be considered in search results, for example)
  • text/EN/word_characters.txt (a list of characters that appear in words in your language – most languages have all the English characters, but also accented ones)

None of these files are very important, only translate them if you want to.


If you look under the themes/default/images/ directory you will see there is an EN directory that contains images with English text on. You can copy this to the ISO codename of your language pack (e.g. FR), and then replace individual images with the translated ones.

For example, we have themes/default/images/EN/chatcodeeditor/new_room.png. It is stored under "EN" because it contains some English text within the image. You could also have themes/default/images/FR/chatcodeeditor/new_room.png as the French version of this image.

Make sure you clear your theme image cache (Admin Zone > Tools > Website cleanup tools) after doing the substitution.

We have the PSD files (requires Adobe Photoshop or compatible software) for many of the images in our downloads database.

WYSIWYG editor

Composr uses a third-party WYSIWYG editor – CKEditor.
It has it's own translations which should automatically be linked to your own by the standard ISO language name.

Template/CSS editor

Composr uses a third-party code editor – a modified version of EditArea.
You need to make sure you have translated versions of all data/editarea/lang/<lang>.js files. There are quite a few translations already in there.

MySQL collations

MySQL has 'collations' which basically sets the MySQL character set. Composr does not handle these, it uses whatever is there.
This generally does not matter a lot (because anything that you ask to store will be correctly stored and retrieved regardless of collation), but there are two special cases:
  1. It does make a small difference in searches. For example, in languages there are usually 'equivalent' characters (e.g. lower case and upper case), and the MySQL collation tells MySQL about those.
  2. If the charset Composr is using is not matching up with what MySQL is using in terms of unicode vs non-unicode (e.g. MySQL uses UTF-8 but Composr uses ISO-8859-1) then conversion errors can happen as there are character code sequences that non-Unicode text might use which are totally invalid in Unicode and hence won't be stored at all. Users of English (who have limited alphabet that is all in lower ASCII and thus interchangeably compatible with both latin1 and UTF-8) would likely not notice this problem, but it becomes a problem for anyone doing internationalisation who have such a unicode vs non-unicode conflict.

Composr 10+ uses utf-8 tables by default and utf-8 internally, so none of this is an issue. It should work automatically, but you should still have a basic understanding of how collations work.

When Composr 9 or earlier installs, it will use latin1 (equivalent of ISO-8859-1) by default, because this is what the default English language pack uses. MySQL doesn't make it easy to convert the character set of the database, so the best way to do it is to export to an SQL dump, edit the dump in a text editor, and reimport into a new database:
  • Use phpMyAdmin to export all the tables to a .sql file on your computer; if it asks what character set to make the file, choose UTF-8
    • Make sure to not include multiple rows in each INSERT statement, as MySQL may not be able to reimport it on some servers (see the screenshot to the right for how to set this on phpMyAdmin, although it may vary from one version to another)
  • Do whatever you would normally do to backup your database; that will usually mean keeping a copy of the above file (but ensure it is complete before relying on it, sometimes SQL dumps don't download correctly)
  • Use a text editor to replace all instances of latin1 with utf8 in the file (note that it is utf8 not utf-8 – MySQL doesn't want hyphens in its codenames)
  • Save the edited file
  • Use phpMyAdmin to drop all tables in your database
  • Use phpMyAdmin to import the edited file

GD fonts

If you find that the vertical text shown on permission editing interfaces is incorrect, it may be due to gaps within the Bitstream fonts that Composr bundles and uses for the server-side generated vertical-text images.
This is known to happen with Russian characters. The solution is to upload Courier New Bold Italic.ttf from your own computer to data_custom/fonts/Courier New Bold Italic.ttf. We would distribute this file with Composr, except we don't have a license to; however if you have a copy of Windows or Mac OS you should have your own licensed copy of this file.

This issue is less relevant as it once was, as modern web browsers can render vertical text directly.


language string
A piece of text, often a phrase, used by Composr; identified by a short code WRITTEN_LIKE_THIS
character set
A set of characters that the one-byte-per-character representation system ties to; used to allow more than 255 characters to be represented on computers so that they may show many different language scripts
An encoding scheme for multi-byte characters, supporting multiple languages together without any need for special character sets.
The translation platform we use to translate Composr
A character scheme within the database, used for interpreting the basic grammatical construct of text, as well as the character set
The process of making software work well in different international settings. It includes multiple aspects, such as time-zones, date formats, and language translations.

Composr Tutorial: Changing the site language

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 (British) as standard. Any other languages will need new language files downloading.

(If you have a web designer such as ocProducts, 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 were 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 bundle all current translation on Transifex into language packs, distributed as addons. These are available in the addon directory.

Direct from Transifex

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

To download and install the Transifex translations you can follow the following step by step process:
  1. Make a lang_custom/<langcode> folder on your web hosting. The <langcode> is the upper-case version of the ISO code for the language. For example, Spanish is ES and German is DE.
  2. Go to the ocProducts organisation on Transifex.
  3. Register as a Transifex user if you do not already have an account, or log in.
  4. Choose the version of Composr you have installed (if you're not sure, it will say on the front page of the Admin Zone). Transifex calls this the 'project'.
  5. Choose your language.
  6. For each resource in the project, you need to download it individually. You'll be delivered a .ini file. These resources correspond to language files in Composr.
  7. Copy all the .ini files into the folder you created earlier.
  8. If you want your new language to by the default, log into http://yourbaseurl/config_editor.php and change the default language. This is discussed in more detail in the next section.

Turning on a different language

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

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, Google provide some code for Google Translate 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.

Composr Tutorial: Translating Composr content

Written by Chris Graham, ocProducts
Composr can have its content translated and delivered for each language, without requiring any duplication.

This is a very advanced feature that only a very small proportion of users will want. It is intended for large websites produced by tightly-managed sites that have an active team of human translators.

Composr's multi-language support is available when all the following conditions are met:
  1. you have more than one language installed
  2. you have the Conversr "Enable regionalisation" option enabled
  3. you either installed initially with it on, or you have run the Commandr command to enable it

Pros and Cons

  • Support your content in multiple languages from a single website and content repository

  • Requires active translator(s)
  • Makes development more complex, the translate table must be used for all content strings
  • Makes hand-editing the database much harder
  • May slow website searching
  • All sites on a Composr multi-site-network must have the same multi-lang-content status (i.e. all have it, or all not have it).

In short: Use it if you need it, and prepare for the extra cost and complexity. It's an ideal feature for those that need it.

Commandr command

The Commandr command may take some time to run. It is advised you therefore run the SSH version of Commandr, rather than the webapp. Log into SSH on your server (or equivalent process to receive a command prompt) and type:


php data/commandr.php
(assumes you run it from the Composr base directory, and that the 'php' command is in your path)

Then the Commandr command required is:


:require_code('database_multi_lang_conv'); enable_content_translation();

Depending on the size of your database, the command could take hours to run. You can monitor it progress through tables via MySQL (SHOW FULL PROCESSLIST).

Language choice for CMS actions

To understand what the content translation can do, and how it works, we need to consider the following cases:
  1. Sending newsletters
  2. Editing theme images
  3. Editing Comcode pages
  4. Using the Zone Editor
  5. Content translation (described in the next section)

For '1' (newsletters), you will get a choice what language to send it for when you go to the newsletter module. Subscribers choose their language when they sign up.

Similarly, for '2'-'4', you will get a choice of language which to edit under when you go to the respective section of Composr. What you save will be saved accordingly.

You will notice when you choose your language you will temporarily see the website in the language you are working under, until you finish.

Content translation

Content added to Composr is initially saved against the language being used by the submitter. Therefore, when adding content you must ensure you have the right language choice for what you want the default content language to be; a good rule of thumb to check this is by seeing if the language Composr is uses in its interface matches the language you expect to be submitting content in.

When editing content, the content is always saved against the language you see it in when you are editing – if it has been translated already then the edit will be saved to your selected language, but otherwise it will stay in the original submitted language when saved (i.e. saving will not save it as a translation for the language you are viewing). Never translate from an edit screen: if something is edited (so long as there were actual changes), all translations are automatically marked 'broken', and will be put back into the translation queue (because Composr doesn't know you haven't made other changes beyond just translating).

Content translation is primarily performed in a special 'Translate content' part of the Admin Zone (Admin Zone > Style > Translate website content).

You will see there is also an option in the footer for opening up a 'Translate content' screen just with language strings (the user content kind) that were included on the page you are viewing. This is a nice feature if the main translation queue is to full to realistically deal with and you just want new content to get translated.

In Composr almost everything (*) can be translated, but obviously you would not want to translate every forum post for a large community (for example). For this reason, Composr saves language with 'priorities', and that of the highest priority will be presented for translation first. For example, the names of zones would be the highest priority, whilst forum posts would be the lowest.

(*) A few things cannot be translated such as forum names. The reasoning is that you do not want such things translated, but rather you should have a different copy of each forum for each language. This is an exceptional situation, and is only designed like this due to the way forums are used. Other kinds of category may be translated as described above.

Allowing guests to choose language

You will want a way to be able to give your site visitors the option to view your website in their choice of language. You can easily achieve this by adding a ready made block on one of the side panels (assuming your web designer has not done this already – if you are an ocProducts client and have discussed internationalisation, it almost certainly is already built into your web design). The code for this is:


Any content which has not been translated yet will display in the original language it was written in. For example, a news post will display in English if that's how it was originally written.

View all


There have been no trackbacks yet