Localization of the Block
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Block localization defines translations for the interface labels a user sees in the site editor: the block name, and the names of nodes, cards, attribute fields, and menu items. Translations are described in the manifest file through the lang_original and lang keys.
Localization is intended for custom blocks that an application adds to the repository using the landing.repo.register method. A typical case is a Market application with its own blocks, installed in Bitrix24 accounts with different interface languages. System blocks of Bitrix24 are translated through the product language files and do not use the lang_original and lang keys.
Two clarifications about the scope:
- localization does not translate block content. The text, links, and images a user has entered in a block on a page are stored in the content and remain in the original language
- the
lang_originalandlangkeys with the same names also exist for custom site templates, but that is a separate mechanism with a different set of translatable fields. It is described in the Template Localization article
How to Add Localization
- Build the block manifest in one language.
- Pass the code of that language in
lang_original. - Build the
langarray: for each language, list the original manifest phrases and their translations. - Register the block using the landing.repo.register method, passing
lang_originalandlangin themanifestparameter. - Add the block to a page and call landing.block.getmanifest. In the response, the
namevalues must arrive in the Bitrix24 language, thelangkey must be absent, andlang_originalmust be retained as it was.
Localization Keys in the Manifest
lang_original— the original language of the phrases in the manifest, for exampleenlang— the set of translations by language
The language code matches the Bitrix24 language code. The current language is returned by the app.info method in the LANGUAGE_ID field.
In the lang array, the keys are the original phrases from the manifest, and the values are the translations of those phrases.
Example:
'lang_original' => 'en',
'lang' => [
'de' => [
'Title with a separator on a light background' => 'Titel mit Trennlinie auf hellem Hintergrund',
'Button' => 'Schaltflache',
],
'fr' => [
'Title with a separator on a light background' => 'Titre avec separateur sur fond clair',
'Button' => 'Bouton',
],
],
Which Labels Are Translated
The system iterates through the entire manifest and substitutes values only for name keys at any nesting level. Other keys are not translated, even if lang contains a matching phrase.
The name keys that occur in a manifest:
|
Manifest Key |
What This Label Is |
|
|
The block name in the block catalog and in the repository list |
|
|
The node name in the block editing form |
|
|
The name of a card group |
|
|
The card preset name in the list |
|
|
The element label in the style panel, if it is set through the |
|
|
The attribute field name in the editor. For a group element — the name of the group itself |
|
|
The name of a field inside an attribute group |
|
|
The option label in list attribute types: |
|
|
The name of an attribute field displayed in the design form |
|
|
The name of an attribute field defined separately for a card |
|
|
The menu name in the interface |
|
|
The node name inside a menu item |
The table lists the places where the name key occurs in a typical manifest. The rule is broader than the table: any name key at any nesting level is translated, so review your own manifest in full.
Not translated:
block.description— the block descriptionstyle.nodes.<selector>.title— the element label in the style panel, set through thetitlekey- attribute service fields:
placeholder,title,stubText - the
valueentries initemslists - selectors, section codes, node types, and style types
In the manifest example, labels in style.nodes are set sometimes through the name key and sometimes through title. If such a label needs to be translated, set it through the name key.
An example of a manifest with labels that will be translated:
$manifest = [
'block' => [
'name' => 'Title with a separator',
'section' => ['text'],
],
'nodes' => [
'.landing-block-node-title' => [
'name' => 'Title',
'type' => 'text',
],
],
'lang_original' => 'en',
'lang' => [
'de' => [
'Title with a separator' => 'Titel mit Trennlinie',
'Title' => 'Uberschrift',
],
],
];
How the System Selects a Translation
The system selects a single language branch from the lang array and applies it to the entire manifest:
- It determines the Bitrix24 language. For the
ru,kz,by, anduzlanguages, therubranch is used. - If a branch with that code exists in
lang, it takes the translations from it. - If there is no such branch and
lang_originaldiffers from the Bitrix24 language, it takes the translations from theenbranch. - If no suitable branch exists, it retains the original phrases of the manifest.
Within the selected branch, a translation is substituted only for the phrases present in it as keys. Phrases without a translation remain in the lang_original language.
Which Methods Return a Translated Manifest
|
Method |
What It Returns |
|
The manifest of a block placed on a page, with translations already substituted. The |
|
|
The original block manifest without translation substitution, together with the |
|
|
The list of repository blocks, where only the block name is translated. Other labels are not part of this response |
To see the translations, call landing.block.getmanifest for a block that has already been added to a page. The substitution language is set by the Bitrix24 language, not by a method parameter.
In the response of this method, check the following:
- the
namevalues inblock,nodes,cards,attrs, andmenu— they must be in the Bitrix24 language - the
langkey — it is absent from the response, the system removes it after substituting the translations - the
lang_originalkey — it is retained exactly as it was passed during registration
If the name values arrive in the original language, compare the phrase keys in lang with the manifest strings, and check whether lang contains a branch for the Bitrix24 language or an en branch.
Permissions and Limitations
Scope:
landingWho can execute the methods: depending on the method
Localization itself has no dedicated access permissions. Permissions are checked at the level of the methods that register a block and read a manifest, and they are listed on the pages of those methods.
Limitations of localization:
- only the value of the
namekey is translated - the translation key is the exact string from the manifest, including case, spaces, and punctuation
- a single phrase is translated the same way everywhere in the manifest, and a separate translation for a specific selector cannot be set
- branch codes in
langare limited to the codes of languages available in Bitrix24. A branch with a code that is not among the interface languages will not be selected
What to Consider
- Set
lang_originalto the language the phrases are actually written in. If the value does not match the actual language, the fallbackenbranch will not work. - Provide the same set of keys in all language branches so that the interface does not mix languages.
- Distinguish labels with different meanings already in the original language. For example, instead of two labels reading "Name", use "Block name" and "Button name".
- Create a separate
enbranch even if the main language of the block is different. It is used as a fallback for languages without their own translation.