Feature request: Arabic (ar) locale with full RTL support
Arabic summary / ملخص بالعربية
التطبيق يدعم حالياً English و zh-CN فقط عبر نظام التدويل الموجود (lib/i18n). هذا الطلب يضيف حزمة لغة عربية كاملة (أكثر من 640 مفتاح ترجمة مطابقة لمفاتيح en.ts) مع دعم كامل لاتجاه RTL (من اليمين إلى اليسار)، وقد جهّزت واختُبرت على ويندوز (Edge/WebView2 + متصفح).
Proposed scope
- New locale file: lib/i18n/messages/ar.ts — full professional Arabic translation mirroring every key in en.ts (642 keys), preserving {placeholder} interpolation.
- Registry/type plumbing (additive, small):
- lib/i18n/types.ts: Locale = "en" | "zh-CN" | "ar"
- lib/i18n/registry.ts: register arLocale + browser-locale resolution for ar*
- hooks/useI18n.tsx: accept stored "ar", and set document.documentElement.dir = rtl for Arabic (ltr otherwise)
- RTL support:
- app/rtl.css (new layer imported after native-theme.css): Arabic font stack (Segoe UI / Tahoma / Noto Sans Arabic), mirrored drawer animations, segmented-control thumb flip, plaintext bidi for chat/markdown, LTR isolation for pre/code/terminal/diff/mermaid, RTL-safe form fields.
- Converted physical CSS properties (margin/padding/border-left/right, left/right, text-align) in app/globals.css + app/native-theme.css to logical equivalents (-inline-start/end) so the whole chrome mirrors automatically and stays identical in LTR.
- Language choice is remembered (existing pi-locale pref) and the existing Settings language picker lists the new locale automatically (registry-driven).
- Minor string fixes: several raw English strings (aria-labels, headers, placeholders in Models/Plugins/Skills/TabBar/window controls) routed through i18n with keys added to both en.ts and ar.ts.
Notes for maintainers
- The changes are additive and only active when dir="rtl"; the English/zh-CN UI is unchanged.
- Branding / fork-ownership rules and tests are untouched.
- Happy to open a Pull Request with this work if the maintainers are interested.
Feature request: Arabic (ar) locale with full RTL support
Arabic summary / ملخص بالعربية
التطبيق يدعم حالياً English و zh-CN فقط عبر نظام التدويل الموجود (lib/i18n). هذا الطلب يضيف حزمة لغة عربية كاملة (أكثر من 640 مفتاح ترجمة مطابقة لمفاتيح en.ts) مع دعم كامل لاتجاه RTL (من اليمين إلى اليسار)، وقد جهّزت واختُبرت على ويندوز (Edge/WebView2 + متصفح).
Proposed scope
Notes for maintainers