Skip to content

Commit 882f3e5

Browse files
committed
translate: Spanish provided by @NPueyo
1 parent a860d24 commit 882f3e5

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ for example `docker run --name rssbot -d -e RSSBOT_TOKEN=123456:abcdef123456-U f
7777
| proxy.host | PROXY_HOST | null | proxy host |
7878
| proxy.port | PROXY_PORT | null | proxy port |
7979

80-
language can be setting in `zh-cn` or `en`
81-
8280
fetch_gap can be setting in how many minutes or hours。m for minute, h for hour
8381

8482
for example 5m means every 5 minutes, 1h means every 1 hour
@@ -87,6 +85,14 @@ for example 5m means every 5 minutes, 1h means every 1 hour
8785

8886
translate the file in `i18n` in the another yaml and make a pull request (๑•̀ㅂ•́)و✧
8987

88+
## support language
89+
90+
set `lang` setting using one of the following language
91+
92+
- en English
93+
- zh-cn Chinese
94+
- es-es Spanish provided by @NPueyo
95+
9096
---
9197

9298
# 中文文档
@@ -186,3 +192,11 @@ viewall 只能在私聊中使用
186192
# i18n
187193

188194
`i18n`目录翻译 yaml 文件然后来个 ·pr· (๑•̀ㅂ•́)و✧
195+
196+
## support language
197+
198+
以下任意一个语言作为`lang`配置项
199+
200+
- en English
201+
- zh-cn 中文
202+
- es-es Spanish provided by @NPueyo

i18n/es-ES.yaml renamed to i18n/es-es.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ CHANNEL_ADMIN_REQUIRE: Necesitas agregar este bot como administrador del canal y
3838
YES: YES
3939
NO: NO
4040
CANCEL: Cancelar
41+
PAGE_PRE: pagina anterior
42+
PAGE_NEXT: siguiente página

i18n/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ const path = require('path');
44
const config = require('../config');
55
const yamlPath = path.join(__dirname, `${config.lang}.yaml`);
66

7+
let base = fs.readFileSync(path.join(__dirname, 'en.yaml'), {
8+
encoding: 'utf-8'
9+
});
10+
base = yaml.safeLoad(base);
11+
712
const yamlStr = fs.readFileSync(yamlPath, {
813
encoding: 'utf-8'
914
});
1015

11-
module.exports = yaml.safeLoad(yamlStr);
16+
module.exports = Object.assign(base, yaml.safeLoad(yamlStr));

0 commit comments

Comments
 (0)