Repository navigation
Add Hindi (हिन्दी) as the eighth language (#856) - #869
Conversation
Hindi (hi, left to right, Western digits) joins LOCALES, with strings in the core, the menu, all 73 games, games.json, the 238 awards, the manifest, the privacy pages, the report form and the issues site, and a hi-IN Play listing with screenshots. Vazirmatn and Nunito have no Devanagari and many Linux/ChromeOS systems have no font for it, so a subset of Noto Sans Devanagari (OFL, basic block, wght 400-800, 71,672 bytes) ships as a third face of the Vazirmatn family, precached by the service worker and checked in the APK. Profile cards are buttons and used the browser font, so their Hindi came from a system font; they now inherit the app font. The menu search ignores the nukta, the language picker is 4+4 on phones and 8 wide from 600px, and the other store listings name "eight languages" to stay under 4000 characters. testFontFaces moved to tools/tests/font-faces.js (test.js is at its size guard); new test tools/tests/lang-hi.js. Refs #856 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QY4t6rHpbsoE5aS15nw6Z7
main gained zoom buttons and a pinch hint in Minesweeper (#850) and an arrow pad in Sliding Puzzle (#854) while this branch was open; their new strings get Hindi too. Refs #856 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QY4t6rHpbsoE5aS15nw6Z7
Diff reviewWhy this shape. Hindi was added the same way French (#819) and Polish (#570) were. Side fixes that came from Hindi but touch every language:
Tested
Not tested
Left out on purpose
|
Hindi for the games that arrived with Arabic (Fit Ten, Sudoku themes and Killer, Football kick-off rule), nine-language picker and store texts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QY4t6nURUboWf82LgW2N4S
Refs #856
What changed
hi(«हिन्दी», left to right) is the eighth entry ofLOCALES; ahi/hi-*device opens in Hindi. Dates usehi-IN-u-nu-latn, numbers stay Western digits like the other left-to-right languages.hiblock in the core, the menu and all 73 games (help, tutorials, buttons, aria labels), every game name and summary ingames.json, every one of the 238 awards, the tower defence maps, the nonogram and jigsaw picture names, the manifest description, the privacy pages' title, and the report form and issues site.www/fonts/noto-devanagari.woff2: the whole basic Devanagari block (U+0900–097F) with every conjunct,wdthfixed at 100,wght400–800 (the app uses 400–800). It is 71,672 bytes; the full variable font is 642 KB. It is a third face of theVazirmatnfamily with the same descriptors, so canvas games get it too, limited byunicode-range: U+0900-097F, U+25CC, and it borrows Vazirmatn's line metrics. The service worker precaches it, its licence is inwww/fonts/OFL-NotoSansDevanagari.txt, and the APK check asks for it.<button>s, which used the browser's own font; they now inherit the app font. Without this their Hindi names came from a system font (and would be boxes where there is none).hi-INlisting (title, short and full description at 3,766 of 4,000 characters, eight screenshots fromLANGS=hi tools/screenshots.sh). The other listings were at 3,989–3,999 characters, so their language line now says "eight languages, Hindi among them" instead of naming all of them (Persian and Chinese, with room, name them all).tools/tests/lang-hi.js(new);testFontFacesmoved totools/tests/font-faces.jsbecausetools/test.jsis at its 1 MB guard, and now expects three faces;LOCALE_CODESand the per-language lists (device language, manifest, Way Out genre word, Chinese chess name, Backgammon "You start", Sums rings, store games, issues site) include Hindi; three Hillrider tests that hard-coded seven languages now compare withLOCALE_CODES; the Button Football award check reads the last fielddhi.MIN_CHECKSis unchanged.Proof
tools/tests/lang-hi.js, run alone (a small runner that loads one test file):origin/main: 160 failed of 239 (nohiinLOCALES, ahi-INdevice opens in English, no Hindi dictionary anywhere, …)tools/tests/font-faces.js: main 1 failed of 1 (two faces), branch 0 of 6.Full suite on the branch, after merging current
main(which added Minesweeper zoom #850 and the Sliding Puzzle arrow pad #854; their new strings got Hindi in the second commit, andminesweeper-zoom.jscounts each key in every language):Font proof: Chrome DevTools
CSS.getPlatformFontsForNodeover the profile page in Hindi reportsNoto Sans Devanagari (web)for every Devanagari glyph and no system Devanagari font. This laptop has Noto Sans Devanagari installed system-wide, so a screenshot alone would not have shown a missing web font; the first run did find system Devanagari on the profile cards, which is what the button fix above is for.Screenshots
Playwright with Chrome, local server, Hindi, after
document.fonts.ready, at 390×800 and 1280×800, light and dark: the menu, the four tabs, the language picker, Chess help, and Backgammon, Chess, Crazy Eights, 8-Ball Pool, Hillrider, Hokm, Ludo, Mahjong, Minesweeper, Spider, Storekeeper, Sudoku, Tanks and Way Out. No page errors. A few below.Not tested / open
template/game/has no Polish or French either and was not changed; new games need ahiblock (seeCONTRIBUTING.md, now "eight languages").fastlane/metadata/android/hi-IN/changelogs/<code>.txt.🤖 Generated with Claude Code
https://claude.ai/code/session_01QY4t6rHpbsoE5aS15nw6Z7