Setting up multiple languages in Bitrix24 Self-hosted

Yana Prokopets
Oct 26, 2015
Last updated: Dec 3, 2018
Often our users need to have multiple languages in own Bitrix24 self-hosted version. This post will describe the nuances and options available in the Bitrix platform, as well as set forth a few examples.

To start, let’s determine what phrases are truly parts of the product’s source code and which are not. Everything that you can see is either content (static or dynamic) or product phrases. In the image below, the highlighted sections are content. Everything else is source (and thus will be listed in the translation).

3160f95a97d51f7243a3a5d38050e60b.png

Non-highlighted phrases are the source code.

Product phrases

Bitrix24’s self-hosted versions are provided in 3 languages: English, German, and Russian (available English-German, English-Russian, English) Our partners provide and support other localizations of the product in other languages.

To have your start working with one of the localizations, you need to add a new language to the system and upload the translation packet through updates (documentation).

If you need a different language (one not listed) then you will need to create a new language in the system and perform the translation yourself. Here are the details of how to do that:

Managing interface languages & Integration.

About content

Content has no relationship to the Bitrix product distribution kit, its localizations, additional languages, etc. That is, content can be entered into the site in one, or any number of, languages.

What else do you need to know

The front end of Bitrix products, naturally, is what can be seen by visitors to the site or intranet. The back end (Control Panel) is a special area containing the system administration interface.

The back end (which includes the top panel shown below) has a ‘switch’ to let you change languages in the back end of the product for the given user.

d44d5da28b9e604d1a2b00df30d20bdb.png
The various mechanisms, including the soft buttons, that allow changing languages in the front end are not part of the product’s regular configuration. An example of one way to add language buttons is set out below.

Language switch in the front end

Let’s look at one way to put in a language switch in the front end. This switch will change the language displayed in system phrases of the product only in the front end. Each user can choose the language for himself or herself.

57215b8f0801c956aa456f6a78f887d6.png
1. Add the following code to the /bitrix/php_interface/dbconn.php file:

<?
if(isset($_GET["user_lang"]))
{
      setcookie("USER_LANG", $_GET["user_lang"], time()+9999999, "/");
      define("LANGUAGE_ID", $_GET["user_lang"]);
}
elseif(isset($_COOKIE["USER_LANG"]))
{
      define("LANGUAGE_ID", $_COOKIE["USER_LANG"]);
}
?>
2. In the section, the header (/bitrix/templates/