mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Fix docs & test for i18n
This commit is contained in:
parent
36808b95ea
commit
898e7b9cab
@ -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), {
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user