Skip to content

Commit

Permalink
fix i18n bug in button.coffee
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Dec 15, 2014
1 parent a43ff58 commit 5ed6f83
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions lib/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2530,9 +2530,13 @@ Button = (function(_super) {
Button.prototype.command = function(param) {};

Button.prototype._t = function() {
var args, _ref;
var args, result, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref = this.editor)._t.apply(_ref, args);
result = Button.__super__._t.apply(this, args);
if (!result) {
result = (_ref = this.editor)._t.apply(_ref, args);
}
return result;
};

return Button;
Expand Down
8 changes: 6 additions & 2 deletions site/assets/scripts/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2530,9 +2530,13 @@ Button = (function(_super) {
Button.prototype.command = function(param) {};

Button.prototype._t = function() {
var args, _ref;
var args, result, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref = this.editor)._t.apply(_ref, args);
result = Button.__super__._t.apply(this, args);
if (!result) {
result = (_ref = this.editor)._t.apply(_ref, args);
}
return result;
};

return Button;
Expand Down
4 changes: 3 additions & 1 deletion src/buttons/button.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class Button extends SimpleModule
command: (param) ->

_t: (args...) ->
@editor._t args...
result = super args...
result = @editor._t args... unless result
result


Simditor.Button = Button

0 comments on commit 5ed6f83

Please sign in to comment.