From 88e072dc8e56195ece422b722d01e4d62e4c9531 Mon Sep 17 00:00:00 2001 From: Esenjin Date: Sun, 4 Feb 2024 14:56:40 +0100 Subject: [PATCH] Merci Xefir ?!! --- desktop/head_tag.html | 81 +++++++++++++++++++++++-------------------- settings.yml | 25 ++++++++++++- 2 files changed, 68 insertions(+), 38 deletions(-) diff --git a/desktop/head_tag.html b/desktop/head_tag.html index f78ac37..b1f6999 100644 --- a/desktop/head_tag.html +++ b/desktop/head_tag.html @@ -53,6 +53,7 @@ api.onToolbarCreate(toolbar => { // EXTRAS api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "bleu_color", action: "bleucolor", icon: "palette", label: "bleu_color_button" @@ -60,6 +61,7 @@ api.addToolbarPopupMenuOptionsCallback(() => { }); api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "rose_color", action: "rosecolor", icon: "palette", label: "rose_color_button" @@ -67,6 +69,7 @@ api.addToolbarPopupMenuOptionsCallback(() => { }); api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "jaune_color", action: "jaunecolor", icon: "palette", label: "jaune_color_button" @@ -74,6 +77,7 @@ api.addToolbarPopupMenuOptionsCallback(() => { }); api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "orange_color", action: "orangecolor", icon: "palette", label: "orange_color_button" @@ -81,6 +85,7 @@ api.addToolbarPopupMenuOptionsCallback(() => { }); api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "rouge_color", action: "rougecolor", icon: "palette", label: "rouge_color_button" @@ -88,6 +93,7 @@ api.addToolbarPopupMenuOptionsCallback(() => { }); api.addToolbarPopupMenuOptionsCallback(() => { return { + id: "vert_color", action: "vertcolor", icon: "palette", label: "vert_color_button" @@ -126,51 +132,52 @@ if (!translations.composer) { translations.composer = {}; } -// Define default values for buttons -const defaultButtons = { - underline_button: "Souligner", - underline_text: "Texte", +translations.composer.underline_button_title = settings.underline_button; +translations.composer.underline_text = + settings.underline_text; - strikethrough_button: "Barrer", - strikethrough_text: "Texte", +translations.composer.align_center_button_title = settings.align_center_button; +translations.composer.align_center_text = + settings.align_center_text; - superscript_button: "Exposant", - superscript_text: "Texte", +translations.composer.align_justify_button_title = settings.align_justify_button; +translations.composer.align_justify_text = + settings.align_justify_text; - subscript_button: "Indice", - subscript_text: "Texte", +translations.composer.strikethrough_button_title = settings.strikethrough_button; +translations.composer.strikethrough_text = + settings.strikethrough_text; + +translations.composer.superscript_button_title = settings.superscript_button; +translations.composer.superscript_text = + settings.superscript_text; - align_center_button: "Centrer", - align_center_text: "Texte", +translations.composer.subscript_button_title = settings.subscript_button; +translations.composer.subscript_text = + settings.subscript_text; - align_justify_button: "Justifier", - align_justify_text: "Texte", +translations.bleu_color_button = settings.bleu_color_button; +translations.composer.bleu_color_text = + settings.bleu_color_text; - // Définissez les boutons de couleur avec un traitement spécial - bleu_color_button: "Colorer en bleu", - bleu_color_text: "Texte", +translations.rose_color_button = settings.rose_color_button; +translations.composer.rose_color_text = + settings.rose_color_text; - rose_color_button: "Colorer en rose", - rose_color_text: "Texte", +translations.jaune_color_button = settings.jaune_color_button; +translations.composer.jaune_color_text = + settings.jaune_color_text; - jaune_color_button: "Colorer en jaune", - jaune_color_text: "Texte", +translations.orange_color_button = settings.orange_color_button; +translations.composer.orange_color_text = + settings.orange_color_text; - orangecolor_button: "Colorer en orange", - orangecolor_text: "Texte", +translations.rouge_color_button = settings.rouge_color_button; +translations.composer.rouge_color_text = + settings.rouge_color_text; - rouge_color_button: "Colorer en rouge", - rouge_color_text: "Texte", +translations.vert_color_button = settings.vert_color_button; +translations.composer.vert_color_text = + settings.vert_color_text; - vert_color_button: "Colorer en vert", - vert_color_text: "Texte" -}; - -// Assign default values if translations are not present -Object.keys(defaultButtons).forEach(key => { - const settingKey = key.replace("_button", ""); - translations.composer[key + "_title"] = settings[settingKey] && settings[settingKey].default ? settings[settingKey].default : defaultButtons[key]; - translations.composer[key + "_text"] = settings[key + "_text"] && settings[key + "_text"].default ? settings[key + "_text"].default : defaultButtons[key]; -}); - - + \ No newline at end of file diff --git a/settings.yml b/settings.yml index 33c9cc8..080a873 100644 --- a/settings.yml +++ b/settings.yml @@ -2,99 +2,122 @@ underline_button: default: "Souligner" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. underline_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. align_center_button: default: "Centrer" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. align_center_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. align_justify_button: default: "Justifier" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. align_justify_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. strikethrough_button: default: "Barrer" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. strikethrough_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. superscript_button: default: "Exposant" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. superscript_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. subscript_button: default: "Indice" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. subscript_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. bleu_color_button: default: "Colorer en bleu" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. bleu_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. rose_color_button: default: "Colorer en rose" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. rose_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. jaune_color_button: default: "Colorer en jaune" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. jaune_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. orange_color_button: default: "Colorer en orange" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. orange_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. rouge_color_button: default: "Colorer en rouge" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. rouge_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. vert_color_button: default: "Colorer en vert" description: en: Enter the text for the title of the button in the composer. + fr: Saisissez le texte du titre du bouton dans le compositeur. vert_color_text: default: "Texte" description: en: Enter the placeholder text that appears in the composer after the user clicks the button. - + fr: Saisissez le texte de remplacement qui apparaît dans le compositeur après que l'utilisateur a cliqué sur le bouton. Svg_icons: type: 'list' list_type: 'compact'