localization
Skill4 starsChanged 4 months agoMITView on GitHub
Localize 1C-Bitrix code with the D7 `Loc::getMessage` API and language files — message codes, module versus component lang directories (`lang/ru`, `lang/en`), parameter substitution, and plural forms — instead of hard-coded strings. Use when the user needs to create or place Bitrix language files and asks where they go (`lang/ru`, `lang/en`) and how the path mirrors the source file for a module or component; пользователь подставляет значения в локализованное сообщение (`#PARAM#`) или обрабатывает множественные формы в Битрикс и спрашивает, как передать параметры в `Loc::getMessage()`; the user needs to output a translatable, user-facing string in Bitrix code and asks how to use `Loc::getMessage()` and a message code instead of a literal. Keywords: bitrix, localization, loc, getmessage, lang, i18n, d7, legacy, битрикс, локализация, язык.
21 other projects use a version of this.
Adopted by
Most recently taken up by
- parker-brown-family/agent-skillstheir own version, first seen Nov 8, 2026
- ghuntley/loomtheir own version, first seen Nov 1, 2026
- jame581/GodotPromptertheir own version, first seen Oct 21, 2026
- PhoenixNest/AGENT-GLOBAL-BASEtheir own version, first seen Oct 20, 2026
- glrodasz/dotfilestheir own version, first seen Oct 17, 2026
- caglarbaranbora/Apple-Agent-Kittheir own version, first seen Oct 13, 2026
Used with
Projects with it also use ab-test-store-listing, app-analytics and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
appeekySkillab-test-store-listing
When the user wants to A/B test App Store product page elements to improve conversion rate. Also use when the user mentions "A/B test", "product page optimization", "test my screenshots", "test my icon", "conversion rate optimization", "CPP", or "custom product pages". For screenshot design, see screenshot-optimization. For metadata optimization, see metadata-optimization.
Also in 3 projects that use this
appeekySkillapp-analytics
When the user wants to set up, interpret, or improve their app analytics and tracking. Also use when the user mentions "analytics", "tracking", "metrics", "KPIs", "App Store Connect analytics", "install tracking", "funnel", "attribution", or "how is my app performing". For A/B testing, see ab-test-store-listing. For retention metrics, see retention-optimization.
Also in 3 projects that use this
- +10 more from appeeky
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- chen08209/FlClash★ 62ksame name
- appeeky/aso-skills★ 2.2ksame name
- Eronred/aso-skills★ 2.2ksame name
- ghuntley/loom★ 1.7ksame name
- igorescodro/alkaa★ 1.6ksame name
- jame581/GodotPrompter★ 870same name
- bagofwords1/bagofwords★ 463same name
- CamilleScholtz/swmpc★ 239same name
- everpcpc/KMReader★ 118same name
- glrodasz/dotfiles★ 20same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository119 other files it gives its agents.
- strategy-bitrix-d7-incrementalSkill
- strategy-explicit-over-magicSkill
- strategy-framework-conventionsSkill
- strategy-legacy-safe-editsSkill
- strategy-minimal-diffSkill
- strategy-no-untested-refactorSkill
- strategy-preserve-public-apiSkill
- strategy-readonly-immutabilitySkill
- strategy-security-firstSkill
- strategy-test-drivenSkill
- openapiSkill
- paginationSkill
- rest-designSkill
- versioningSkill
- cqrsSkill
- dependency-inversionSkill
- hexagonalSkill
- repository-patternSkill
- service-layerSkill
- bitrixSkill
- findings-reportSkill
- laravelSkill
- performanceSkill
- phpSkill
- project-analysisSkill
- refactoringSkill
- roi-prioritizationSkill
- securitySkill
- stack-detectionSkill
- cache-layersSkill
- component-engineSkill
- d7-eventsSkill
- d7-loaderSkill
- d7-orm-queriesSkill
- iblock-elementsSkill
- kernel-main-moduleSkill
- controllersSkill
- ormSkill
- validationSkill
- controllersSkill
- query-builderSkill
- routingSkill
- autoload-psr4Skill
- dependency-managementSkill
- scriptsSkill
- connection-poolingSkill
- mysql-indexingSkill
- redisSkill
- transactionsSkill
- ci-github-actionsSkill
- deployment-strategiesSkill
- docker-phpSkill
- env-configSkill
- associationsSkill
- entities-mappingSkill
- orm-basicsSkill
- entity-apiSkill
- module-developmentSkill
- routing-controllersSkill
- formsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
Do not use this skill for translating stored content (iblock elements per site or language).
- Very specific: line 73
Do not use this skill on a non-Bitrix PHP app.
- Very specific: line 93
Create lang/ru/<file>.php and lang/en/<file>.php next to the source file, each returning $MESS['VENDOR_MODULE_HELLO'] = '...'.
- Very specific: line 102
Place each message file at a path that mirrors the calling file under lang/<lang-code>/ (e.g
- Distinctive: line 146
Not applicable — no I/O, auth, or untrusted input.
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- generated: do not edit — source: knowledge/atoms/bitrix/localization/ --><!-- schema: atomVersion=3 skillVersion=2 graphVersion=1 --><!-- compile: @php-skills/compiler v1.0.0 (deterministic build) -->Bitrix Localization
When to use
- The user needs to create or place Bitrix language files and asks where they go
(
lang/ru,lang/en) and how the path mirrors the source file for a module or component. - Пользователь подставляет значения в локализованное сообщение (
#PARAM#) или обрабатывает множественные формы в Битрикс и спрашивает, как передать параметры вLoc::getMessage(). - The user needs to output a translatable, user-facing string in Bitrix code and
asks how to use
Loc::getMessage()and a message code instead of a literal.
When NOT to use
- Do not use this skill for translating stored content (iblock elements per site
or language); that is modelled with multi-site/multi-language content, not
Loc::getMessagelang files. - Do not use this skill on a non-Bitrix PHP app;
Loc::getMessage, the lang-file layout, andIncludeModuleLangFileare Bitrix-specific.
Core guidance
- Keep user-facing text in lang files, not inline — Move every user-facing phrase into a lang file keyed by a message code and
reference it through
Loc::getMessage; do not hard-code display strings in PHP, templates, or components. - Pass dynamic values as named parameters — Put placeholders like
#COUNT#in the message text and pass values as the secondgetMessageargument (['#COUNT#' => $n]) instead of concatenating strings around a fragment. - Prefer Loc::getMessage over legacy GetMessage — In new code, call
\Bitrix\Main\Localization\Loc::getMessage('CODE')(afterLoc::loadMessages(__FILE__)where needed) instead of the legacy globalGetMessage('CODE').
Quick recipe
- At the top of the PHP file add
use Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__);, then output the text withLoc::getMessage('VENDOR_MODULE_HELLO'). (verify: The code compiles and getMessage returns a value once the lang file exists.) - Create
lang/ru/<file>.phpandlang/en/<file>.phpnext to the source file, each returning$MESS['VENDOR_MODULE_HELLO'] = '...';for that language. (verify: Each language directory has a message file with the same code.) - For dynamic text, write
$MESS['VENDOR_MODULE_FOUND'] = 'Found #COUNT# items';and callLoc::getMessage('VENDOR_MODULE_FOUND', ['#COUNT#' => $count]);. (verify: The placeholder is replaced by the value in the rendered output.)
Best practices
- Give message codes a stable, prefixed, uppercase name tied to the module or component (e.g
- Place each message file at a path that mirrors the calling file under
lang/<lang-code>/(e.g - In module code call
Loc::loadMessages(__FILE__)once per file (or the legacyIncludeModuleLangFile(__FILE__)) before reading messages, rather than assuming another file already loaded them
Anti-patterns
| Anti-pattern | Why it fails | Do instead |
| Concatenating translated fragments | Word order and grammar differ per language, so gluing fragments produces broken translations. | Use one message with placeholders (Found #COUNT# items) and pass values via the<br>parameters array so translators control the whole sentence. |
| Reusing generic, unprefixed message codes | Generic codes collide when message sets merge, so an unrelated phrase can silently override yours. | Prefix codes with the module/component namespace and keep them unique<br>(VENDOR_CATALOG_TITLE), so no two files clash. |
| Hard-coding display text in templates | Inline literals cannot be translated per language and bypass the message-code catalog. | Replace the literal with a Loc::getMessage('CODE') call and add the phrase to<br>each language's lang file. |
See references/anti-patterns.md.
Common mistakes
- Lang file encoding not matching the site — Saving a lang file in an encoding that differs from the site's charset (UTF-8 vs windows-1251) renders Cyrillic and other non-ASCII text as mojibake. Fix: Save every lang file in the site's charset (UTF-8 on modern installs) and keep all languages consistent with the core encoding.
- Adding a code to one language only — Adding a message code to
lang/rubut notlang/en(or vice versa) makes the code render literally for every visitor on the missing language. Fix: Add each new code to every supported language directory at the same time, even if the initial value is a placeholder pending translation. - Calling getMessage without loading the file's messages — Calling
Loc::getMessage('CODE')without a priorLoc::loadMessages(__FILE__)(in entry points like AJAX handlers, agents, or CLI) returns the raw code string instead of the translation. Fix: CallLoc::loadMessages(__FILE__)once near the top of every file that reads messages, especially standalone entry points. - Lang file path not mirroring the source file — Putting the lang file at a path that does not mirror the calling file (wrong
directory or wrong filename under
lang/<code>/) makes Bitrix fail to find the messages, so codes render literally. Fix: Place the lang file at the exact mirrored path (same subdirectories and filename) under eachlang/<lang-code>/, matching the file that calls getMessage.
Version notes
- Loc supersedes the global GetMessage on modern cores — The D7
\Bitrix\Main\Localization\Locclass (getMessage,loadMessages) is the current API; the globalGetMessage()andIncludeModuleLangFile()remain as legacy helpers over the same lang files for older code. - PHP support tracks the Bitrix core version — Modern Bitrix cores run the localization API on PHP 7.4 through 8.2; the API and lang-file format were not certified past 8.2 at the time of writing, so avoid relying on PHP 8.3+ syntax in localized code.
Security
- Not applicable — no I/O, auth, or untrusted input.
Testing
- Activation and decision behavior are verified in
eval/scenarios/bitrix/localization.yaml.
Additional resources
- references/anti-patterns.md
- references/core.md
- references/examples.md
- references/pitfalls.md
- references/recipes.md
- references/version-differences.md
Knowledge graph
Prerequisites: bitrix/kernel-main-module
<!-- graph-fragment: graph/fragments/bitrix/localization.yaml -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

