mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +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 => {
|
gulp.task('validate:languages', cb => {
|
||||||
const languagesPath = path.join(__dirname, 'languages');
|
const languagesPath = path.join(__dirname, 'languages');
|
||||||
const languages = fs.readdirSync(languagesPath);
|
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|
||||||
languages.forEach(lang => {
|
fs.readdirSync(languagesPath).forEach(lang => {
|
||||||
|
if (!lang.endsWith('.yml')) return;
|
||||||
const languagePath = path.join(languagesPath, lang);
|
const languagePath = path.join(languagesPath, lang);
|
||||||
try {
|
try {
|
||||||
yaml.safeLoad(fs.readFileSync(languagePath), {
|
yaml.safeLoad(fs.readFileSync(languagePath), {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Internationalization (i18n)
|
# 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
|
```yaml
|
||||||
language: en
|
language: en
|
||||||
@ -8,7 +8,7 @@ language: en
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
language:
|
language:
|
||||||
- zh-cn
|
- zh-CN
|
||||||
- en
|
- en
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user