Skip to content

Feature Request: Native Arabic Support (Localization + RTL) #2781

@bigdizaya

Description

@bigdizaya

Hello Chainlit Team,
I have been using Chainlit for a project and I noticed that while automatic language detection is supported, Arabic (ar-SA) is currently missing.
I would like to propose adding native support for Arabic. Since this involves both translation and Right-to-Left (RTL) layout handling, here is how I suggest implementing it:

  1. Localization (Translation)
    I can contribute the ar-SA.json file in the translations directory, covering all UI keys (Settings, API Keys, Chat Input, etc.).
  2. RTL Support (The Critical Part)
    Since Arabic is an RTL language, simply translating the text isn't enough; the layout needs to flip.
    • Detection: The app should detect when ar-SA is the active locale.
    • Implementation: We can dynamically apply dir="rtl" to the root element or the MUI theme when Arabic is detected.
    • CSS/MUI: Ensure that margins/paddings use logical properties (e.g., margin-inline-start instead of margin-left) or let the MUI rtl plugin handle the flip.
    Why this matters:
    This would greatly improve accessibility for Arabic-speaking users and open Chainlit to a large demographic in the MENA region.
    I am willing to open a Pull Request for the translation file. Could you provide guidance on where the RTL logic hooks are currently located in the codebase?
    Best regards,
    bigdizaya

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions