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

@techui/locales

v0.2.0

Published

TechUI locales, Used to support the multi-language function of Techui component library.

Readme

@techui/locales

English | 中文


English

Introduction

@techui/locales is the locale resource package for TechUI. It provides the built-in language data used by TechUI components and exposes runtime APIs for on-demand loading and dynamic extension.

Built-In Loading

Use the default localeLoader entry when a locale should be loaded through the unified loader:

import localeLoader from "@techui/locales"

await localeLoader.ensure("en")

Shortcut locale entries are also available:

import "@techui/locales/zh-CN"
import "@techui/locales/zh-TW"
import "@techui/locales/en"

Runtime Locale Registration

External packages and host projects can register extra locale modules at any time:

import { registerLocaleModule } from "@techui/locales"

registerLocaleModule("myWidget", {
  "zh-CN": {
    myWidget: { title: "标题" }
  },
  en: {
    myWidget: { title: "Title" }
  }
})

Registration is dynamic. If the current app has already initialized the same language, the Provider refreshes its reactive locale state immediately after the module is registered.

Duplicate detection uses language + namespace. Re-registering the same namespace overwrites the previous module and prints a warning by default. Pass { force: true } when the overwrite is intentional and should not warn:

registerLocaleModule("myWidget", locales, { force: true })

Locale modules are deep-merged into the base language package. The merge only adds or overwrites keys; it does not delete existing keys.

Supported Languages

  • Simplified Chinese (zh-CN)
  • Traditional Chinese (zh-TW)
  • English (en)

Package Information


中文

简介

@techui/locales 是 TechUI 的多语言资源包。它提供 TechUI 组件内部使用的内置语言数据,并暴露按需加载和运行时动态扩展能力。

内置加载

需要通过统一入口加载语言资源时,使用默认导出的 localeLoader

import localeLoader from "@techui/locales"

await localeLoader.ensure("en")

也可以直接使用语言子路径注册指定语言:

import "@techui/locales/zh-CN"
import "@techui/locales/zh-TW"
import "@techui/locales/en"

运行时语言包注册

外挂组件包和宿主工程可以在任意时机注册额外语言模块:

import { registerLocaleModule } from "@techui/locales"

registerLocaleModule("myWidget", {
  "zh-CN": {
    myWidget: { title: "标题" }
  },
  en: {
    myWidget: { title: "Title" }
  }
})

注册是动态的。如果当前应用已经初始化了同一语言,模块注册后 Provider 会立即刷新响应式语言状态。

重复判断使用 语言 + namespace。重复注册同一 namespace 时会覆盖旧模块,并默认输出告警;如果是预期覆盖,可以传入 { force: true } 关闭告警:

registerLocaleModule("myWidget", locales, { force: true })

外部语言模块会深合并到基础语言包中。合并只负责新增或覆盖字段,不负责删除旧字段。

支持的语言

  • 简体中文 (zh-CN)
  • 繁体中文 (zh-TW)
  • 英文 (en)

包信息