Skip to content

Commit

Permalink
更新开发手册 (#123)
Browse files Browse the repository at this point in the history
* 更新开发手册

* typo
  • Loading branch information
uubulb authored Dec 10, 2024
1 parent 9ae82fe commit fff0d2a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 44 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ function getDeveloperSidebarEnUS() {
{
text: 'Development Manual',
items: [
{ text: 'Create a new theme', link: '/en_US/developer/theme.html' },
{ text: 'l10n', link: '/en_US/developer/l10n.html' }
{ text: 'API documentation', link: '/en_US/developer/api.html' },
{ text: 'i18n', link: '/en_US/developer/i18n.html' }
]
}
]
Expand Down
14 changes: 2 additions & 12 deletions docs/developer/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

## 介绍

哪吒使用 [gettext](https://en.wikipedia.org/wiki/Gettext) 进行 i18n,请确保你对 `gettext` 有一定了解。
[可以在 Hosted Weblate 上参与哪吒的 i18n 工作。](https://hosted.weblate.org/engage/nezha/)

请使用美国英语编写原始文本。

如需添加新的文本,请遵循以下步骤:

0. 确保使用支持的翻译函数,比如 `Localizer.T`
1. 运行 `./script/i18n.sh generate template` 生成新模板。
2. 由于 `en_US` 文本不再需要翻译,运行 `./script/i18n.sh generate en` 生成 `en_US` 文本。
3. 运行 `./script/i18n.sh update` 更新所有区域的文本。
4. 编辑各个区域的 `nezha.po` 文件,之后运行 `./script/i18n.sh compile` 编译 `mo` 文件。

也可以使用诸如 `Poedit` 等翻译软件来操作,它们更加方便且几乎不需要命令行操作。
目前仅覆盖了管理前端和 Dashboard,用户前端 i18n 请根据原仓库提供的步骤进行。
10 changes: 10 additions & 0 deletions docs/en_US/developer/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# API Documentation

A bundled generated API documentation is available in Nezha Dashboard.

## Usage

1. Clone the `master` branch of `https://github.com/nezhahq/nezha.git`.
2. Run `./script/bootstrap.sh` to generate swagger files.
3. Compile. If there are missing frontend files, you can bypass it by creating empty files.
4. Enable `debug` in your Dashboard configuration, the program will print the documentation URL on startup.
7 changes: 7 additions & 0 deletions docs/en_US/developer/i18n.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# i18n

## Introduction

You can engage in the i18n work of Nezha on [Hosted Weblate](https://hosted.weblate.org/engage/nezha/).

Currently, only the admin frontend and Dashboard are covered. The i18n work for the user frontend should follow the steps provided in the original repository.
2 changes: 1 addition & 1 deletion docs/en_US/developer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ hero:
actions:
- theme: brand
text: Start Now →
link: /en_US/developer/theme
link: /en_US/developer/api
---
11 changes: 0 additions & 11 deletions docs/en_US/developer/l10n.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/en_US/developer/theme.md

This file was deleted.

0 comments on commit fff0d2a

Please sign in to comment.