如何本地化TextAngular工具提示

时间:2015-06-09 10:28:59

标签: angularjs internationalization textangular

是否有可能将自定义工具提示字符串传递给TextAngular编辑器(http://textangular.com/)?在非英语应用程序中使用英语工具提示看起来不准确且不专业。

1 个答案:

答案 0 :(得分:1)

如果您正在讨论将鼠标悬停在工具栏中的项目上时出现的工具提示,则可以修改textAngularSetup.js以提供您要使用的翻译。

该文件的@line 81有一个部分提供每个按钮的文本'工具提示。

.value('taTranslations', {
// moved to sub-elements
//toggleHTML: "Toggle HTML",
//insertImage: "Please enter a image URL to insert",
//insertLink: "Please enter a URL to insert",
//insertVideo: "Please enter a youtube URL to embed",
html: {
    tooltip: 'Toggle html / Rich Text'
},
// tooltip for heading - might be worth splitting
heading: {
    tooltip: 'Heading '
},
p: {
    tooltip: 'Paragraph'
},
pre: {
    tooltip: 'Preformatted text'
},
ul: {
    tooltip: 'Unordered List'
},
ol: {
    tooltip: 'Ordered List'
},
quote: {
    tooltip: 'Quote/unquote selection or paragraph'
},
undo: {
    tooltip: 'Undo'
},
redo: {
    tooltip: 'Redo'
},
bold: {
    tooltip: 'Bold'
},
italic: {
    tooltip: 'Italic'
},
underline: {
    tooltip: 'Underline'
},
strikeThrough:{
    tooltip: 'Strikethrough'
},
justifyLeft: {
    tooltip: 'Align text left'
},
justifyRight: {
    tooltip: 'Align text right'
},
justifyCenter: {
    tooltip: 'Center'
},
indent: {
    tooltip: 'Increase indent'
},
outdent: {
    tooltip: 'Decrease indent'
},
clear: {
    tooltip: 'Clear formatting'
},
insertImage: {
    dialogPrompt: 'Please enter an image URL to insert',
    tooltip: 'Insert image',
    hotkey: 'the - possibly language dependent hotkey ... for some future implementation'
},
insertVideo: {
    tooltip: 'Insert video',
    dialogPrompt: 'Please enter a youtube URL to embed'
},
insertLink: {
    tooltip: 'Insert / edit link',
    dialogPrompt: "Please enter a URL to insert"
},
editLink: {
    reLinkButton: {
        tooltip: "Relink"
    },
    unLinkButton: {
        tooltip: "Unlink"
    },
    targetToggle: {
        buttontext: "Open in New Window"
    }
},
wordcount: {
    tooltip: 'Display words Count'
},
    charcount: {
    tooltip: 'Display characters Count'
}
})

编辑每一个,你应该好好去。