From: Alexander Ebert Date: Thu, 27 Apr 2023 15:15:04 +0000 (+0200) Subject: Add the phrase for the spoiler button X-Git-Tag: 6.0.0_Alpha_1~185 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=16270c605abfbb45ad9df61197b001e99a3f9eb4;p=GitHub%2FWoltLab%2FWCF.git Add the phrase for the spoiler button See WoltLab/editor#35 --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 6d44038537..df4ebee570 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -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}'); diff --git a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts index 3c06171ff3..fb5eebc37a 100644 --- a/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts +++ b/ts/WoltLabSuite/Core/Component/Ckeditor/Configuration.ts @@ -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: { diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 6d44038537..df4ebee570 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -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}'); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js index 8205f37ec5..bbf535d360 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor/Configuration.js @@ -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: {