mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: Activate account page JS error with I18n
This commit is contained in:
parent
07d3f0fc26
commit
c4ca6b9934
1 changed files with 18 additions and 16 deletions
34
vendor/assets/javascripts/i18n-patches.js
vendored
34
vendor/assets/javascripts/i18n-patches.js
vendored
|
@ -1,20 +1,22 @@
|
|||
(function() {
|
||||
var oldI18nlookup = I18n.lookup;
|
||||
I18n.lookup = function(scope, options) {
|
||||
return oldI18nlookup.apply(this, ["js." + scope, options]);
|
||||
};
|
||||
|
||||
// Default format for storage units
|
||||
var oldI18ntoHumanSize = I18n.toHumanSize;
|
||||
I18n.toHumanSize = function(number, options) {
|
||||
options = options || {};
|
||||
options.format = I18n.t("number.human.storage_units.format");
|
||||
return oldI18ntoHumanSize.apply(this, [number, options]);
|
||||
};
|
||||
|
||||
if (Ember.EXTEND_PROTOTYPES) {
|
||||
String.prototype.i18n = function(options) {
|
||||
return I18n.t(String(this), options);
|
||||
if (typeof I18n !== "undefined") {
|
||||
var oldI18nlookup = I18n.lookup;
|
||||
I18n.lookup = function(scope, options) {
|
||||
return oldI18nlookup.apply(this, ["js." + scope, options]);
|
||||
};
|
||||
|
||||
// Default format for storage units
|
||||
var oldI18ntoHumanSize = I18n.toHumanSize;
|
||||
I18n.toHumanSize = function(number, options) {
|
||||
options = options || {};
|
||||
options.format = I18n.t("number.human.storage_units.format");
|
||||
return oldI18ntoHumanSize.apply(this, [number, options]);
|
||||
};
|
||||
|
||||
if (Ember.EXTEND_PROTOTYPES) {
|
||||
String.prototype.i18n = function(options) {
|
||||
return I18n.t(String(this), options);
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue