An open API service indexing awesome lists of open source software.

https://github.com/cfug/translator_bot


https://github.com/cfug/translator_bot

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

> [!WARNING]
> 目前处于 Beta 阶段。

CFUG Translator Bot


Translator Bot v0.0.1
Dart v3.7.2
Gemini 2.0 flash

使用 `Gemini` AI 翻译处理指定文档。

适用仓库:
- [cfug/flutter.cn](https://github.com/cfug/flutter.cn/blob/main/.github/workflows/translator_bot.yml)
- [cfug/dart.cn](https://github.com/cfug/dart.cn/blob/main/.github/workflows/translator_bot.yml)

## 配置

在需要使用的仓库中配置 [Github Action](./.github/workflows/translator_bot_template.yml)。

## 使用

在适用仓库的 issue 中评论来调用指令:

```md
# 评论:/translator-bot 仓库中文件的位置
/translator-bot ./src/xx.md
```

## 维护

### Prompt 调试

访问:https://aistudio.google.com/

### 本地调试

在根目录新建 `.env` 文件(注意不要上传到公共环境),并添加以下内容:
```
GH_TOKEN = xxxxxxx
GEMINI_API_KEY = xxxxxxx
```

调用以下指令:
```bash
$ dart bin/translator.dart --dry-run --repository username/repo --actionId 0 --issueId 0 --commentId 0 --filePath xxxxxx
```