Skip to content

Add Arabic as the eighth language (#855) - #865

Merged
margani merged 4 commits into
mainfrom
issue/855-arabic
Nov 12, 2026
Merged

margani merged 4 commits into
mainfrom
issue/855-arabic

Conversation

@margani

@margani margani commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Translation review wanted. This PR adds Arabic, and the translation was written by an AI, not by a native speaker. It stays open and unmerged until an Arabic speaker has read it. If you speak Arabic, please reply here or on #855 with any wording that sounds wrong or unnatural. The strings live in:

  • www/lib/chogan.js: the core block ar: { (menus, settings, buttons) and the ar: / dar: fields of every award
  • www/index.html: the menu block ar: {
  • www/games/<game>/index.html: each game's ar: { block and its name: { … ar: … }
  • www/games.json: each game's Arabic name and one-line summary
  • fastlane/metadata/android/ar/: the store title and descriptions

مطلوب مراجعة الترجمة. يضيف هذا الطلب اللغة العربية، وقد كتب الترجمةَ ذكاءٌ اصطناعي لا متحدث أصلي. سيبقى الطلب مفتوحًا دون دمج حتى يقرأه متحدث بالعربية. إن كنت تتحدث العربية، فاكتب هنا أو في #855 أي عبارة تبدو خاطئة أو غير طبيعية. توجد النصوص في: www/lib/chogan.js (كتلة ar: { وحقول ar: وdar: للجوائز)، وwww/index.html، وكتلة ar: { في كل لعبة تحت www/games/، وwww/games.json، وfastlane/metadata/android/ar/.

Refs #855

What changed

  • Core (www/lib/chogan.js): ar («العربية») last in LOCALES, dir: 'rtl', so the existing right-to-left handling for Persian applies (document dir, mirrored DOM layouts, back arrows, swipe direction, RTL arrow flips only in DOM grids; canvases stay left to right). Device languages ar and ar-* pick it. A core Arabic block and ar/dar on all 238 awards.
  • Digits: Arabic keeps Western digits 0–9. Chogan.num converts only Persian, and the date format is ar-u-nu-latn, so dates do not show Arabic-Indic digits next to a game's 0–9. The week still starts on Monday (only Persian starts on Saturday, Profile: this week vs last week (plays, play time, …) #664).
  • Every game (73 pages), the menu, games.json (names and summaries), nonogram picture names, tower defence map names, the manifest description, the privacy page titles (the policy text stays English for Arabic, as for French), and the report and issues sites under worker/.
  • Language picker (chogan.css): two rows of four on a phone, one row of eight from 600px.
  • Store: new ar listing (Play's code for Arabic): title, short and full description (3673/4000), and eight phone screenshots from LANGS=ar tools/screenshots.sh. The other seven full descriptions say "eight languages". de-DE, es-ES and pl-PL were 1–5 characters from Play's 4000, so their language line is now shorter rather than longer.
  • Font: Vazirmatn, already bundled, covers Arabic. CDP CSS.getPlatformFontsForNode on Arabic text, including the letters Persian lacks (ة ى ي ك ؤ ئ إ), reports only Vazirmatn (web) and Nunito (web). No system font is used.
  • Tests: a new tools/tests/lang-ar.js group checks that Arabic is listed as RTL with Western digits, that the core and the menu have every key, and that every game's name, summary, string block and award is in Arabic letters with no Persian-only letters (ی ک پ چ ژ گ). It also checks that each game page names itself as games.json does and that the store listing has a line for every game. Existing checks that listed seven languages now include ar. MIN_CHECKS is not raised.
  • CONTRIBUTING.md: eight languages.

Proof

  • node tools/test.js: «همه‌ی 9247 بررسی سبز», exit 0, after merging main (which brought Minesweeper zoom Be able to zoom in #850 and the Sliding Puzzle arrow pad Web form: suggestion (report-20261112-111245-xvzrhq) #854; their new strings are translated too). CI green on b79151c.
  • tools/browser-check.sh: «All pages loaded without console errors (74 of 74)», exit 0.
  • The new group, run alone against origin/main (files from git archive): 2 passed, 14 failed, exit 1. Run against this branch: 16 passed, 0 failed.
  • Playwright, Arabic, 390×800 and 1280×800, light and dark, after document.fonts.ready: menu, profile, language picker, Sudoku, Chess, Hokm, Mahjong, Minesweeper, Way Out, Tanks, Hillrider, Crazy Eights, Backgammon, Jigsaw, 8-Ball, Snooker. No page errors.

Arabic on a phone: menu, language picker, Sudoku, Chess, Hokm
Arabic on a phone: Tanks, Crazy Eights, Mahjong, Minesweeper, Backgammon
Language picker on a wide screen

Not tested / notes

  • The translation has not been reviewed by a native speaker. The PR stays open until one has.
  • Arabic plurals change with the number. With one {n} placeholder per string, phrases like «{n} حركات» read correctly only for some counts.
  • Long two-word Arabic names are cut with "…" in a game's top bar when it also shows two counters (for example «كاسحة الألغام» and «طريق الخروج»). French and Persian are cut the same way on those pages ("Démin…", «م…» on Mahjong), so this is the bar's existing layout and not specific to Arabic.
  • The app name stays "Chogan" in Latin letters, as in every language except Persian.
  • No Arabic changelog for past releases. The next release adds ar/changelogs/<code>.txt.
  • The report and issues Workers are not redeployed by this PR.

Arabic (`ar`, «العربية») is last in LOCALES, right to left like Persian,
and keeps Western digits: Chogan.num converts only Persian, and dates use
`ar-u-nu-latn` so a date never shows Arabic-Indic digits beside a game's 0-9.
Device languages ar and ar-* pick it.

- Core strings, every award (ar/dar), the menu, games.json names and
  summaries, every game's strings and names (nonogram pictures, tower
  defence maps), manifest description, privacy page titles, the report
  and issues sites.
- Language picker: two rows of four on a phone, one row of eight wide.
- Store: new `ar` listing (title, short, full description, eight phone
  screenshots); the other listings mention eight languages, shortened
  where they were near Play's 4000 characters.
- Tests: tools/tests/lang-ar.js asks for Arabic letters and refuses the
  Persian-only letters; lists of seven languages now include ar.

The translation is machine-made and waits for a native speaker's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QY4t6rHpbsoE5aS15nw6Z7
@margani margani added the needs-translation-review Waiting for a native speaker to review a translation label Nov 12, 2026
@margani

margani commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Diff review

Why it's done this way

  • Arabic reuses the Persian right-to-left path through dir: 'rtl' in LOCALES. Chogan.isRtl(), document.dir, the back arrows, swipe direction, RTL DOM-grid arrow flips (Minesweeper) and the comma in Water Sort's tube description all follow from it. No game needed a code change. Canvases are drawn left to right in every language, as before.
  • Western digits: Chogan.num is untouched (it converts only fa), and the Arabic date format is ar-u-nu-latn, not ar, which would print ٠١٢. Mixed lines such as «حتى 3», «32 أدلة», «0:01» and «3–4 لاعبين» render in the right order in the screenshots.
  • Translations were inserted as an ar block right after each fr block and as ar: after each inline fr:. Except for one comma in Carrom, the only changed lines are the inline name objects (73 game names, 30 nonogram pictures, 6 tower defence maps, the Battleship NAME table) and the 238 award lines, each with ar/dar appended.
  • Store texts: de-DE, es-ES and pl-PL had 1–5 characters left under Play's 4000, so the language line in every listing became "eight languages" rather than a longer list.

Tested

  • node tools/test.js: 9178 green. tools/browser-check.sh: 74 of 74.
  • The new tools/tests/lang-ar.js fails on origin/main (14 of 16 checks) and passes here (16/16). Two checks pass on the old code too: the game count, and Chogan.num keeping 0-9, which is already the behaviour for every language but Persian. It guards that.
  • The font comes from the page itself, Vazirmatn (web), for Arabic-only letters. This was proven with CDP CSS.getPlatformFontsForNode, not a picture, because this laptop has Vazirmatn installed.
  • Playwright screenshots in Arabic, phone and desktop, light and dark, of the menu, profile, picker and 14 games. No page errors.

Not tested

  • Native-speaker quality. Points the translating agents flagged for a reviewer:
    • card terms: the suits (البستوني، الكبة، الديناري، السباتي), the jack «الولد», trump «الحكم», pass «باس»
    • Pasur's «سور», kept as the Persian term
    • backgammon's gammon «مارس»
    • Klondike's stock and foundation, Gin Rummy's deadwood
    • Hillrider's and Moto Rush's vehicle names
    • plural agreement after {n}
  • Real Android WebView and Firefox: only headless Chrome was used.
  • The report and issues Workers were not deployed.

margani and others added 2 commits November 12, 2026 18:30
…oku themes, Football

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QY4t6nURUboWf82LgW2N4S
@margani
margani merged commit 1afde28 into main Nov 12, 2026
4 checks passed
@margani
margani deleted the issue/855-arabic branch November 12, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-translation-review Waiting for a native speaker to review a translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant