Skip to content

Commit

Permalink
🐛 修复判断语言不支持列表的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zkqiang committed Dec 23, 2020
1 parent a1ab213 commit add83d6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/events/lib/compatible-configs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = (hexo) => {
const isZh = hexo.config.language.search(/zh-CN/i) !== -1;
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;

// Breaking change at v1.8.3 2020/09/03
if (hexo.theme.config.highlight && !hexo.theme.config.code) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/events/lib/hello.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = (hexo) => {
const isZh = hexo.config.language.search(/zh-CN/i) !== -1;
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
if (isZh) {
hexo.log.info(`
------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/events/lib/merge-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = (hexo) => {
if (data && data.fluid_config) {
dataConfig = data.fluid_config;
} else if (!configFromRoot(hexo)) {
const isZh = hexo.config.language.search(/zh-CN/i) !== -1;
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
if (isZh) {
hexo.log.warn('[Fluid] 推荐你使用覆盖配置功能: https://hexo.fluid-dev.com/docs/guide/#%E8%A6%86%E7%9B%96%E9%85%8D%E7%BD%AE');
} else {
Expand Down
2 changes: 1 addition & 1 deletion scripts/events/lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = (hexo) => {
const https = require('https');
const path = require('path');
const { version } = require(path.normalize(path.join(hexo.theme_dir, 'package.json')));
const isZh = hexo.config.language.search(/zh-CN/i) !== -1;
const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;

const errorLog = (_) => {
if (isZh) {
Expand Down

0 comments on commit add83d6

Please sign in to comment.