1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-12-23 23:02:08 +03:00

Lexical: Added UI translation support

This commit is contained in:
Dan Brown
2024-09-22 12:29:06 +01:00
parent 2add15bd72
commit ef3de1050f
9 changed files with 20 additions and 14 deletions

View File

@@ -19,7 +19,10 @@ export function buildEditorUI(container: HTMLElement, element: HTMLElement, scro
editorDOM: element,
scrollDOM: scrollContainer,
manager,
translate: (text: string): string => text, // TODO - Implement
translate(text: string): string {
const translations = options.translations;
return translations[text] || text;
},
error(error: string|Error): void {
const message = error instanceof Error ? error.message : error;
window.$events.error(message); // TODO - Translate