DEV: import I18n instead of global usage (#9768)

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
This commit is contained in:
Robin Ward 2020-05-13 16:23:41 -04:00 committed by GitHub
parent 1059557ce1
commit eab560fe2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
352 changed files with 369 additions and 13 deletions

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { scheduleOnce } from "@ember/runloop";
import Component from "@ember/component";
import discourseDebounce from "discourse/lib/debounce";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { makeArray } from "discourse-common/lib/helpers";
import { alias, or, and, equal, notEmpty, not } from "@ember/object/computed";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import { empty } from "@ember/object/computed";
import { scheduleOnce } from "@ember/runloop";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { reads } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { isEmpty } from "@ember/utils";
import { or } from "@ember/object/computed";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Component from "@ember/component";
import discourseComputed, { observes } from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import { later } from "@ember/runloop";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { equal } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { later, schedule } from "@ember/runloop";
import Component from "@ember/component";
import { iconHTML } from "discourse-common/lib/icon-library";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import Component from "@ember/component";
import { on } from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";
import UploadMixin from "discourse/mixins/upload";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isBlank } from "@ember/utils";
import Controller from "@ember/controller";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { alias, equal } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { reads } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { later } from "@ember/runloop";
import Controller from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import Controller from "@ember/controller";
import showModal from "discourse/lib/show-modal";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { url } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { makeArray } from "discourse-common/lib/helpers";
import {
empty,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { makeArray } from "discourse-common/lib/helpers";
import { inject } from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { empty } from "@ember/object/computed";
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { sort } from "@ember/object/computed";
import EmberObject, { action, computed } from "@ember/object";
import Controller from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import { outputExportResult } from "discourse/lib/export-result";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { gt } from "@ember/object/computed";
import EmberObject from "@ember/object";
import { scheduleOnce } from "@ember/runloop";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import Permalink from "admin/models/permalink";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
export const DEFAULT_PERIOD = "yearly";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import { alias } from "@ember/object/computed";
import Controller from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { alias, sort } from "@ember/object/computed";
import { next } from "@ember/runloop";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { gte, sort } from "@ember/object/computed";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { notEmpty, and } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import Controller from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { or } from "@ember/object/computed";
import { schedule } from "@ember/runloop";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { isEmpty } from "@ember/utils";
import { alias } from "@ember/object/computed";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import { and, not } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { alias, map } from "@ember/object/computed";
import Controller from "@ember/controller";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import { A } from "@ember/array";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { equal, match, alias } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller, { inject as controller } from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { htmlHelper } from "discourse-common/lib/helpers";
export default htmlHelper(size => I18n.toHumanSize(size));

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Helper from "@ember/component/helper";
function postActionTitle([id, nameKey]) {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { popupAjaxError } from "discourse/lib/ajax-error";
import Mixin from "@ember/object/mixin";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { warn } from "@ember/debug";
import discourseComputed from "discourse-common/utils/decorators";
import { alias, oneWay } from "@ember/object/computed";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { computed } from "@ember/object";
import Mixin from "@ember/object/mixin";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { filter, or, gt, lt, not } from "@ember/object/computed";
import { iconHTML } from "discourse-common/lib/icon-library";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import EmberObject from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed, {
observes,
on

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { A } from "@ember/array";
import ArrayProxy from "@ember/array/proxy";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import RestModel from "discourse/models/rest";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { makeArray } from "discourse-common/lib/helpers";
import { isEmpty } from "@ember/utils";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import EmberObject from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { equal } from "@ember/object/computed";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import EmberObject from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import Setting from "admin/mixins/setting-object";
import EmberObject from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { ajax } from "discourse/lib/ajax";
import AdminUser from "admin/models/admin-user";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { get } from "@ember/object";
import { isBlank, isEmpty } from "@ember/utils";
import { or, gt } from "@ember/object/computed";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import EmberObject from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { get } from "@ember/object";
import Route from "@ember/routing/route";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";
import Badge from "discourse/models/badge";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Route from "@ember/routing/route";
export default Route.extend({
model(params) {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Route from "@ember/routing/route";
export default Route.extend({
model(params) {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Route from "@ember/routing/route";
import { scrollTop } from "discourse/mixins/scroll-top";
import { THEMES, COMPONENTS } from "admin/models/theme";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
// A service that can act as a bridge between the front end Discourse application
// and the admin application. Use this if you need front end code to access admin
// modules. Inject it optionally, and if it exists go to town!

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { htmlHelper } from "discourse-common/lib/helpers";
export default htmlHelper((key, params) => I18n.t(key, params.hash));

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { registerUnbound } from "discourse-common/lib/helpers";
registerUnbound("i18n", (key, params) => I18n.t(key, params));

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { h } from "virtual-dom";
import attributeHook from "discourse-common/lib/attribute-hook";
import deprecated from "discourse-common/lib/deprecated";

View File

@ -1,7 +1,6 @@
var define, requirejs;
(function() {
// In future versions of ember we don't need this
var EMBER_MODULES = {};
var ALIASES = {
"ember-addons/ember-computed-decorators":
@ -9,6 +8,8 @@ var define, requirejs;
"discourse/lib/raw-templates": "discourse-common/lib/raw-templates",
"preload-store": "discourse/lib/preload-store"
};
// In future versions of ember we don't need this
if (typeof Ember !== "undefined") {
EMBER_MODULES = {
jquery: { default: $ },
@ -140,6 +141,9 @@ var define, requirejs;
},
"@ember/object/internals": {
guidFor: Ember.guidFor
},
I18n: {
default: I18n
}
};
}

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { computed } from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Component from "@ember/component";
import discourseComputed, {
on,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { ajax } from "discourse/lib/ajax";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { computed } from "@ember/object";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { action } from "@ember/object";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { alias, equal } from "@ember/object/computed";
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { debounce, later, next, schedule, throttle } from "@ember/runloop";
import Component from "@ember/component";
import userSearch from "discourse/lib/user-search";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { not } from "@ember/object/computed";
import EmberObject from "@ember/object";
import { scheduleOnce } from "@ember/runloop";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { alias, or } from "@ember/object/computed";
import { debounce, next, schedule } from "@ember/runloop";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import discourseComputed, { observes } from "discourse-common/utils/decorators";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Component from "@ember/component";
export default Component.extend({
classNames: ["conditional-loading-section"],

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import Component from "@ember/component";
export default Component.extend({

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
import Component from "@ember/component";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import UploadMixin from "discourse/mixins/upload";

Some files were not shown because too many files have changed in this diff Show More