@box/cldr-data

中文文档
45.0.0发布于 2024/05/22SEE LICENSE IN LICENSETypeScriptESM + CJS零依赖近 30 天下载 5.2万

CLDR Data that box-ui-elements and other Box code needs

原始使用文档
文档目录12 节
  1. v45.0.0
  2. v44.0.1
  3. v44.0.0
  4. v41.0.0
  5. v34.8.0
  6. v34.7.1
  7. v34.7.0
  8. v34.6.1
  9. v34.6.0
  10. v34.5.0
  11. v34.4.1
  12. v34.4.0

Box CLDR Data

npm latest version

Usage

This is a package that contains the subset of CLDR data that is needed for box-ui-elements and possibly other React apps within Box.

To use data for a locale:

import loadLocaleData from '@box/cldr-data';
or
var loadLocaleData = require('@box/cldr-data'); // from commonjs

then:

const germanData = loadLocaleData("de-DE");

If you are using webpack and do not want to get all of the locale data for all locales at once built into your package, you should directly require only the locales that you need:

import germanData from '@box/cldr-data/locale-data/de-DE';  // for typescript

or

const germanData = require("@box/cldr-data/locale-data/de-DE.js");  // for commonjs

Change Log

v45.0.0

  • updated to CLDR v45.0.0

v44.0.1

  • fixed a problem where the typescript types were not being exported properly from the package

v44.0.0

  • updated to CLDR v44.0.0
    • package.json set to point at v44.0.1 of cldr-* packages because the package makers screwed up some stuff, so they made a quick update for npm. However, they assure us that the CLDR version is still v44.0.0
    • now points at a specific version of the cldr-* packages instead of a carat version so that each version of @box/cldr-data tracks a specific version of the CLDR data

v41.0.0

  • updated package version to the latest version of CLDR packages (version 41).

v34.8.0

  • updated to ship both the ES6 and the transpiled versions of this package.

v34.7.1

  • removed a bogus dependency on the nodejs path package that shouldn't have been there!

v34.7.0

  • Added data for names of the days of the week

v34.6.1

  • Fixed a bug where if you used loadLocaleData(), the types file was in the wrong spot in the npm package, so they didn't load.

v34.6.0

  • Added week data from CLDR for each locale.
  • Returns the first day of the week, and which days the weekend starts and ends
  • Values are:
    • 0 = Sunday
    • 1 = Monday
    • 2 = Tuesday
    • 3 = Wednesday
    • 4 = Thursday
    • 5 = Friday
    • 6 = Saturday

v34.5.0

  • Returns the localizedName, abbreviationStandard, and abbreviationDaylight fields separately now in case clients wish to format the zone differently

v34.4.1

  • return the language name array sorted by the translation of those language names

v34.4.0

  • initial version that uses CLDR version 34.0.0

Copyright and License

Copyright 2020-present Box, Inc. All Rights Reserved.

Licensed under the Box Software License Agreement v.20170516. You may not use this file except in compliance with the License. You may obtain a copy of the License at

https://developer.box.com/docs/box-sdk-license

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

版本与发布记录

@box/cldr-data 共发布 15 个版本,首次发布于 2020/02/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
45.0.0latest2024/05/222 年前
44.0.12024/05/152 年前
44.0.02024/01/112 年前
41.0.12022/07/134 年前
41.0.02022/07/134 年前
34.8.02022/07/084 年前

关于 @box/cldr-data 的常见问题

@box/cldr-data 是什么?

CLDR Data that box-ui-elements and other Box code needs

如何安装 @box/cldr-data?

在项目目录运行 npm install @box/cldr-data,或使用 pnpm add / yarn add / bun add。

@box/cldr-data 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@box/cldr-data 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@box/cldr-data 可以商用吗?

@box/cldr-data 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@box/cldr-data 的下载量有多少?

根据 npm 官方下载统计,@box/cldr-data 在 2026/10/09 – 2026/11/07 这 30 天内被下载 52,009 次,日均约 1,734 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@box/cldr-data 还在维护吗?

最新版本 45.0.0 发布于 2024/05/22(2 年前);至今共发布 15 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/02/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。