diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 19549b3db..3950b6066 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -119,16 +119,24 @@ Toolbar.prototype.addButton = function(button) { if (button.shortcut) { const mac = /Mac|iPod|iPhone|iPad/.test(navigator.platform); const mod = mac ? 'Meta' : 'Ctrl'; - createdButton.title = `${title} (${mod}+${button.shortcut})`; + var shortcutTitle = `${mod}+${button.shortcut}`; // Mac users are used to glyphs for shortcut keys if (mac) { - createdButton.title = createdButton.title.replace('Shift', "\u21E7") - .replace('Meta', "\u2318") - .replace('Alt', "\u2325") - .replace(/\+/g, ''); + shortcutTitle = shortcutTitle + .replace('Shift', "\u21E7") + .replace('Meta', "\u2318") + .replace('Alt', "\u2325") + .replace(/\+/g, ''); + } else { + shortcutTitle = shortcutTitle + .replace('Shift', I18n.t('shortcut_modifier_key.shift')) + .replace('Ctrl', I18n.t('shortcut_modifier_key.ctrl')) + .replace('Alt', I18n.t('shortcut_modifier_key.alt')); } + createdButton.title = `${title} (${shortcutTitle})`; + this.shortcuts[`${mod}+${button.shortcut}`.toLowerCase()] = createdButton; } else { createdButton.title = title; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 162a03aaf..2e81b9b20 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -829,6 +829,11 @@ en: twitter: "Twitter" emoji_one: "Emoji One" + shortcut_modifier_key: + shift: 'Shift' + ctrl: 'Ctrl' + alt: 'Alt' + composer: emoji: "Emoji :smile:" more_emoji: "more..."