Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tcitry/go-i18n-demo
https://github.com/tcitry/go-i18n-demo
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tcitry/go-i18n-demo
- Owner: tcitry
- Created: 2021-06-28T13:13:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-29T02:39:18.000Z (over 3 years ago)
- Last Synced: 2024-11-08T08:55:12.130Z (2 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 操作步骤
1. 安装`goi18n`命令
```
go get -u github.com/nicksnyder/go-i18n/v2/goi18n
```2. 生成英文模板 `active.en.toml`
```
goi18n extract
```3. 根据英文生成中文模板
```
goi18n merge active.*.toml
```4. 根据中文模板进行翻译,最后进行合并
```
goi18n merge active.*.toml translate.*.toml
```(踩了一坑:命名为 active.cn.toml 的话翻译无效)