Skip to content

This PR introduces native Arabic (ar) language support to the website. - #283

Merged
snekxs merged 6 commits into
OpenMouse-Project:mainfrom
y1464892-cmd:i18n/add-arabic-locale
Sep 24, 2026
Merged

snekxs merged 6 commits into
OpenMouse-Project:mainfrom
y1464892-cmd:i18n/add-arabic-locale

Conversation

@y1464892-cmd

@y1464892-cmd y1464892-cmd commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Rather than relying on automated browser translation which often produces awkward or inaccurate phrasing this change provides high-quality, native translations to ensure a natural reading experience for Arabic-speaking users.

Related Issue

Resolves #282

Scope of Work & Current Status

  • Initial setup for Arabic locale (ar)
  • Complete translation of site components (~1.5 to 2 weeks estimated)
  • Implement Right-to-Left (RTL) layout adjustments and toggle feature
  • Testing for layout bugs and translation accuracy

Note: This PR is currently a Work in Progress (WIP). I will update this description and mark the PR as "Ready for Review" once all translations and QA checks are complete.

Screenshot_22-9-2026_23464_localhost Screenshot_22-9-2026_234530_localhost Screenshot_22-9-2026_23454_localhost Screenshot_22-9-2026_234440_localhost Screenshot_22-9-2026_234426_localhost

@y1464892-cmd

Copy link
Copy Markdown
Contributor Author

My First open source project I am so excited !!! (⁠;⁠^⁠ω⁠^⁠)

mh2n and others added 4 commits September 23, 2026 21:52
- Replace the French-derived i18n-ar.ts with a full native Arabic table
  covering all 1050 current keys, matching the English key set and
  placeholder set exactly.
- Mirror the layout for right-to-left: set dir="rtl" on <html> when the
  locale is Arabic, and convert direction-sensitive CSS to logical
  properties (margin/border/padding-inline, inset-inline, logical corner
  radii, text-align start/end) so spacing and borders flip automatically.
  Add [dir=rtl] overrides for transform-based direction (toggles, nav
  chevrons, expand chevron).
- Add the missing 'ar' entry to the html lang map.
- Drop the unrelated esbuild entry under allowScripts.
The Arabic table ships as its own lazy chunk (i18n-ar-*.js, ~69 kB,
loaded only when Arabic is selected), so the initial English bundle is
untouched. The aggregate now measures 1,817.7 kB, which is 38 kB over the
1,780 kB budget; raise it to 1,845 kB. Same documented pattern as every
previous locale (pt, es/fr/de/zh, ja/ko, ru, vi).
@snekxs
snekxs marked this pull request as ready for review September 24, 2026 07:47
@snekxs
snekxs merged commit 99076c1 into OpenMouse-Project:main Sep 24, 2026
3 checks passed
@snekxs

snekxs commented Sep 24, 2026

Copy link
Copy Markdown
Member

Merged after a full pass over the branch. Thanks for the initial wiring, @y1464892-cmd — the locale plumbing (union, LOCALES, LOCALE_NAME_KEYS, LOCALE_LOADERS, and the set.arabic label across all tables) was correct and is what this is built on.

Before merging I completed the parts the description still listed as open:

  • Native Arabic translation. src/i18n-ar.ts was 870/981 entries byte-identical to src/i18n-fr.ts; it is now a full native table covering all 1,050 current keys, matching the English key set and placeholder set exactly.
  • Fork was behind main (missing gamereq.*, games.*, hw.*, nav.games, nav.hardwareTest, and others), and it didn't compile — App.tsx was missing the ar entry and the table carried a stale bridge.games key. Rebasing fixes both.
  • RTL. The app never set dir, so Arabic rendered left-to-right. <html dir="rtl"> is now set for Arabic, and direction-sensitive CSS was converted to logical properties (margin/border/padding-inline-*, inset-inline-*, logical corner radii, text-align: start/end) so spacing and borders mirror on their own. A small [dir="rtl"] block covers transform-based direction (toggles, nav chevrons, expand chevron). LTR output is pixel-identical.
  • Bundle budget raised to 1,845 kB for the new lazy i18n-ar-*.js chunk (~69 kB, loaded only when Arabic is selected), per the file's documented per-locale pattern.
  • Dropped the unrelated allowScripts/esbuild entry from package.json.

Verified with npm run check (build + 265 tests), all CI checks green, and a headless render confirming the mirrored layout. Merged as 99076c1.

@y1464892-cmd

Copy link
Copy Markdown
Contributor Author

Merged after a full pass over the branch. Thanks for the initial wiring, @y1464892-cmd — the locale plumbing (union, LOCALES, LOCALE_NAME_KEYS, LOCALE_LOADERS, and the set.arabic label across all tables) was correct and is what this is built on.

Before merging I completed the parts the description still listed as open:

  • Native Arabic translation. src/i18n-ar.ts was 870/981 entries byte-identical to src/i18n-fr.ts; it is now a full native table covering all 1,050 current keys, matching the English key set and placeholder set exactly.
  • Fork was behind main (missing gamereq.*, games.*, hw.*, nav.games, nav.hardwareTest, and others), and it didn't compile — App.tsx was missing the ar entry and the table carried a stale bridge.games key. Rebasing fixes both.
  • RTL. The app never set dir, so Arabic rendered left-to-right. <html dir="rtl"> is now set for Arabic, and direction-sensitive CSS was converted to logical properties (margin/border/padding-inline-*, inset-inline-*, logical corner radii, text-align: start/end) so spacing and borders mirror on their own. A small [dir="rtl"] block covers transform-based direction (toggles, nav chevrons, expand chevron). LTR output is pixel-identical.
  • Bundle budget raised to 1,845 kB for the new lazy i18n-ar-*.js chunk (~69 kB, loaded only when Arabic is selected), per the file's documented per-locale pattern.
  • Dropped the unrelated allowScripts/esbuild entry from package.json.

Verified with npm run check (build + 265 tests), all CI checks green, and a headless render confirming the mirrored layout. Merged as 99076c1.

Thanks for pulling this in, rebasing, and setting up the logical CSS for RTL! Glad the initial locale wiring held up solid.
I’ll test the live build across a few different browsers and submit a quick follow-up PR if any of the hardware terms or phrasing need a native speaker's context. Appreciate the review and the merge! :D

@mh2n

mh2n commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Merged after a full pass over the branch. Thanks for the initial wiring, @y1464892-cmd — the locale plumbing (union, LOCALES, LOCALE_NAME_KEYS, LOCALE_LOADERS, and the set.arabic label across all tables) was correct and is what this is built on.

Before merging I completed the parts the description still listed as open:

  • Native Arabic translation. src/i18n-ar.ts was 870/981 entries byte-identical to src/i18n-fr.ts; it is now a full native table covering all 1,050 current keys, matching the English key set and placeholder set exactly.
  • Fork was behind main (missing gamereq.*, games.*, hw.*, nav.games, nav.hardwareTest, and others), and it didn't compile — App.tsx was missing the ar entry and the table carried a stale bridge.games key. Rebasing fixes both.
  • RTL. The app never set dir, so Arabic rendered left-to-right. <html dir="rtl"> is now set for Arabic, and direction-sensitive CSS was converted to logical properties (margin/border/padding-inline-*, inset-inline-*, logical corner radii, text-align: start/end) so spacing and borders mirror on their own. A small [dir="rtl"] block covers transform-based direction (toggles, nav chevrons, expand chevron). LTR output is pixel-identical.
  • Bundle budget raised to 1,845 kB for the new lazy i18n-ar-*.js chunk (~69 kB, loaded only when Arabic is selected), per the file's documented per-locale pattern.
  • Dropped the unrelated allowScripts/esbuild entry from package.json.

Verified with npm run check (build + 265 tests), all CI checks green, and a headless render confirming the mirrored layout. Merged as 99076c1.

Really happy to see this merged! This was my first accepted contribution to an open-source project, and I'm glad I got to work on it with my friend. Thanks to the maintainer for helping us get it across the finish line!❤️

@mh2n
mh2n deleted the i18n/add-arabic-locale branch September 24, 2026 18:19
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.

i18n: add Arabic (ar) locale support

3 participants