Repository navigation
Russian language pack (2615 UI strings) — and a request: the desktop shell is English-only for every non-zh locale #8759
Balla1ore
started this conversation in
Show Your Plugins!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I built a Russian language pack for the web client, and while doing it I hit one gap that a plugin cannot close — the desktop shell ships
enandzhonly. Sharing both the plugin and the finding here, sinceCONTRIBUTING.mdsays external pull requests are not accepted at the moment.The pack
dsh-locale-ru— https://github.com/Balla1ore/dsh-locale-ru (GitHub topicdsh-plugin)0.2.0-rc.2, so chat, sidebar, settings, models, permissions, trajectory, jobs, subagents, approvals, deliverables, the Plugins page and the rest are Russian.install.cmd. Pick Настройки → Общие → Язык → «Русский» afterwards.The gap: the shell is hard-wired to two languages
apps/desktop/src/locale.ts:So a user who selects Русский in the client gets a Russian client and an English shell:
Application,Edit) and its items (Undo,Redo,Cut,Copy,Paste,Delete,Select All),apps/desktop/tests/locale.spec.tseven pins the current behaviour (resolveDesktopLocale('fr-FR').messages→en), so this looks intentional rather than an oversight — and it affects every language the client may add later, not just Russian.What is ready if you want it
en/zh: https://github.com/Balla1ore/dsh-locale-ru/blob/main/locales/shell-ru.json — MIT, take it as-is, no attribution strings inside.export const ru = { … }next toen/zh(or import it from a locale file, if you prefer one file per language),readonly id: 'en' | 'zh-CN' | 'ru',resolveDesktopLocaleforru*(before the English fallback),'ru'in both branches ofresolveDesktopStartupLocale,apps/desktop/tests/locale.spec.ts(the Russian key set equals the English one;resolveDesktopLocale('ru-RU').id === 'ru').preload-menu.tsandpreload-welcome.tsboth callresolveDesktopLocaleand need no change;desktopClientMetadatakeeps sendingen_USfor the account platform page, which is the right fallback for Russian.I am not opening a pull request because
CONTRIBUTING.mdasks that they not be sent yet. If that policy changes, I am glad to prepare one — the table, the patch and the tests are ready — or to hand the table over in any other form.The stopgap, and why upstream support would help
Until the shell knows Russian, the pack patches the installed
app.asar(three files:lib/main.js,lib/preload-app.cjs,lib/preload-welcome.cjs): it keepsapp.asar.before-locale-ru, verifies every archive entry byte-for-byte, refuses to write when an anchor is missing,node --checks each patched file, and--restoreputs the original back. A DSH update replaces the archive and reverts the change, after which the pack prepares it again and a launcher applies it on the next start.That is a lot of machinery for three lines of TypeScript in a file that already has the table structure, and it is the reason for this post: a shell that resolves any registered language, or at least a third dictionary, would let every user get Russian menus, tray and dialogs without touching the application.
Happy to answer questions, adjust the table to your terminology, or post this in Ideas instead if that is the better place for the request.
All reactions