vois-je le bout du tunnel ?

This commit is contained in:
Esenjin 2024-02-03 12:45:27 +01:00
parent 07f7c09923
commit a805ec15d2

View File

@ -126,52 +126,49 @@ if (!translations.composer) {
translations.composer = {};
}
translations.composer.underline_button_title = settings.underline_button;
translations.composer.underline_text =
settings.underline_text;
// Define default values for buttons
const defaultButtons = {
underline_button: "Souligner",
underline_text: "Texte",
translations.composer.align_center_button_title = settings.align_center_button;
translations.composer.align_center_text =
settings.align_center_text;
strikethrough_button: "Barrer",
strikethrough_text: "Texte",
translations.composer.align_justify_button_title = settings.align_justify_button;
translations.composer.align_justify_text =
settings.align_justify_text;
superscript_button: "Exposant",
superscript_text: "Texte",
translations.composer.strikethrough_button_title = settings.strikethrough_button;
translations.composer.strikethrough_text =
settings.strikethrough_text;
subscript_button: "Indice",
subscript_text: "Texte",
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.composer.bleu_color_button_title = settings.bleu_color_button.default;
translations.composer.bleu_color_text =
settings.bleu_color_text;
bleu_color_button: "Colorer en bleu",
bleu_color_text: "Texte",
translations.composer.rose_color_button_title = settings.rose_color_button.default;
translations.composer.rose_color_text =
settings.rose_color_text;
rose_color_button: "Colorer en rose",
rose_color_text: "Texte",
translations.composer.jaune_color_button_title = settings.jaune_color_button.default;
translations.composer.jaune_color_text =
settings.jaune_color_text;
jaune_color_button: "Colorer en jaune",
jaune_color_text: "Texte",
translations.composer.orange_color_button_title = settings.orange_color_button.default;
translations.composer.orange_color_text =
settings.orange_color_text;
orangecolor_button: "Colorer en orange",
orangecolor_text: "Texte",
translations.composer.rouge_color_button_title = settings.rouge_color_button.default;
translations.composer.rouge_color_text =
settings.rouge_color_text;
rouge_color_button: "Colorer en rouge",
rouge_color_text: "Texte",
translations.composer.vert_color_button_title = settings.vert_color_button.default;
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 => {
translations.composer[key + "_title"] = settings[key] ? settings[key].default : defaultButtons[key];
translations.composer[key + "_text"] = settings[key + "_text"] ? settings[key + "_text"].default : defaultButtons[key];
});
</script>