From 66abe776d127b7f8a082ff2735939d1dd40ab12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Fri, 26 Sep 2014 12:55:54 +0200 Subject: [PATCH] Fix bug #1103 --- app/coffee/modules/common/wisiwyg.coffee | 59 ++++++++++++++++-------- app/locales/en/app.json | 28 +++++++++-- 2 files changed, 63 insertions(+), 24 deletions(-) diff --git a/app/coffee/modules/common/wisiwyg.coffee b/app/coffee/modules/common/wisiwyg.coffee index b0b7b923..24a45b54 100644 --- a/app/coffee/modules/common/wisiwyg.coffee +++ b/app/coffee/modules/common/wisiwyg.coffee @@ -30,7 +30,28 @@ module = angular.module("taigaCommon") ############################################################################# # TODO: fix when i18n is implemented -$i18next = {t: (key) -> key} +$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(""" @@ -148,40 +169,40 @@ tgMarkitupDirective = ($rootscope, $rs) -> markupSet: [ { - name: $i18next.t('wiki-editor.heading-1') + name: $i18next.t('markdown-editor.heading-1') key: "1" - placeHolder: $i18next.t('wiki-editor.placeholder') + placeHolder: $i18next.t('markdown-editor.placeholder') closeWith: (markItUp) -> markdownTitle(markItUp, '=') }, { - name: $i18next.t('wiki-editor.heading-2') + name: $i18next.t('markdown-editor.heading-2') key: "2" - placeHolder: $i18next.t('wiki-editor.placeholder') + placeHolder: $i18next.t('markdown-editor.placeholder') closeWith: (markItUp) -> markdownTitle(markItUp, '-') }, { - name: $i18next.t('wiki-editor.heading-3') + name: $i18next.t('markdown-editor.heading-3') key: "3" openWith: '### ' - placeHolder: $i18next.t('wiki-editor.placeholder') + placeHolder: $i18next.t('markdown-editor.placeholder') }, { separator: '---------------' }, { - name: $i18next.t('wiki-editor.bold') + name: $i18next.t('markdown-editor.bold') key: "B" openWith: '**' closeWith: '**' }, { - name: $i18next.t('wiki-editor.italic') + name: $i18next.t('markdown-editor.italic') key: "I" openWith: '_' closeWith: '_' }, { - name: $i18next.t('wiki-editor.strike') + name: $i18next.t('markdown-editor.strike') key: "S" openWith: '~~' closeWith: '~~' @@ -190,37 +211,37 @@ tgMarkitupDirective = ($rootscope, $rs) -> separator: '---------------' }, { - name: $i18next.t('wiki-editor.bulleted-list') + name: $i18next.t('markdown-editor.bulleted-list') openWith: '- ' }, { - name: $i18next.t('wiki-editor.numeric-list') + name: $i18next.t('markdown-editor.numeric-list') openWith: (markItUp) -> markItUp.line+'. ' }, { separator: '---------------' }, { - name: $i18next.t('wiki-editor.picture') + name: $i18next.t('markdown-editor.picture') key: "P" replaceWith: '![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")' }, { - name: $i18next.t('wiki-editor.link') + name: $i18next.t('markdown-editor.link') key: "L" openWith: '[' closeWith: ']([![Url:!:http://]!] "[![Title]!]")' - placeHolder: $i18next.t('wiki-editor.link-placeholder') + placeHolder: $i18next.t('markdown-editor.link-placeholder') }, { separator: '---------------' }, { - name: $i18next.t('wiki-editor.quotes') + name: $i18next.t('markdown-editor.quotes') openWith: '> ' }, { - name: $i18next.t('wiki-editor.code-block') + name: $i18next.t('markdown-editor.code-block') openWith: '```\n' closeWith: '\n```' }, @@ -228,7 +249,7 @@ tgMarkitupDirective = ($rootscope, $rs) -> separator: '---------------' }, { - name: $i18next.t('wiki-editor.preview') + name: $i18next.t('markdown-editor.preview') call: preview className: "preview-icon" }, @@ -236,7 +257,7 @@ tgMarkitupDirective = ($rootscope, $rs) -> # separator: '---------------' # }, # { - # name: $i18next.t('wiki-editor.help') + # name: $i18next.t('markdown-editor.help') # call: openHelp # className: "help" # } diff --git a/app/locales/en/app.json b/app/locales/en/app.json index aa66f3ef..6498b36c 100644 --- a/app/locales/en/app.json +++ b/app/locales/en/app.json @@ -24,12 +24,8 @@ "rangecheck": "You must select between %s and %s choices.", "equalto": "This value should be the same." }, - "pagination": { - "next": "Next", - "prev": "Previous" - }, "common": { - "subject": "Subject" + "subject": "Subject", "save": "Save", "blocked": "Blocked", "cancel": "Cancel", @@ -37,6 +33,28 @@ "new-bulk": "New bulk insert", "one-item-line": "One item per line..." }, + "pagination": { + "next": "Next", + "prev": "Previous" + }, + "markdown-editor": { + "heading-1": "First Level Heading", + "heading-2": "Second Level Heading", + "heading-3": "Third Level Heading", + "bold": "Bold", + "italic": "Italic", + "strike": "Strike", + "bulleted-list": "Bulleted List", + "numeric-list": "Numeric List", + "picture": "Picture", + "link": "Link", + "quotes": "Quotes", + "code-block": "Code Block / Code", + "preview": "Preview", + "help": "Help", + "placeholder": "Your title here...", + "link-placeholder": "Your text to link here..." + }, "us": { "title-new": "New User Story", "team-requirement": "Team Requirement",