npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@huanlin/dsh-plugin-better-locale

v0.4.3

Published

DSH web 插件:通过 DSH v0.1.5-rc.1 原生第三方语言 API(locale.addLanguage + register(ns, locale, dict))注册 19 种内置语言字典(ja/ko/fr/...),语言直接出现在 DSH 设置页原生 Language 行中切换,未覆盖文案按 fallback 链回退英文。 | DSH web plugin: registers 19 bundled third-language dictionaries (ja/ko/fr/...)

Readme

dsh-plugin-better-locale

中文 | English

A DSH web plugin that ships bundled third-language dictionaries (Japanese / Korean / French / German / ... — 19 languages) for DSH's own built-in UI namespaces, plus a compile-time drift engine that keeps the dictionaries tracking every DSH release. Languages are registered through DSH v0.1.2-alpha.1's native language-pack API (locale.addLanguage + locale.register(ns, locale, dict)), so they appear directly in DSH's own Language settings row; uncovered copy falls back along DSH's per-key fallback chain.

| | | |---|---| | Package | @huanlin/dsh-plugin-better-locale | | Repo | huanlinoto/dsh-plugin-better-locale | | Requires | DSH dsh-v0.1.5-rc.1 or newer | | License | AGPL-3.0 |

Invariants

This package publishes no ./invariant export. Per the DSH invariant rules effective since v0.1.2-rc.1, an invariant is only published when independent observations can diverge; here every language contribution (catalog entry + namespace dictionaries) is registered through ctx.effect, so fiber disposal / HMR removes exactly what was added (covered by tests/apply.spec.ts), and the plugin holds no mutable state of its own — the empty invariant companion was therefore removed.

Supported languages

| Language | id | Label | |---|---|---| | Japanese | ja | 日本語 | | Korean | ko | 한국어 | | French | fr | Français | | German | de | Deutsch | | Portuguese | pt | Português | | Arabic | ar | العربية | | Hindi | hi | हिन्दी | | Indonesian | id | Bahasa Indonesia | | Turkish | tr | Türkçe | | Vietnamese | vi | Tiếng Việt | | Thai | th | ไทย | | Russian | ru | Русский | | Italian | it | Italiano | | Dutch | nl | Nederlands | | Swedish | sv | Svenska | | Polish | pl | Polski | | Traditional Chinese (HK) | zh-HK | 繁體中文(香港) | | Traditional Chinese (TW) | zh-TW | 繁體中文(台灣) | | Traditional Chinese (MO) | zh-MO | 繁體中文(澳門) |

Install

# npm registry
dsh plugin --profile web add "@huanlin/dsh-plugin-better-locale"

# or github ref
dsh plugin --profile web add "github:huanlinoto/dsh-plugin-better-locale"

After install, restart dsh web and hard-refresh the browser (Ctrl+Shift+R).

Usage

Open Settings → General → Language: every bundled language is listed alongside DSH's built-in 中文 / English. Pick one and the whole UI switches immediately — the selection persists in DSH's durable locale.preference setting (survives browsers and devices sharing the same DSH home), and <html lang> follows.

Uncovered namespaces / keys fall back through DSH's per-key fallback chain (selected language → declared fallback → en; the Traditional Chinese variants declare zh, so their gaps show Simplified Chinese rather than English). Coverage table: TRANSLATION.md (regenerate with pnpm run gen:translations).

Coverage & scope

  • DSH itself only: the dictionaries translate DSH's built-in namespaces (common / settings.locale / command / ... — every namespace merged into DSH's LocaleNamespaceMap, 39 namespaces / 1233 keys × 19 languages at current coverage). The scope is machine-locked at compile time: pnpm typecheck fails if the dictionaries miss an upstream namespace/key (drift) or carry one upstream does not own (trespass).
  • The drift engine: after upgrading the DSH checkout, run pnpm typecheck — red means upstream added or renamed copy; translate until green. scripts/check-upstream-merges.mjs (part of the same command) fails when a new upstream merge module is not yet imported by the assertion file, so new namespaces can never slip in unnoticed.
  • Third-party plugins are out of scope by design: a plugin's own namespaces belong to that plugin. Unmigrated plugins coexist with zero errors (their copy falls back to English); migration is a few lines of native API — see the Developer Guide.

Migration from 0.1.x (v0.1.2-alpha.1 adaptation)

0.1.x injected third languages by monkey-patching LocaleRuntime.prototype.lookup and borrowing DSH's English slot (selection in a custom settings row, persisted to localStorage, English-only activation). DSH v0.1.2-alpha.1 made all of that native, and the plugin dropped the hack:

  • the custom "Language override" settings row is gone — use DSH's native Language row;
  • persistence moved from browser localStorage to DSH's locale.preference setting;
  • the override now works with any DSH active locale (no "switch to English first" step);
  • the ctx.betterLocale service was removed — register plugin dictionaries through ctx.locale directly.

Known limitations

  • Coverage is a process, not a promise: the dictionaries track the upstream merge table exactly at each release of this plugin (currently 39 namespaces / 1233 keys × 19 languages); between a DSH upgrade and a better-locale update, new upstream copy falls back along the fallback chain. Run pnpm typecheck in the repo to see any gap.
  • Traditional Chinese variants fall back to Simplified Chinese: zh-HK / zh-TW / zh-MO declare fallback: 'zh' — missing keys show the Simplified dictionary (chain zh-TWzhen), not English.
  • Third-party plugin copy is not translated here: those namespaces belong to their plugins (see the Developer Guide); expect English for unmigrated plugins while a third language is active.
  • Web only: the client bundle targets the browser; it does not run in Node.

License

AGPL-3.0