mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
Update dependency i18next to v21.5.2 (#1643)
* Update dependency i18next to v21.5.2 Signed-off-by: Renovate Bot <bot@renovateapp.com> * Fix i18n imports Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
29e646e180
commit
c75978c9a4
5 changed files with 11 additions and 12 deletions
|
@ -5,15 +5,14 @@
|
|||
*/
|
||||
|
||||
import type { ResourceKey } from 'i18next'
|
||||
import i18n from 'i18next'
|
||||
import i18n, { use as i18nUse } from 'i18next'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
import resourcesToBackend from 'i18next-resources-to-backend'
|
||||
import { Settings } from 'luxon'
|
||||
import { initReactI18next } from 'react-i18next'
|
||||
|
||||
export const setUpI18n = async (): Promise<void> => {
|
||||
await i18n
|
||||
.use(
|
||||
await i18nUse(
|
||||
resourcesToBackend((language, namespace, callback) => {
|
||||
import(`../../../../../locales/${language}.json`)
|
||||
.then((resources: ResourceKey) => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import type { Editor } from 'codemirror'
|
||||
import i18n from 'i18next'
|
||||
import { t } from 'i18next'
|
||||
import { uploadFile } from '../../../api/media'
|
||||
import { store } from '../../../redux'
|
||||
import { supportedMimeTypes } from '../../common/upload-image-mimetypes'
|
||||
|
@ -22,7 +22,7 @@ export const handleUpload = (file: File, editor: Editor): void => {
|
|||
return
|
||||
}
|
||||
const cursor = editor.getCursor()
|
||||
const uploadPlaceholder = `![${i18n.t('editor.upload.uploadFile', { fileName: file.name })}]()`
|
||||
const uploadPlaceholder = `![${t('editor.upload.uploadFile', { fileName: file.name })}]()`
|
||||
const noteId = store.getState().noteDetails.id
|
||||
const insertCode = (replacement: string) => {
|
||||
editor.replaceRange(replacement, cursor, { line: cursor.line, ch: cursor.ch + uploadPlaceholder.length }, '+input')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue