stable
David Barragán Merino 2014-09-26 12:55:54 +02:00
parent d5434c5c66
commit 66abe776d1
2 changed files with 63 additions and 24 deletions

View File

@ -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"
# }

View File

@ -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",