Repository navigation
i18n: add Arabic (ar-SA) UI locale with RTL support - #376
Open
muhannadalhariri wants to merge 1 commit into
Open
muhannadalhariri wants to merge 1 commit into
muhannadalhariri wants to merge 1 commit into
Conversation
Add Modern Standard Arabic (ar-SA) as a selectable UI language alongside
the existing zh-CN, en-US and ru-RU locales.
- web/static/i18n/ar-SA.json: new Arabic locale (4272 leaf strings,
full key/placeholder parity with en-US). The `c2` and `webshell`
sections are intentionally omitted and fall back to English via the
i18next fallback chain (ar-SA -> en-US -> zh-CN).
- web/static/js/i18n.js: register ar-SA, detect `ar*` navigator language,
preload en-US as fallback, set document dir="rtl" for Arabic, and add
the ar-SA language label handling.
- web/static/i18n/{zh-CN,en-US,ru-RU}.json: add the `lang.arSA` label.
- web/templates/{index,api-docs}.html: add the العربية option to the
language dropdown.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Modern Standard Arabic (
ar-SA) as a selectable UI language, alongside the existingzh-CN,en-USandru-RUlocales. This is the UI counterpart to the docs translation in #375.Arabic is the first right-to-left locale, so this PR also introduces RTL document-direction handling in the i18n layer.
What's included
web/static/i18n/ar-SA.json— new Arabic locale, 4272 leaf strings, with full key and placeholder ({{…}}) parity againsten-US. Register: فصحى / MSA.web/static/js/i18n.jsar-SAand detects thear*navigator language on first visit;en-USas a fallback bundle when Arabic is active;document.documentElement.dir = "rtl"for Arabic (and"ltr"otherwise) via a newapplyDirection()helper, called on init and on every language switch;ar-SAbranch to the language-label updater anduiLocale().ar-SA → en-US → zh-CN.web/static/i18n/{zh-CN,en-US,ru-RU}.json— add thelang.arSA("العربية") label so the new option is named correctly in every existing locale.web/templates/{index,api-docs}.html— add the العربية option to the language dropdown.Terminology
Technical and brand terms are kept verbatim (not transliterated): CyberStrikeAI, MCP, C2, WebShell, SQLite, Go, OpenAPI, Eino, RBAC, FOFA, i18next, the messaging-platform names (WeChat/iLink, WeCom, DingTalk, Lark, Telegram, Slack, Discord, QQ), all config keys, placeholders, code snippets, URLs, and
{{…}}interpolation variables. A consistent glossary was applied across the file (e.g. Agent → الوكيل، Multi-Agent → تعدّد الوكلاء، Workflow → سير العمل، Dashboard → لوحة التحكّم، Knowledge Base → قاعدة المعرفة، HITL → التدخّل البشري).Note on the
c2/webshellsectionsThe
c2andwebshellstring groups are intentionally omitted fromar-SA.jsonand fall back to English through the i18next fallback chain. An automated content safeguard in the translation tooling repeatedly blocked machine-translation of those two offensive-tooling sections, so rather than ship a partial or low-quality rendering they are left to render in English. The UI remains fully functional for Arabic users — those two panels simply display their English labels. They can be filled in later by a human translator in a follow-up.Validation
ar-SA.jsonis valid JSON (UTF-8, real Arabic characters).en-US(excluding the two deferred sections): 0 missing, 0 extra keys.i18n.jspassesnode --check.🤖 Generated with Claude Code