mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
完善翻译
This commit is contained in:
1 parent
7d3bdc2dd1
commit
2d3cee7753
13 files changed
+1308
-1280
No files matched your search
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import fs from 'fs';
|
||||
import webpack from 'webpack';
|
||||
import root from './utils/root';
|
||||
import webpackConfig from './config/webpack';
|
||||
|
||||
export default function ({ watch, production }) {
|
||||
@@ -13,7 +11,6 @@ export default function ({ watch, production }) {
|
||||
if (err.details) console.error(err.details);
|
||||
process.exit(1);
|
||||
}
|
||||
fs.writeFileSync(root('./.webpackStats.json'), JSON.stringify(stats.toJson(), null, 2));
|
||||
if (!watch && stats.hasErrors()) process.exitCode = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import { AutoloadPage } from 'vj/misc/PageLoader';
|
||||
|
||||
import i18n from 'vj/utils/i18n';
|
||||
|
||||
timeago.register(i18n('timeago_locale'));
|
||||
const locales = require.context('timeago.js/lib/lang', false, /\.js$/);
|
||||
timeago.register(i18n('timeago_locale'), locales(`./${i18n('timeago_locale')}.js`).default);
|
||||
|
||||
function runRelativeTime($container) {
|
||||
$container.find('span.time.relative[data-timestamp]').get().forEach((element) => {
|
||||
@@ -15,7 +16,7 @@ function runRelativeTime($container) {
|
||||
$element.attr('data-tooltip', $element.text());
|
||||
$element.attr('datetime', ($element.attr('data-timestamp') || 0) * 1000);
|
||||
$element.attr('data-has-timeago', '1');
|
||||
timeago.render(element);
|
||||
timeago.render(element, i18n('timeago_locale'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user