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:
Jarek Radosz 2020-11-06 00:08:36 +01:00 committed by GitHub
parent bfafccacd2
commit 1ca6434d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 20 deletions

View File

@ -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: ""
});

View File

@ -1,7 +1,6 @@
//= require logster
//= require template_include.js
//= require i18n-patches
//= require message-bus
//= require jquery.ui.widget.js

View File

@ -1,5 +1,4 @@
//= require_tree ./discourse-common/addon
//= require i18n-patches
//= require_tree ./select-kit/addon
//= require wizard/router
//= require wizard/wizard

View File

@ -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);
};
}
}
})();