Command Palette

Search for a command to run...

全球
本地化百科全书

免费开源的参考资料,涵盖每个国家的货币、语言以及日期和数字格式。可视化浏览,或直接集成到你的代码中。

@localedb/core · @localedb/cli

npm 包与 CLI

在你自己的代码中使用 LocaleDB:一个可离线使用的类型化库,以及一个把你选择的数据写入项目的命令行工具。

npm install @localedb/core
example.ts
import { getCountry } from "@localedb/core";

const tr = getCountry("TR");
tr?.currency.symbol;               // "₺"
tr?.numberFormat.decimalSeparator; // ","
tr?.dateTime.dateFormats.short;    // "d.MM.y"

// or from the command line
// npx @localedb/cli get country TR