Fix docs & test for i18n

This commit is contained in:
Mimi 2020-05-22 13:19:13 +08:00
parent 36808b95ea
commit 898e7b9cab
2 changed files with 4 additions and 4 deletions

View File

@ -25,10 +25,10 @@ gulp.task('validate:config', cb => {
gulp.task('validate:languages', cb => {
const languagesPath = path.join(__dirname, 'languages');
const languages = fs.readdirSync(languagesPath);
const errors = [];
languages.forEach(lang => {
fs.readdirSync(languagesPath).forEach(lang => {
if (!lang.endsWith('.yml')) return;
const languagePath = path.join(languagesPath, lang);
try {
yaml.safeLoad(fs.readFileSync(languagePath), {

View File

@ -1,6 +1,6 @@
# Internationalization (i18n)
You can use internationalization to present your site in different languages. The default language is set by modifying the `language` setting in `_config.yml`. You can also set multiple languages and modify the order of default languages.
You can use internationalization to present your site in different languages. The default language is set by modifying the `language` setting in Hexo `_config.yml`. You can also set multiple languages and modify the order of default languages.
```yaml
language: en
@ -8,7 +8,7 @@ language: en
```yaml
language:
- zh-cn
- zh-CN
- en
```