mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
better linting (#72)
Improve linting and fix linting errors Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
efb6513205
commit
eba59ae622
70 changed files with 2413 additions and 1867 deletions
|
@ -1,54 +1,52 @@
|
|||
import i18n from 'i18next';
|
||||
import Backend from 'i18next-http-backend';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import {initReactI18next} from 'react-i18next';
|
||||
import moment from "moment";
|
||||
import "moment/locale/ar";
|
||||
import "moment/locale/ca";
|
||||
import "moment/locale/cs";
|
||||
import "moment/locale/da";
|
||||
import "moment/locale/de";
|
||||
import "moment/locale/el";
|
||||
import "moment/locale/eo";
|
||||
import "moment/locale/es";
|
||||
import "moment/locale/fr";
|
||||
import "moment/locale/hi";
|
||||
import "moment/locale/hr";
|
||||
import "moment/locale/id";
|
||||
import "moment/locale/it";
|
||||
import "moment/locale/ja";
|
||||
import "moment/locale/ko";
|
||||
import "moment/locale/nl";
|
||||
import "moment/locale/pl";
|
||||
import "moment/locale/pt";
|
||||
import "moment/locale/ru";
|
||||
import "moment/locale/sk";
|
||||
import "moment/locale/sr";
|
||||
import "moment/locale/sv";
|
||||
import "moment/locale/tr";
|
||||
import "moment/locale/uk";
|
||||
import "moment/locale/vi";
|
||||
import "moment/locale/zh-cn";
|
||||
import "moment/locale/zh-tw";
|
||||
import i18n from 'i18next'
|
||||
import Backend from 'i18next-http-backend'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
import { initReactI18next } from 'react-i18next'
|
||||
import moment from 'moment'
|
||||
import 'moment/locale/ar'
|
||||
import 'moment/locale/ca'
|
||||
import 'moment/locale/cs'
|
||||
import 'moment/locale/da'
|
||||
import 'moment/locale/de'
|
||||
import 'moment/locale/el'
|
||||
import 'moment/locale/eo'
|
||||
import 'moment/locale/es'
|
||||
import 'moment/locale/fr'
|
||||
import 'moment/locale/hi'
|
||||
import 'moment/locale/hr'
|
||||
import 'moment/locale/id'
|
||||
import 'moment/locale/it'
|
||||
import 'moment/locale/ja'
|
||||
import 'moment/locale/ko'
|
||||
import 'moment/locale/nl'
|
||||
import 'moment/locale/pl'
|
||||
import 'moment/locale/pt'
|
||||
import 'moment/locale/ru'
|
||||
import 'moment/locale/sk'
|
||||
import 'moment/locale/sr'
|
||||
import 'moment/locale/sv'
|
||||
import 'moment/locale/tr'
|
||||
import 'moment/locale/uk'
|
||||
import 'moment/locale/vi'
|
||||
import 'moment/locale/zh-cn'
|
||||
import 'moment/locale/zh-tw'
|
||||
|
||||
export async function setUpI18n() {
|
||||
await i18n
|
||||
.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
fallbackLng: 'en',
|
||||
debug: true,
|
||||
backend: {
|
||||
loadPath: '/locales/{{lng}}.json',
|
||||
},
|
||||
export const setUpI18n: () => Promise<void> = async () => {
|
||||
await i18n
|
||||
.use(Backend)
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
fallbackLng: 'en',
|
||||
debug: true,
|
||||
backend: {
|
||||
loadPath: '/locales/{{lng}}.json'
|
||||
},
|
||||
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
})
|
||||
interpolation: {
|
||||
escapeValue: false // not needed for react as it escapes by default
|
||||
}
|
||||
})
|
||||
|
||||
moment.locale(i18n.language);
|
||||
moment.locale(i18n.language)
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue