]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/ui/index.ts
respective book and chapter structure added.
[bookstack] / resources / js / wysiwyg / ui / index.ts
index 71a2623d6aa0595205f69a8935ad2d680ffa6b59..3811f44b9bfae2a17772bcae87a4d3f89e895139 100644 (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
@@ -29,7 +32,7 @@ export function buildEditorUI(container: HTMLElement, element: HTMLElement, scro
     manager.setContext(context);
 
     // Create primary toolbar
-    manager.setToolbar(getMainEditorFullToolbar());
+    manager.setToolbar(getMainEditorFullToolbar(context));
 
     // Register modals
     for (const key of Object.keys(modals)) {