From 898e7b9cabaf696cb53870b3ce88420c43fd888d Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Fri, 22 May 2020 13:19:13 +0800 Subject: [PATCH] Fix docs & test for i18n --- gulpfile.js | 4 ++-- languages/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1906642..6a39a1b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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), { diff --git a/languages/README.md b/languages/README.md index 60685a4..b75bb74 100644 --- a/languages/README.md +++ b/languages/README.md @@ -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 ```