mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Revert i18n initializer, it breaks tests.
This commit is contained in:
parent
1948b41875
commit
3e8d8bf90d
2 changed files with 19 additions and 27 deletions
|
@ -1,5 +1,24 @@
|
|||
import registerUnbound from 'discourse/helpers/register-unbound';
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
registerUnbound('i18n', function(key, params) {
|
||||
return I18n.t(key, params);
|
||||
});
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
export default {
|
||||
name: 'default-i18n',
|
||||
|
||||
initialize: function() {
|
||||
// We always prefix with "js." to select exactly what we want passed
|
||||
// through to the front end.
|
||||
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