Repository navigation
DSH | dsh-arabic | Arabic interface pack and per-block RTL for mixed Arabic/English text #8935
Replies: 1 comment
|
0.3.2 is out — dsh-arabic 0.3.2 (npm It closes a gap this post did not cover: the question card the assistant asks with. The question sits in the card's own Before / after — the same markup and the same strings, rendered by Chromium with the real bidi engine (right panel carries the The shapes this depends on are pinned, because a rename upstream is silent — |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Project URL: https://github.com/SMSMy/dsh-arabic · npm: https://www.npmjs.com/package/dsh-arabic
Introduction
dsh-arabicis one plugin with two independent halves: an Arabic interface pack, and a bidi layer that decides text direction per block.dir="auto"gets developer text wrong whenever a line opens with a Latin token —Error: فشل الاتصال بالخادمandHello كيف حالكare Arabic sentences thatunicode-bidi: plaintextrenders LTR. Here each block is weighed in words: code-like tokens (URLs, paths,@scope/name, shas,15/15, dotted file names) do not vote and glue the Latin words around them into one technical unit; a tie resolves to Arabic; a block with no Arabic word is released; and a streamed answer may not flicker (hysteresis).dirset by the app or the author is never overridden.How it integrates with DSH
index.js) pushes two rows into the documentedwebserver/index-injecttable: onestylerow (the direction CSS) and onescriptrow (the page-side layer).lib/client.js, declared throughdsh.client.platform: "web") touches only the officiallocaleservice:ctx.locale.addLanguage({ id: 'ar', label: 'العربية', fallback: 'en' })and thenctx.locale.register(namespace, 'ar', dictionary)for each of the 59 namespaces — plus one row insettings.general.itemthat toggles the direction layer.@deepseek-ai/*package is declared as a dependency; the plugin works through the two documented extension points above and degrades safely if either changes.Screenshots
Direction, before and after — rendered by Chromium with the real bidi engine: both columns carry the same five lines, each opening with a Latin token. The left column is the first-strong rule, the right one is prose dominance.
The activity light, frozen at one instant of its cycle: English above, Arabic below. The bright band is mirrored.
Install
Restart DSH afterwards — the injection table is collected once at host startup — then Settings → General → Language → العربية.
Verification and known limits
55 bidi behaviour checks on a DOM shim, 32 locale-contract checks, 30 golden direction cases, a cross-batch consistency lint and a documentation-count guard, all on Node 20/22/24 in CI. The limits are documented rather than hidden: bare Latin words still outvote one Arabic word (
شغّل git statusstays LTR); the sidebar terminal is xterm.js and does not shape Arabic; the shell (sidebar, menus) stays LTR on purpose until the core adopts CSS logical properties; and the dictionaries are flat, so ICU plural forms are not available.DSH محدَّد: مُختبَر على desktop 0.2.0-rc.2 · رخصة MIT · منشور على npm مع إثبات منشأ (OIDC).
All reactions