Skip to content

i18n: add Arabic (ar-SA) UI locale with RTL support - #376

Open
muhannadalhariri wants to merge 1 commit into
AIPentest:mainfrom
muhannadalhariri:i18n/ar-SA-ui
Open

muhannadalhariri wants to merge 1 commit into
AIPentest:mainfrom
muhannadalhariri:i18n/ar-SA-ui

Conversation

@muhannadalhariri

Copy link
Copy Markdown

Summary

Adds Modern Standard Arabic (ar-SA) as a selectable UI language, alongside the existing zh-CN, en-US and ru-RU locales. 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 against en-US. Register: فصحى / MSA.
  • web/static/js/i18n.js
    • registers ar-SA and detects the ar* navigator language on first visit;
    • preloads en-US as a fallback bundle when Arabic is active;
    • sets document.documentElement.dir = "rtl" for Arabic (and "ltr" otherwise) via a new applyDirection() helper, called on init and on every language switch;
    • adds the ar-SA branch to the language-label updater and uiLocale().
    • fallback chain configured as ar-SA → en-US → zh-CN.
  • web/static/i18n/{zh-CN,en-US,ru-RU}.json — add the lang.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 / webshell sections

The c2 and webshell string groups are intentionally omitted from ar-SA.json and 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.json is valid JSON (UTF-8, real Arabic characters).
  • Recursive key parity vs. en-US (excluding the two deferred sections): 0 missing, 0 extra keys.
  • Placeholder parity: 0 mismatches across all 4272 leaves.
  • The 3 edited label files are valid JSON; i18n.js passes node --check.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant