mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
Restructured locale.js to be included into the editor's js bundle
Until now client-side translations were only possible in the context of the intro/history page, because the locale-detection logic relied on the language selector as a source of available languages. The editor of course has no such selector. With this commit, I copied the list of available languages from the i18n-initialization (server-side) to support language detection in the editor too. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
ce469b1e2d
commit
da35e73346
2 changed files with 34 additions and 31 deletions
|
@ -1,6 +1,6 @@
|
|||
/* eslint-env browser, jquery */
|
||||
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
||||
/* global moment, serverurl, Cookies */
|
||||
/* global moment, serverurl */
|
||||
|
||||
import Prism from 'prismjs'
|
||||
import hljs from 'highlight.js'
|
||||
|
@ -27,15 +27,11 @@ require('prismjs/components/prism-makefile')
|
|||
require('prismjs/components/prism-gherkin')
|
||||
|
||||
require('./lib/common/login')
|
||||
require('./locale')
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue