 
             markupSet: [
                 {
-                    name: $i18next.t('markdown-editor.heading-1')
+                    name: $tr.t("markdown-editor.heading-1")
                     key: "1"
-                    placeHolder: $i18next.t('markdown-editor.placeholder')
-                    closeWith: (markItUp) -> markdownTitle(markItUp, '=')
-                },
-                {
-                    name: $i18next.t('markdown-editor.heading-2')
+                    placeHolder: $tr.t("markdown-editor.placeholder")
+                    closeWith: (markItUp) -> markdownTitle(markItUp, "=")
+                },
+                {
+                    name: $tr.t("markdown-editor.heading-2")
                     key: "2"
-                    placeHolder: $i18next.t('markdown-editor.placeholder')
-                    closeWith: (markItUp) -> markdownTitle(markItUp, '-')
-                },
-                {
-                    name: $i18next.t('markdown-editor.heading-3')
+                    placeHolder: $tr.t("markdown-editor.placeholder")
+                    closeWith: (markItUp) -> markdownTitle(markItUp, "-")
+                },
+                {
+                    name: $tr.t("markdown-editor.heading-3")
                     key: "3"
-                    openWith: '### '
-                    placeHolder: $i18next.t('markdown-editor.placeholder')
-                },
-                {
-                    separator: '---------------'
-                },
-                {
-                    name: $i18next.t('markdown-editor.bold')
+                    openWith: "### "
+                    placeHolder: $tr.t("markdown-editor.placeholder")
+                },
+                {
+                    separator: '---------------'
+                },
+                {
+                    name: $tr.t("markdown-editor.bold")
                     key: "B"
                     openWith: '**'
                     closeWith: '**'
                 },
                 {
-                    name: $i18next.t('markdown-editor.italic')
+                    name: $tr.t("markdown-editor.italic")
                     key: "I"
                     openWith: '_'
                     closeWith: '_'
                 },
                 {
-                    name: $i18next.t('markdown-editor.strike')
+                    name: $tr.t("markdown-editor.strike")
                     key: "S"
                     openWith: '~~'
                     closeWith: '~~'

#############################################################################
## WYSIWYG markitup editor directive
#############################################################################

# TODO: fix when i18n is implemented
$i18next = {
    t: (key) ->
        keywords = {
            "markdown-editor.heading-1": "First Level Heading",
            "markdown-editor.heading-2": "Second Level Heading",
            "markdown-editor.heading-3": "Third Level Heading",
            "markdown-editor.bold": "Bold",
            "markdown-editor.italic": "Italic",
            "markdown-editor.strike": "Strike",
            "markdown-editor.bulleted-list": "Bulleted List",
            "markdown-editor.numeric-list": "Numeric List",
            "markdown-editor.picture": "Picture",
            "markdown-editor.link": "Link",
            "markdown-editor.quotes": "Quotes",
            "markdown-editor.code-block": "Code Block / Code",
            "markdown-editor.preview": "Preview",
            "markdown-editor.help": "Help",
            "markdown-editor.placeholder": "Your title here...",
            "markdown-editor.link-placeholder": "Your text to link here..."
        }
        return keywords[key] or key
}

tgMarkitupDirective = ($rootscope, $rs) ->
    previewTemplate = _.template("""
    <div class="preview">
        <div class="actions">

                    separator: '---------------'
                },
                {
                    name: $tr.t("markdown-editor.bulleted-list")
                    openWith: "- "
                },
                {
                    name: $tr.t("markdown-editor.numeric-list")
                    openWith: (markItUp) -> markItUp.line+". "
                },
                {
                    separator: '---------------'
                },
                {
                    name: $tr.t("markdown-editor.picture")
                    key: "P"
                    replaceWith: '![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'
                },
                {
                    name: $tr.t("markdown-editor.link")
                    key: "L"
                    openWith: '['
                    closeWith: ']([![Url:!:http://]!] "[![Title]!]")'
                    placeHolder: $tr.t("markdown-editor.link-placeholder")
                },
                {
                    separator: '---------------'
                },
                {
                    name: $tr.t("markdown-editor.quotes")
                    openWith: "> "
                },
                {
                    name: $tr.t("markdown-editor.code-block")
                    openWith: "```\n"
                    closeWith: "\n```"
                },
                {
                    separator: '---------------'
                },
                {
                    name: $tr.t("markdown-editor.preview")
                    call: preview
                    className: "preview-icon"
                },
