openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Add Urdu language support with strict LTR directionality for README and app UI

Open AMIK-coorporations opened this issue 6 months ago • 5 comments

Add Urdu language support with strict LTR directionality for README and app UI

Summary

Introduce Urdu language support from scratch across the GitHub README and application UI, with all Urdu text rendered strictly in Left-to-Right (LTR) directionality as a non-negotiable design requirement.

Problem

Urdu is not currently supported in the codebase, documentation, or UI. Users who need Urdu content cannot view or interact with the product in their preferred language. Additionally, standard Urdu rendering defaults to RTL, which conflicts with our layout system. We need a new integration that adds Urdu language assets and enforces LTR display—without requiring the requester to implement code. Constraints: web and mobile platforms, no impact on existing locale pipelines, and performance-neutral font loading.

Solution (optional)

The implementing team will:

  • Add Urdu language files (translations, locale config) to the project.
  • Integrate a Unicode-compliant Urdu font that supports LTR glyph shaping.
  • Apply strict LTR directionality (dir="ltr", direction: ltr;) to all Urdu-rendering components and README sections.
  • Ensure the build pipeline, i18n framework, and CI checks accommodate the new locale without breaking existing flows.
  • Scope: App UI + GitHub README. Tradeoff: LTR Urdu is non-standard linguistically but required for visual consistency.

Acceptance criteria

  • [ ] Urdu locale added — New ur (or ur-PK) locale files are integrated into the i18n system and load without errors.
  • [ ] README Urdu section renders LTR — GitHub README displays Urdu text flowing left-to-right with correct punctuation placement, using only markdown/HTML/CSS no-code changes from the requester.
  • [ ] App UI supports Urdu in LTR — All UI surfaces that display Urdu text enforce LTR directionality and use a legible Urdu-capable font.
  • [ ] No RTL fallback or auto-detection — Urdu content never switches to RTL based on browser, OS, or locale settings.
  • [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by .github/workflows/pr-ci.yml).

Related

  • i18n Architecture Documentation
  • Font Loading Strategy for Non-Latin Scripts
  • Design Spec: LTR-Only Script Rendering

AMIK-coorporations avatar May 31 '26 20:05 AMIK-coorporations

Blocker: the strict-LTR requirement conflicts with correct Urdu rendering (and with what's already shipped)

Before implementing, one acceptance criterion needs a decision because it's linguistically incorrect and contradicts existing behavior in the repo.

Urdu is an inherently right-to-left script. It's cursive and joins right-to-left; forcing dir="ltr" / direction: ltr; reverses word and punctuation order and makes the text effectively unreadable to a native speaker. "LTR Urdu" isn't a stylistic variant — it's broken text.

The README part is already done, and it's RTL. docs/README.ur-pk.md already exists and is linked from the top-level README.md. It renders Urdu prose in dir="rtl" blocks while keeping code/English in dir="ltr" blocks — the standard, correct bidirectional layout. The AC "README Urdu section renders LTR / No RTL fallback" would require us to regress that file into incorrect rendering.

The app i18n system also defaults new locales to LTR unless opted in. Direction is driven by an RTL_LOCALES set in app/src/lib/i18n/I18nContext.tsx; today only ar is in it. A new ur locale would need to be added there to render correctly. The AC asks us to deliberately leave it out.

So the request as written is internally consistent but produces unreadable Urdu. Two ways forward:

  1. Recommended — standard RTL Urdu. Keep the README as-is (already RTL) and register the app ur locale as RTL like ar. Linguistically correct; consistent with the existing Arabic locale. This does not satisfy the current LTR acceptance criteria, so those criteria would need to be updated.
  2. Literal — strict LTR. Flip the README Urdu blocks to dir="ltr" and register ur as an LTR locale. Satisfies the ACs exactly but ships visibly broken Urdu.

Could you confirm which direction you want? If there's a specific layout constraint driving the LTR requirement (e.g. a component that can't handle RTL), point me at it and I'll scope a fix for that instead of forcing the whole locale LTR.

Separately, scoping note for the app side: adding the ur locale means real Urdu translations for ~2,679 keys — CI enforces full key parity and rejects English placeholders in non-Latin-script locales, so there's no partial/stub path that passes. Happy to land the README/directionality decision first as a small PR and follow up with the full app locale.

YellowSnnowmann avatar Jul 06 '26 12:07 YellowSnnowmann

Status re-check on main (6be58a9ab) — half of this is already shipped, and shipped against two of the acceptance criteria

Re-measuring since the blocker above hasn't been answered. Current state:

README half — DONE, and done in RTL.

  • docs/README.ur-pk.md exists.
  • It is linked from the top-level README.md:41 in the language bar: 🇵🇰 <a href="./docs/README.ur-pk.md">اردو</a>.
  • It uses proper bidirectional markup — 7 dir="rtl" blocks (Urdu prose) and 8 dir="ltr" blocks (code, commands, English identifiers).

So AC 2 ("README Urdu section renders LTR") is not merely unimplemented — the repository already does the opposite, deliberately, and correctly. AC 4 ("no RTL fallback") is likewise contradicted by shipped content.

App-UI half — NOT done.

app/src/lib/i18n/ carries 14 locales — ar, bn, de, en, es, fr, hi, id, it, ko, pl, pt, ru, zh-CN — and there is no ur.ts. So AC 1 and AC 3 are genuinely open.

Worth noting ar.ts (Arabic) is already there: an RTL locale is a solved problem in this i18n system, which means the Urdu locale is ordinary work if it renders RTL, and a bespoke exception if it must render LTR.


This is blocked on one decision, and it is a small one

The issue can move the moment someone picks:

Option A — ship Urdu the way Arabic already ships (recommended). Add ur.ts alongside ar.ts, RTL. The README is already correct and needs no change. ACs 1 and 3 are satisfied as written; ACs 2 and 4 are dropped as linguistically incorrect. This is a normal-sized PR.

Option B — keep the strict-LTR requirement. Then this is not a localization task: it needs a bespoke LTR-Urdu rendering path that no other locale uses, and docs/README.ur-pk.md has to be rewritten to reverse the direction it currently ships with. Please say so explicitly, because it means deleting working, correct output.

I'd recommend A, for the reason in the earlier comment: forcing direction: ltr on a cursive right-to-left script reverses word and punctuation order and produces text a native reader cannot read. "Visual consistency" is the stated motivation, but ar.ts already establishes that this UI handles RTL without a consistency problem.

If nobody needs Option B, the cleanest move is to edit the issue to drop ACs 2 and 4 and retitle it something like "Add Urdu (ur-PK) app locale" — the README work is finished and only the locale file is outstanding. Happy to open that PR against the RTL reading; just confirm the direction.

No code change is possible under the current acceptance criteria, so leaving open and blocked on this decision.

YellowSnnowmann avatar Sep 11 '26 09:09 YellowSnnowmann

RTL URDU please sir

بتاریخ جمعہ، 11 ستمبر، 2026 2:09 PM YellowSnnowmann < @.***> نے لکھا:

YellowSnnowmann left a comment (tinyhumansai/openhuman#3083) https://github.com/tinyhumansai/openhuman/issues/3083#issuecomment-5632170081 Status re-check on main (6be58a9 https://github.com/tinyhumansai/openhuman/commit/6be58a9ab0f09790e9c025acdf4a9bde26e87aeb) — half of this is already shipped, and shipped against two of the acceptance criteria

Re-measuring since the blocker above hasn't been answered. Current state:

README half — DONE, and done in RTL.

  • docs/README.ur-pk.md exists.
  • It is linked from the top-level README.md:41 in the language bar: 🇵🇰 اردو.
  • It uses proper bidirectional markup — 7 dir="rtl" blocks (Urdu prose) and 8 dir="ltr" blocks (code, commands, English identifiers).

So AC 2 ("README Urdu section renders LTR") is not merely unimplemented — the repository already does the opposite, deliberately, and correctly. AC 4 ("no RTL fallback") is likewise contradicted by shipped content.

App-UI half — NOT done.

app/src/lib/i18n/ carries 14 locales — ar, bn, de, en, es, fr, hi, id, it, ko, pl, pt, ru, zh-CN — and there is no ur.ts. So AC 1 and AC 3 are genuinely open.

Worth noting ar.ts (Arabic) is already there: an RTL locale is a solved problem in this i18n system, which means the Urdu locale is ordinary work if it renders RTL, and a bespoke exception if it must render LTR.

This is blocked on one decision, and it is a small one

The issue can move the moment someone picks:

Option A — ship Urdu the way Arabic already ships (recommended). Add ur.ts alongside ar.ts, RTL. The README is already correct and needs no change. ACs 1 and 3 are satisfied as written; ACs 2 and 4 are dropped as linguistically incorrect. This is a normal-sized PR.

Option B — keep the strict-LTR requirement. Then this is not a localization task: it needs a bespoke LTR-Urdu rendering path that no other locale uses, and docs/README.ur-pk.md has to be rewritten to reverse the direction it currently ships with. Please say so explicitly, because it means deleting working, correct output.

I'd recommend A, for the reason in the earlier comment: forcing direction: ltr on a cursive right-to-left script reverses word and punctuation order and produces text a native reader cannot read. "Visual consistency" is the stated motivation, but ar.ts already establishes that this UI handles RTL without a consistency problem.

If nobody needs Option B, the cleanest move is to edit the issue to drop ACs 2 and 4 and retitle it something like "Add Urdu (ur-PK) app locale" — the README work is finished and only the locale file is outstanding. Happy to open that PR against the RTL reading; just confirm the direction.

No code change is possible under the current acceptance criteria, so leaving open and blocked on this decision.

— Reply to this email directly, view it on GitHub https://github.com/tinyhumansai/openhuman/issues/3083?email_source=notifications&email_token=BURBJ4JT3QZDOY6ZY3HRHMD5OO6MNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNRTGIYTOMBQHAY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5632170081, or unsubscribe https://github.com/notifications/unsubscribe-auth/BURBJ4OLV5VOKVP4C2PMI4L5OO6MNAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNRRGE3DGMJYGI5US43TOVSTWNBVGU4DSOBVGA2TPILWAI . You are receiving this because you authored the thread.Message ID: @.***>

AMIK-coorporations avatar Sep 12 '26 08:09 AMIK-coorporations

Triage: needs opinion — “Add Urdu language support with strict LTR directionality for README and app UI” needs a maintainer decision on product scope/priority or fresh reproduction evidence before its status can be settled. Please advise whether to pursue, narrow, or close it.

senamakel avatar Oct 09 '26 17:10 senamakel

Thanks for confirming you'd like right-to-left Urdu. That matches what's already in place: the Urdu README (docs/README.ur-pk.md) is published in RTL and linked from the main README.

The app itself doesn't have an Urdu translation yet. The app's RTL support currently covers Arabic, so adding Urdu would mean a new ur locale plus adding it to the RTL list. We're narrowing this issue to that, and contributions are welcome.

M3gA-Mind avatar Nov 16 '26 16:11 M3gA-Mind