Add the phrase for the spoiler button
authorAlexander Ebert <ebert@woltlab.com>
Thu, 27 Apr 2023 15:15:04 +0000 (17:15 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 27 Apr 2023 15:15:04 +0000 (17:15 +0200)
See WoltLab/editor#35

com.woltlab.wcf/templates/wysiwyg.tpl
ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js

index 6d44038537b0dae8c90b0581a181e1f8f6beb61a..df4ebee570fd4ae2ca81211606e3006a25122df2 100644 (file)
@@ -12,6 +12,7 @@
                {jsphrase name='wcf.editor.button.group.block'}
                {jsphrase name='wcf.editor.button.group.format'}
                {jsphrase name='wcf.editor.button.group.list'}
+               {jsphrase name='wcf.editor.button.spoiler'}
                {jsphrase name='wcf.editor.restoreDraft'}
 
                const element = document.getElementById('{$wysiwygSelector|encodeJS}');
index 3c06171ff3fe2a7219ecb230fe60472f035a3945..fb5eebc37acc991bf14b5590675b0e7a00e8b133 100644 (file)
@@ -242,6 +242,9 @@ class ConfigurationBuilder {
   toConfig(): EditorConfig {
     const language = Object.keys(window.CKEDITOR_TRANSLATIONS).find((language) => language !== "en");
 
+    const key = language ? language : "en";
+    window.CKEDITOR_TRANSLATIONS[key].dictionary["Spoiler"] = getPhrase("wcf.editor.button.spoiler");
+
     // TODO: The typings are both incompleted and outdated.
     return {
       alignment: {
index 6d44038537b0dae8c90b0581a181e1f8f6beb61a..df4ebee570fd4ae2ca81211606e3006a25122df2 100644 (file)
@@ -12,6 +12,7 @@
                {jsphrase name='wcf.editor.button.group.block'}
                {jsphrase name='wcf.editor.button.group.format'}
                {jsphrase name='wcf.editor.button.group.list'}
+               {jsphrase name='wcf.editor.button.spoiler'}
                {jsphrase name='wcf.editor.restoreDraft'}
 
                const element = document.getElementById('{$wysiwygSelector|encodeJS}');
index 8205f37ec5051f70f2c9171485f1870dab14bfe8..bbf535d3602196d131941f818b7e74ff233d6090 100644 (file)
@@ -209,6 +209,8 @@ define(["require", "exports", "../../Language"], function (require, exports, Lan
         }
         toConfig() {
             const language = Object.keys(window.CKEDITOR_TRANSLATIONS).find((language) => language !== "en");
+            const key = language ? language : "en";
+            window.CKEDITOR_TRANSLATIONS[key].dictionary["Spoiler"] = (0, Language_1.getPhrase)("wcf.editor.button.spoiler");
             // TODO: The typings are both incompleted and outdated.
             return {
                 alignment: {