Skip to content

Commit af4c608

Browse files
committed
Internationalize button titles (#34549).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20743 e93f8b46-1217-0410-a6f0-8f06a7374b81
1 parent fb15a9e commit af4c608

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

public/javascripts/jstoolbar/jstoolbar.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,16 @@ jsToolBar.prototype = {
250250
return b;
251251
},
252252
buttonTitleWithShortcut: function(title, shortcutKey) {
253+
if(typeof jsToolBar.strings == 'undefined') {
254+
var i18nTitle = title || null;
255+
} else {
256+
var i18nTitle = jsToolBar.strings[title] || title || null;
257+
}
258+
253259
if (isMac) {
254-
return title + " (⌘" + shortcutKey.toUpperCase() + ")";
260+
return i18nTitle + " (⌘" + shortcutKey.toUpperCase() + ")";
255261
} else {
256-
return title + " (Ctrl+" + shortcutKey.toUpperCase() + ")";
262+
return i18nTitle + " (Ctrl+" + shortcutKey.toUpperCase() + ")";
257263
}
258264
},
259265
space: function(toolName) {

0 commit comments

Comments
 (0)