summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/js/extra.js7
-rw-r--r--public/js/locale.js1
2 files changed, 7 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 6cda6171..10c3735b 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -1,6 +1,6 @@
/* eslint-env browser, jquery */
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
-/* global moment, serverurl */
+/* global moment, serverurl, Cookies */
import Prism from 'prismjs'
import hljs from 'highlight.js'
@@ -31,6 +31,11 @@ require('../vendor/md-toc')
var Viz = require('viz.js')
const ui = getUIElements()
+if (Cookies.get('locale')) {
+ const lang = Cookies.get('locale')
+ moment.locale(lang)
+}
+
// auto update last change
window.createtime = null
window.lastchangetime = null
diff --git a/public/js/locale.js b/public/js/locale.js
index 670370d4..05c7b3e3 100644
--- a/public/js/locale.js
+++ b/public/js/locale.js
@@ -21,6 +21,7 @@ if (Cookies.get('locale')) {
}
locale.val(lang)
+window.moment.locale(lang)
$('select.ui-locale option[value="' + lang + '"]').attr('selected', 'selected')
locale.change(function () {