fix(layout): don't localize date in index pages

This commit is contained in:
ppoffice 2020-03-18 00:30:08 -04:00
parent 60ec7005b2
commit acde2ef06d
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ module.exports = class extends Component {
const { article, plugins } = config;
const { has_thumbnail, get_thumbnail, url_for, date, date_xml, __, _p } = helper;
const indexLaunguage = config.language || 'en';
const language = page.lang || page.language || config.language || 'en';
return <Fragment>
@ -56,7 +57,7 @@ module.exports = class extends Component {
{(() => {
const words = getWordCount(page._content);
const time = moment.duration((words / 150.0) * 60, 'seconds');
return `${time.locale(language).humanize()} ${__('article.read')} (${__('article.about')} ${words} ${__('article.words')})`;
return `${time.locale(index ? indexLaunguage : language).humanize()} ${__('article.read')} (${__('article.about')} ${words} ${__('article.words')})`;
})()}
</span> : null}
{/* Visitor counter */}