Skip to content

Commit

Permalink
refactor: drop lodash for i18n filter (#3810)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW authored Oct 31, 2019
1 parent c1bbac3 commit 7126202
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/plugins/filter/template_locals/i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const { Pattern } = require('hexo-util');
const _ = require('lodash');

function i18nLocalsFilter(locals) {
const { i18n } = this.theme;
Expand Down Expand Up @@ -29,7 +28,7 @@ function i18nLocalsFilter(locals) {

page.canonical_path = page.canonical_path || locals.path;

const languages = _([].concat(lang, i18nConfigLanguages, i18nLanguages)).compact().uniq().value();
const languages = [...new Set([].concat(lang, i18nConfigLanguages, i18nLanguages).filter(Boolean))];

locals.__ = i18n.__(languages);
locals._p = i18n._p(languages);
Expand Down

0 comments on commit 7126202

Please sign in to comment.