mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 08:13:51 +08:00
DEV: Remove i18n-patches (#11139)
* DEV: Move toHumanSize patch into I18n proper The patch wasn't loaded in Ember CLI environment causing translation discrepancies. * DEV: Remove String.prototype.i18n I don't think this patch is needed. Let the CI prove me wrong. :P
This commit is contained in:
parent
bfafccacd2
commit
1ca6434d40
|
@ -254,7 +254,7 @@ I18n.toHumanSize = function(number, options) {
|
|||
|
||||
options = this.prepareOptions(options, {
|
||||
precision: precision,
|
||||
format: "%n%u",
|
||||
format: this.t("number.human.storage_units.format"),
|
||||
delimiter: ""
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//= require logster
|
||||
|
||||
//= require template_include.js
|
||||
//= require i18n-patches
|
||||
|
||||
//= require message-bus
|
||||
//= require jquery.ui.widget.js
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//= require_tree ./discourse-common/addon
|
||||
//= require i18n-patches
|
||||
//= require_tree ./select-kit/addon
|
||||
//= require wizard/router
|
||||
//= require wizard/wizard
|
||||
|
|
17
vendor/assets/javascripts/i18n-patches.js
vendored
17
vendor/assets/javascripts/i18n-patches.js
vendored
|
@ -1,17 +0,0 @@
|
|||
(function() {
|
||||
if (typeof I18n !== "undefined") {
|
||||
// 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 ("w" in String.prototype) {
|
||||
String.prototype.i18n = function(options) {
|
||||
return I18n.t(String(this), options);
|
||||
};
|
||||
}
|
||||
}
|
||||
})();
|
Loading…
Reference in New Issue
Block a user