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 @@
name: "heading",
action: SimpleMDE.toogleHeadingSmaller,
className: "fa fa-header",
title: "Heading"
title: "{{ translations.heading }}"
},
{
name: "italic",
action: SimpleMDE.toggleItalic,
className: "fa fa-italic",
title: "Italic"
title: "{{ translations.italic }}"
},
{
name: "bold",
action: SimpleMDE.toggleBold,
className: "fa fa-bold",
title: "Bold"
title: "{{ translations.bold }}"
},
{
name: "strikethrough",
action: SimpleMDE.toggleStrikethrough,
className: "fa fa-strikethrough",
title: "Strikethrough"
title: "{{ translations.strikethrough }}"
},
{
name: "underline",
......@@ -83,102 +83,102 @@
cm.replaceSelection('__' + cm.getSelection() + '__');
},
className: "fa fa-underline",
title: "Underline"
title: "{{ translations.underline }}"
},
{
name: "sup",
name: "superscript",
action: function customFunction(editor){
var cm = editor.codemirror;
cm.replaceSelection('<sup>' + cm.getSelection() + '</sup>');
},
className: "fa fa-superscript",
title: "Sup"
title: "{{ translations.superscript }}"
},
{
name: "sub",
name: "subscript",
action: function customFunction(editor){
var cm = editor.codemirror;
cm.replaceSelection('<sub>' + cm.getSelection() + '</sub>');
},
className: "fa fa-subscript",
title: "Sub"
title: "{{ translations.subscript }}"
},
{
name: "code",
action: SimpleMDE.toggleCodeBlock,
className: "fa fa-code",
title: "Code"
title: "{{ translations.code }}"
},
"|",
{
name: "quote",
action: SimpleMDE.toggleBlockquote,
className: "fa fa-quote-left",
title: "Quote"
title: "{{ translations.quote }}"
},
{
name: "unordered-list",
action: SimpleMDE.toggleUnorderedList,
className: "fa fa-list-ul",
title: "Generic List"
title: "{{ translations.unordered_list }}"
},
{
name: "ordered-list",
action: SimpleMDE.toggleOrderedList,
className: "fa fa-list-ol",
title: "Numbered List"
title: "{{ translations.ordered_list }}"
},
"|",
{
name: "link",
action: SimpleMDE.drawLink,
className: "fa fa-link",
title: "Create Link"
title: "{{ translations.link }}"
},
{
name: "image",
action: SimpleMDE.drawImage,
className: "fa fa-picture-o",
title: "Insert Image"
title: "{{ translations.image }}"
},
{
name: "table",
action: SimpleMDE.drawTable,
className: "fa fa-table",
title: "Insert Table"
title: "{{ translations.table }}"
},
"|",
{
name: "clean-block",
action: SimpleMDE.cleanBlock,
className: "fa fa-eraser fa-clean-block",
title: "Clean block"
title: "{{ translations.clean_block }}"
},
"|",
{
name: "preview",
action: SimpleMDE.togglePreview,
className: "fa fa-eye no-disable",
title: "Toggle Preview"
title: "{{ translations.preview }}"
},
{
name: "side-by-side",
action: SimpleMDE.toggleSideBySide,
className: "fa fa-columns no-disable no-mobile",
title: "Toggle Side by Side"
title: "{{ translations.side_by_side }}"
},
{
name: "fullscreen",
action: SimpleMDE.toggleFullScreen,
className: "fa fa-arrows-alt no-disable no-mobile",
title: "Toggle Fullscreen"
title: "{{ translations.fullscreen }}"
},
"|",
{
name: "guide",
action: "/page/Aide_sur_la_syntaxe",
className: "fa fa-question-circle",
title: "Markdown Guide"
title: "{{ translations.guide }}"
},
]
});
......
......@@ -101,6 +101,27 @@ class MarkdownInput(Textarea):
"js": static("core/simplemde/simplemde.min.js"),
"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")
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