mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-09-24 16:40:55 -06:00
Merge 0139ac814f3f79a89a2163522a20f09b4e178c36 into 2996b67ec95ec69000ee03ccaee4fcca26cfc701
This commit is contained in:
commit
97d2737870
@ -209,7 +209,7 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
|
||||
}
|
||||
|
||||
if (options.title && enableTooltips) {
|
||||
el.title = createTooltip(options.title, options.action, shortcuts);
|
||||
el.title = createTooltip(options.title, options.action, shortcuts, parent.options.translations, parent.options.language);
|
||||
|
||||
if (isMac) {
|
||||
el.title = el.title.replace('Ctrl', '⌘');
|
||||
@ -289,9 +289,16 @@ function createSep() {
|
||||
return el;
|
||||
}
|
||||
|
||||
function createTooltip(title, action, shortcuts) {
|
||||
var translate = function (key, translations, language) {
|
||||
if (translations && language && translations[language] && translations[language][key]) {
|
||||
return translations[language][key];
|
||||
}
|
||||
return key;
|
||||
};
|
||||
|
||||
function createTooltip(title, action, shortcuts, translations, language) {
|
||||
var actionName;
|
||||
var tooltip = title;
|
||||
var tooltip = translate(title, translations, language);
|
||||
|
||||
if (action) {
|
||||
actionName = getBindingName(action);
|
||||
|
Loading…
x
Reference in New Issue
Block a user