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 ```