Skip to content

feat(i18n): add Persian locale with RTL support - #165

Open
cyb3rAcad3my wants to merge 1 commit into
CyberStrikeus:mainfrom
cyb3rAcad3my:feat/i18n-persian
Open

cyb3rAcad3my wants to merge 1 commit into
CyberStrikeus:mainfrom
cyb3rAcad3my:feat/i18n-persian

Conversation

@cyb3rAcad3my

@cyb3rAcad3my cyb3rAcad3my commented Oct 16, 2026 •

Copy link
Copy Markdown

What does this PR do?

Adds Persian (fa) as an optional language for the web UI, reusing the existing i18n setup.

  • New fa dictionaries for packages/app and packages/ui
  • Registers fa in Locale, LOCALES, LABEL_KEY, DICT, localeMatchers, PARITY_CHECK
  • Sets document.documentElement.dir so Persian renders RTL and switching back restores LTR, both in-app and pre-paint in cs-theme-preload.js
  • Adds "language.fa" to every existing locale so the selector label resolves

English stays the default and no existing locale changes. Tool names, config values and brand names are deliberately left untranslated. The TUI and the console site use separate systems, so they are out of scope.

Closes #164

Type of change

  • UI / TUI improvement

Security impact

  • This PR has no security impact

How did you verify it works?

  • bun turbo typecheck clean (also ran as the pre-push hook, 11/11 tasks)
  • bun test in packages/app: 206 pass, up from 196. The 10 failures and 5 errors are the same set as on main, so no regressions.
  • bun run build succeeds
  • Structural check: fa has the exact key set and order of en, and every {{placeholder}} matches
  • Preload script simulated with {"locale":"fa"}, {"locale":"en"}, and malformed JSON

Still open: the 2 new Playwright e2e tests have not been run, and I have not done a manual pass with a live LLM provider.

Checklist

  • bun turbo typecheck passes
  • Tested locally with at least one LLM provider
  • PR is focused on a single change
  • No secrets, credentials, or API keys in the diff
  • Breaking changes are documented (if any)

Adds Persian (fa) as an optional language for the web UI, following the
existing i18n architecture in packages/app and packages/ui.

- New dictionaries: packages/app/src/i18n/fa.ts, packages/ui/src/i18n/fa.ts
- Register fa in Locale, LOCALES, LABEL_KEY, DICT, localeMatchers, PARITY_CHECK
- Add "language.fa" to every existing locale dictionary
- Set document.documentElement.dir so Persian renders RTL and switching back
  restores LTR; also set it pre-paint in cs-theme-preload.js
- New pure direction() helper so it is testable without JSX
- Unit tests for direction, completeness and placeholder integrity, plus
  two e2e tests for RTL switching and persistence

English stays the default and every existing locale is unchanged.
Tool names, config values and brand names are deliberately left untranslated.
The TUI and the console site use separate systems and are not covered.

@cyb3rAcad3my cyb3rAcad3my left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds Persian (fa) localization to the web UI, including RTL support, locale registration, and tests for direction handling, dictionary completeness, and persistence.

English remains the default, and existing translations are preserved. The TUI and console site are intentionally out of scope.

Thank you for reviewing this contribution!

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.

[FEATURE]: Persian (fa) locale for the web UI

1 participant