Commit 542a2ede authored by Sli's avatar Sli

core: translations for MarkdownInupt

parent ea538dba
Pipeline #1670 passed with stage
in 13 minutes and 6 seconds
...@@ -56,25 +56,25 @@ ...@@ -56,25 +56,25 @@
name: "heading", name: "heading",
action: SimpleMDE.toogleHeadingSmaller, action: SimpleMDE.toogleHeadingSmaller,
className: "fa fa-header", className: "fa fa-header",
title: "Heading" title: "{{ translations.heading }}"
}, },
{ {
name: "italic", name: "italic",
action: SimpleMDE.toggleItalic, action: SimpleMDE.toggleItalic,
className: "fa fa-italic", className: "fa fa-italic",
title: "Italic" title: "{{ translations.italic }}"
}, },
{ {
name: "bold", name: "bold",
action: SimpleMDE.toggleBold, action: SimpleMDE.toggleBold,
className: "fa fa-bold", className: "fa fa-bold",
title: "Bold" title: "{{ translations.bold }}"
}, },
{ {
name: "strikethrough", name: "strikethrough",
action: SimpleMDE.toggleStrikethrough, action: SimpleMDE.toggleStrikethrough,
className: "fa fa-strikethrough", className: "fa fa-strikethrough",
title: "Strikethrough" title: "{{ translations.strikethrough }}"
}, },
{ {
name: "underline", name: "underline",
...@@ -83,102 +83,102 @@ ...@@ -83,102 +83,102 @@
cm.replaceSelection('__' + cm.getSelection() + '__'); cm.replaceSelection('__' + cm.getSelection() + '__');
}, },
className: "fa fa-underline", className: "fa fa-underline",
title: "Underline" title: "{{ translations.underline }}"
}, },
{ {
name: "sup", name: "superscript",
action: function customFunction(editor){ action: function customFunction(editor){
var cm = editor.codemirror; var cm = editor.codemirror;
cm.replaceSelection('<sup>' + cm.getSelection() + '</sup>'); cm.replaceSelection('<sup>' + cm.getSelection() + '</sup>');
}, },
className: "fa fa-superscript", className: "fa fa-superscript",
title: "Sup" title: "{{ translations.superscript }}"
}, },
{ {
name: "sub", name: "subscript",
action: function customFunction(editor){ action: function customFunction(editor){
var cm = editor.codemirror; var cm = editor.codemirror;
cm.replaceSelection('<sub>' + cm.getSelection() + '</sub>'); cm.replaceSelection('<sub>' + cm.getSelection() + '</sub>');
}, },
className: "fa fa-subscript", className: "fa fa-subscript",
title: "Sub" title: "{{ translations.subscript }}"
}, },
{ {
name: "code", name: "code",
action: SimpleMDE.toggleCodeBlock, action: SimpleMDE.toggleCodeBlock,
className: "fa fa-code", className: "fa fa-code",
title: "Code" title: "{{ translations.code }}"
}, },
"|", "|",
{ {
name: "quote", name: "quote",
action: SimpleMDE.toggleBlockquote, action: SimpleMDE.toggleBlockquote,
className: "fa fa-quote-left", className: "fa fa-quote-left",
title: "Quote" title: "{{ translations.quote }}"
}, },
{ {
name: "unordered-list", name: "unordered-list",
action: SimpleMDE.toggleUnorderedList, action: SimpleMDE.toggleUnorderedList,
className: "fa fa-list-ul", className: "fa fa-list-ul",
title: "Generic List" title: "{{ translations.unordered_list }}"
}, },
{ {
name: "ordered-list", name: "ordered-list",
action: SimpleMDE.toggleOrderedList, action: SimpleMDE.toggleOrderedList,
className: "fa fa-list-ol", className: "fa fa-list-ol",
title: "Numbered List" title: "{{ translations.ordered_list }}"
}, },
"|", "|",
{ {
name: "link", name: "link",
action: SimpleMDE.drawLink, action: SimpleMDE.drawLink,
className: "fa fa-link", className: "fa fa-link",
title: "Create Link" title: "{{ translations.link }}"
}, },
{ {
name: "image", name: "image",
action: SimpleMDE.drawImage, action: SimpleMDE.drawImage,
className: "fa fa-picture-o", className: "fa fa-picture-o",
title: "Insert Image" title: "{{ translations.image }}"
}, },
{ {
name: "table", name: "table",
action: SimpleMDE.drawTable, action: SimpleMDE.drawTable,
className: "fa fa-table", className: "fa fa-table",
title: "Insert Table" title: "{{ translations.table }}"
}, },
"|", "|",
{ {
name: "clean-block", name: "clean-block",
action: SimpleMDE.cleanBlock, action: SimpleMDE.cleanBlock,
className: "fa fa-eraser fa-clean-block", className: "fa fa-eraser fa-clean-block",
title: "Clean block" title: "{{ translations.clean_block }}"
}, },
"|", "|",
{ {
name: "preview", name: "preview",
action: SimpleMDE.togglePreview, action: SimpleMDE.togglePreview,
className: "fa fa-eye no-disable", className: "fa fa-eye no-disable",
title: "Toggle Preview" title: "{{ translations.preview }}"
}, },
{ {
name: "side-by-side", name: "side-by-side",
action: SimpleMDE.toggleSideBySide, action: SimpleMDE.toggleSideBySide,
className: "fa fa-columns no-disable no-mobile", className: "fa fa-columns no-disable no-mobile",
title: "Toggle Side by Side" title: "{{ translations.side_by_side }}"
}, },
{ {
name: "fullscreen", name: "fullscreen",
action: SimpleMDE.toggleFullScreen, action: SimpleMDE.toggleFullScreen,
className: "fa fa-arrows-alt no-disable no-mobile", className: "fa fa-arrows-alt no-disable no-mobile",
title: "Toggle Fullscreen" title: "{{ translations.fullscreen }}"
}, },
"|", "|",
{ {
name: "guide", name: "guide",
action: "/page/Aide_sur_la_syntaxe", action: "/page/Aide_sur_la_syntaxe",
className: "fa fa-question-circle", className: "fa fa-question-circle",
title: "Markdown Guide" title: "{{ translations.guide }}"
}, },
] ]
}); });
......
...@@ -101,6 +101,27 @@ class MarkdownInput(Textarea): ...@@ -101,6 +101,27 @@ class MarkdownInput(Textarea):
"js": static("core/simplemde/simplemde.min.js"), "js": static("core/simplemde/simplemde.min.js"),
"css": static("core/simplemde/simplemde.min.css"), "css": static("core/simplemde/simplemde.min.css"),
} }
context["translations"] = {
"heading": _("Heading"),
"italic": _("Italic"),
"bold": _("Bold"),
"strikethrough": _("Strikethrough"),
"underline": _("Underline"),
"superscript": _("Superscript"),
"subscript": _("Subscript"),
"code": _("Code"),
"quote": _("Quote"),
"unordered_list": _("Unordered list"),
"ordered_list": _("Ordered list"),
"image": _("Insert image"),
"link": _("Insert link"),
"table": _("Insert table"),
"clean_block": _("Clean block"),
"preview": _("Toggle preview"),
"side_by_side": _("Toggle side by side"),
"fullscreen": _("Toggle fullscreen"),
"guide": _("Markdown guide"),
}
context["markdown_api_url"] = reverse("api:api_markdown") context["markdown_api_url"] = reverse("api:api_markdown")
return context return context
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment