docs: make Chinese README the default

This commit is contained in:
wehub-resource-sync
2026-07-13 10:15:20 +00:00
parent 3bca38e825
commit 35b02500d7
+29 -53
View File
@@ -1,26 +1,24 @@
<h1><img src="https://www.dicebear.com/logo-readme.svg" width="28" /> DiceBear Avatar Library</h1>
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/dicebear/dicebear) · [上游 README](https://github.com/dicebear/dicebear/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
DiceBear is an open source avatar library. It turns any seed string (a username
or an email address, for example) into an SVG avatar in one of 35+ styles
designed by various artists. The same seed always produces the same avatar, so
you store a string instead of an image and never ask users to upload a profile
picture.
<h1><img src="https://www.dicebear.com/logo-readme.svg" width="28" /> DiceBear 头像库</h1>
Avatars are customizable through style options: colors, backgrounds, rotation,
individual features like hair or glasses.
DiceBear 是一款开源头像库。它可将任意种子字符串(例如用户名或电子邮件地址)转换为 35 种以上、由不同艺术家设计的风格之一的 SVG 头像。相同种子始终生成相同头像,因此你可以存储字符串而非图片,也无需让用户上传个人资料照片。
可通过风格选项自定义头像:颜色、背景、旋转,以及发型、眼镜等个别特征。
[Playground](https://www.dicebear.com/playground) |
[Documentation](https://www.dicebear.com/introduction) |
[Editor](https://editor.dicebear.com)
## One library, six languages
## 一个库,六种语言
DiceBear 10 ships as native libraries for JavaScript, PHP, Python, Rust, Go, and
Dart. Every port passes a shared test suite that requires byte-identical SVG
output to the JavaScript reference. Generate an avatar in the browser,
regenerate it later in a Go or PHP backend, and you get the same bytes.
DiceBear 10 JavaScriptPHPPythonRust、Go 和 Dart 的原生库形式发布。每个移植版本都通过共享测试套件,要求 SVG 输出与 JavaScript 参考实现字节级一致。在浏览器中生成头像,稍后在 Go 或 PHP 后端重新生成,你会得到相同的字节。
| Language | Package | Install |
| 语言 | | 安装 |
| ----------------------- | ----------------------------------------------------------------------- | -------------------------------------------- |
| JavaScript / TypeScript | [`@dicebear/core`](https://www.npmjs.com/package/@dicebear/core) | `npm install @dicebear/core` |
| PHP | [`dicebear/core`](https://packagist.org/packages/dicebear/core) | `composer require dicebear/core` |
@@ -29,9 +27,7 @@ regenerate it later in a Go or PHP backend, and you get the same bytes.
| Go | [`dicebear-go`](https://pkg.go.dev/github.com/dicebear/dicebear-go/v10) | `go get github.com/dicebear/dicebear-go/v10` |
| Dart | [`dicebear_core`](https://pub.dev/packages/dicebear_core) | `dart pub add dicebear_core` |
In JavaScript it looks like this; the
[documentation](https://www.dicebear.com/introduction) has the equivalent for
each language:
JavaScript 中用法如下;[documentation](https://www.dicebear.com/introduction) 中有各语言的等价写法:
```js
import { Avatar } from '@dicebear/core';
@@ -46,53 +42,33 @@ avatar.toString(); // SVG string
avatar.toDataUri(); // data:image/svg+xml;charset=utf-8,...
```
The 35+ avatar styles are plain JSON definitions from the
[`dicebear/styles`](https://github.com/dicebear/styles) repository, available as
a package for each language. You can also
[create your own style](https://www.dicebear.com/guides/create-an-avatar-style-with-figma/),
with Figma or from scratch.
35 种以上的头像风格是来自 [`dicebear/styles`](https://github.com/dicebear/styles) 仓库的普通 JSON 定义,每种语言都有对应的包。你也可以使用 Figma 或从零开始 [create your own style](https://www.dicebear.com/guides/create-an-avatar-style-with-figma/),。
## Without writing code
## 无需编写代码
- The [HTTP API](https://www.dicebear.com/how-to-use/http-api/) returns avatars
from a plain URL, free and without an account:
`https://api.dicebear.com/10.x/lorelei/svg?seed=Felix`. For full control and
privacy you can
[host it yourself](https://www.dicebear.com/guides/host-the-http-api-yourself/)
with a single Docker container.
- The [CLI](https://www.dicebear.com/how-to-use/cli/) generates avatar files in
bulk: `npx dicebear lorelei --count 10`.
- The [editor](https://editor.dicebear.com) lets you assemble a single avatar by
hand and export it.
- [HTTP API](https://www.dicebear.com/how-to-use/http-api/) 可通过普通 URL 返回头像,免费且无需账户:`https://api.dicebear.com/10.x/lorelei/svg?seed=Felix`。如需完全控制和隐私保护,你可以用单个 Docker 容器 [host it yourself](https://www.dicebear.com/guides/host-the-http-api-yourself/)。
- [CLI](https://www.dicebear.com/how-to-use/cli/) 可批量生成头像文件:`npx dicebear lorelei --count 10`
- [editor](https://editor.dicebear.com) 可让你手动组装单个头像并导出。
## This repository
## 本仓库
This monorepo contains the six core libraries, the CLI, the SVG-to-raster
converter, the documentation site ([dicebear.com](https://www.dicebear.com)),
and the editor. Related projects live in their own repositories:
monorepo 包含六个核心库、CLI、SVG 转栅格转换器、文档站点([dicebear.com](https://www.dicebear.com)),)以及编辑器。相关项目位于各自的仓库中:
- [`dicebear/styles`](https://github.com/dicebear/styles): the official avatar
style definitions
- [`dicebear/schema`](https://github.com/dicebear/schema): the JSON Schema
behind definitions and options
- [`dicebear/api`](https://github.com/dicebear/api): the self-hostable HTTP API
- [`dicebear/styles`](https://github.com/dicebear/styles): 官方头像风格定义
- [`dicebear/schema`](https://github.com/dicebear/schema): 定义与选项背后的 JSON Schema
- [`dicebear/api`](https://github.com/dicebear/api): 可自托管的 HTTP API
- [`dicebear/exporter-plugin-for-figma`](https://github.com/dicebear/exporter-plugin-for-figma):
the Figma plugin for style authors
供风格作者使用的 Figma 插件
Contributions are welcome; [CONTRIBUTING.md](./CONTRIBUTING.md) explains the
setup and where each kind of change belongs.
欢迎贡献;[CONTRIBUTING.md](./CONTRIBUTING.md) 说明了环境配置以及各类变更应归属的位置。
## License
## 许可证
The code is [MIT licensed](./LICENSE), including commercial use. The avatar
styles are the work of their respective artists and carry their own licenses;
the [license overview](https://www.dicebear.com/licenses/) lists them all, and
many only ask for attribution.
代码采用 [MIT licensed](./LICENSE),包括商业用途。头像风格是各位艺术家的作品,并附带各自的许可证;[license overview](https://www.dicebear.com/licenses/) 列出了全部内容,许多仅要求署名。
## Sponsors
## 赞助方
Advertisement: Many thanks to our sponsors who provide us with free or
discounted products.
Advertisement: 非常感谢为我们提供免费或折扣产品的赞助方。
<a href="https://bunny.net/" target="_blank" rel="noopener noreferrer">
<picture>