DEV: Rename I18n imports to discourse-i18n (#23915)

As of #23867 this is now a real package, so updating the imports to
use the real package name, rather than relying on the alias. The
name change in the package name is because `I18n` is not a valid
name as NPM packages must be all lowercase.

This commit also introduces an eslint rule to prevent importing from
the old I18n path.

For themes/plugins, the old 'i18n' name remains functional.
This commit is contained in:
Godfrey Chan 2023-10-18 03:07:09 -07:00 committed by GitHub
parent 0a6dfee0b9
commit c34f8b65cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
717 changed files with 730 additions and 820 deletions

View File

@ -3,6 +3,7 @@
"rules": {
"discourse-ember/global-ember": "error",
"eol-last": "error",
"no-restricted-globals": "off"
"no-restricted-globals": "off",
"no-restricted-imports": ["error", { "paths": ["I18n"] }]
}
}

View File

@ -6,7 +6,7 @@ import $ from "jquery";
import loadScript from "discourse/lib/load-script";
import getURL from "discourse-common/lib/get-url";
import { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
const COLOR_VARS_REGEX =
/\$(primary|secondary|tertiary|quaternary|header_background|header_primary|highlight|danger|success|love)(\s|;|-(low|medium|high))/g;

View File

@ -3,7 +3,7 @@ import { scheduleOnce } from "@ember/runloop";
import { classNames } from "@ember-decorators/component";
import { observes, on } from "@ember-decorators/object";
import discourseDebounce from "discourse-common/lib/debounce";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNames("admin-backups-logs")
export default class AdminBackupsLogs extends Component {

View File

@ -4,7 +4,7 @@ import { equal } from "@ember/object/computed";
import discourseComputed, {
afterRender,
} from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
const ACTIONS = ["delete", "delete_replies", "edit", "none"];

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { equal } from "@ember/object/computed";
import { tagName } from "@ember-decorators/component";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
const CUSTOM_REASON_KEY = "custom";

View File

@ -3,7 +3,7 @@ import { alias } from "@ember/object/computed";
import { classNames } from "@ember-decorators/component";
import { setting } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNames("admin-report-storage-stats")
export default class AdminReportStorageStats extends Component {

View File

@ -10,8 +10,8 @@ import ReportLoader from "discourse/lib/reports-loader";
import { isTesting } from "discourse-common/config/environment";
import { makeArray } from "discourse-common/lib/helpers";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import Report, { DAILY_LIMIT_DAYS, SCHEMA_VERSION } from "admin/models/report";
import I18n from "I18n";
const TABLE_OPTIONS = {
perPage: 8,

View File

@ -4,7 +4,7 @@ import { next } from "@ember/runloop";
import { fmt } from "discourse/lib/computed";
import { isDocumentRTL } from "discourse/lib/text-direction";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminThemeEditor extends Component {
warning = null;

View File

@ -6,8 +6,8 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { i18n, propertyEqual } from "discourse/lib/computed";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import UserField from "admin/models/user-field";
import I18n from "I18n";
export default Component.extend(bufferedProperty("userField"), {
tagName: "",

View File

@ -4,7 +4,7 @@ import { alias, equal } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { classNames } from "@ember-decorators/component";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNames("watched-word")
export default class AdminWatchedWord extends Component {

View File

@ -3,7 +3,7 @@ import { action, computed } from "@ember/object";
import { reads } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class EmailStylesEditor extends Component {
@service dialog;

View File

@ -8,7 +8,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import Category from "discourse/models/category";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
@tagName("tr")
export default class EmbeddableHost extends Component.extend(

View File

@ -5,7 +5,7 @@ import { classNameBindings } from "@ember-decorators/component";
import { emojiUrlFor } from "discourse/lib/text";
import discourseLater from "discourse-common/lib/later";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNameBindings(":value-list", ":emoji-list")
export default class EmojiValueList extends Component {

View File

@ -3,10 +3,10 @@ import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "discourse-i18n";
import FormTemplateValidationOptionsModal from "admin/components/modal/form-template-validation-options";
import { templateFormFields } from "admin/lib/template-form-fields";
import FormTemplate from "admin/models/form-template";
import I18n from "I18n";
export default class FormTemplateForm extends Component {
@service router;

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class FormTemplateRowItem extends Component {
@service router;

View File

@ -8,8 +8,8 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import copyText from "discourse/lib/copy-text";
import discourseLater from "discourse-common/lib/later";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import AdminUser from "admin/models/admin-user";
import I18n from "I18n";
@classNames("ip-lookup")
export default class IpLookup extends Component {

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { escapeExpression } from "discourse/lib/utilities";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class BadgePreview extends Component {
get processedSample() {

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class DeletePostsConfirmation extends Component {
@tracked value;

View File

@ -2,8 +2,8 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { extractError } from "discourse/lib/ajax-error";
import I18n from "discourse-i18n";
import AdminUser from "admin/models/admin-user";
import I18n from "I18n";
export default class DeleteUserPostsProgress extends Component {
@tracked deletedPosts = 0;

View File

@ -5,7 +5,7 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { TrackedArray } from "@ember-compat/tracked-built-ins";
import { ajax } from "discourse/lib/ajax";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class EditBadgeGroupings extends Component {
@service dialog;

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import I18n from "I18n";
import I18n from "discourse-i18n";
const TABLE_HEADER_KEYS = ["key", "type", "description"];
const VALIDATION_KEYS = ["required", "minimum", "maximum", "pattern", "type"];

View File

@ -5,8 +5,8 @@ import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { POPULAR_THEMES } from "discourse-common/lib/popular-themes";
import I18n from "discourse-i18n";
import { COMPONENTS, THEMES } from "admin/models/theme";
import I18n from "I18n";
const MIN_NAME_LENGTH = 4;

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class MergeUsersConfirmation extends Component {
@tracked value;

View File

@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { inject as service } from "@ember/service";
import DiscourseURL from "discourse/lib/url";
import { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class MergeUsersProgress extends Component {
@service messageBus;

View File

@ -4,7 +4,7 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { isEmpty } from "@ember/utils";
import { extractError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class PenalizeUser extends Component {
@service dialog;

View File

@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class Reseed extends Component {
@service dialog;

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class StartBackup extends Component {
@service siteSettings;

View File

@ -5,8 +5,8 @@ import { inject as service } from "@ember/service";
import { tagName } from "@ember-decorators/component";
import { fmt } from "discourse/lib/computed";
import discourseComputed, { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import Permalink from "admin/models/permalink";
import I18n from "I18n";
@tagName("")
export default class PermalinkForm extends Component {

View File

@ -4,8 +4,8 @@ import { schedule } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { classNames, tagName } from "@ember-decorators/component";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import ScreenedIpAddress from "admin/models/screened-ip-address";
import I18n from "I18n";
/**
A form to create an IP address that will be blocked or allowed.

View File

@ -3,7 +3,7 @@ import { action, set } from "@ember/object";
import { isEmpty } from "@ember/utils";
import { classNameBindings } from "@ember-decorators/component";
import { on } from "@ember-decorators/object";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNameBindings(":value-list", ":secret-value-list")
export default class SecretValueList extends Component {

View File

@ -2,7 +2,7 @@ import Component from "@ember/component";
import { alias } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import UppyUploadMixin from "discourse/mixins/uppy-upload";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class TagsUploader extends Component.extend(UppyUploadMixin) {
@service dialog;

View File

@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class ThemeSettingsEditor extends Component {
@service dialog;

View File

@ -4,7 +4,7 @@ import { action } from "@ember/object";
import { isEmpty } from "@ember/utils";
import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
const THEME_FIELD_VARIABLE_TYPE_IDS = [2, 3, 4];
const SCSS_VARIABLE_NAMES = [

View File

@ -7,8 +7,8 @@ import { isEmpty } from "@ember/utils";
import { classNames, tagName } from "@ember-decorators/component";
import { observes } from "@ember-decorators/object";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import WatchedWord from "admin/models/watched-word";
import I18n from "I18n";
@tagName("form")
@classNames("watched-word-form")

View File

@ -3,7 +3,7 @@ import { alias } from "@ember/object/computed";
import { classNames } from "@ember-decorators/component";
import { dialog } from "discourse/lib/uploads";
import UppyUploadMixin from "discourse/mixins/uppy-upload";
import I18n from "I18n";
import I18n from "discourse-i18n";
@classNames("watched-words-uploader")
export default class WatchedWordUploader extends Component.extend(

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class WebhookEventChooser extends Component {
get details() {

View File

@ -5,7 +5,7 @@ import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { ensureJSON, plainJSON, prettyJSON } from "discourse/lib/formatter";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class WebhookEvent extends Component {
@service dialog;

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class WebhookStatus extends Component {
iconNames = ["far-circle", "times-circle", "circle", "circle"];

View File

@ -6,7 +6,7 @@ import { isBlank } from "@ember/utils";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
import ApiKeyUrlsModal from "../components/modal/api-key-urls";
export default class AdminApiKeysNewController extends Controller {

View File

@ -5,7 +5,7 @@ import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { i18n, setting } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminBackupsIndexController extends Controller {
@service dialog;

View File

@ -4,7 +4,7 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminBadgesAwardController extends Controller {
@service dialog;

View File

@ -7,7 +7,7 @@ import { observes } from "@ember-decorators/object";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import getURL from "discourse-common/lib/get-url";
import I18n from "I18n";
import I18n from "discourse-i18n";
const IMAGE = "image";
const ICON = "icon";

View File

@ -3,7 +3,7 @@ import { action, computed } from "@ember/object";
import { inject as service } from "@ember/service";
import { clipboardCopy } from "discourse/lib/utilities";
import discourseLater from "discourse-common/lib/later";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeColorsShowController extends Controller {
@service dialog;

View File

@ -2,8 +2,8 @@ import Controller from "@ember/controller";
import EmberObject, { action } from "@ember/object";
import { inject as service } from "@ember/service";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import ColorSchemeSelectBaseModal from "admin/components/modal/color-scheme-select-base";
import I18n from "I18n";
export default class AdminCustomizeColorsController extends Controller {
@service router;

View File

@ -2,7 +2,7 @@ import Controller from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeEmailStyleEditController extends Controller {
@service dialog;

View File

@ -4,7 +4,7 @@ import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeEmailTemplatesEditController extends Controller.extend(
bufferedProperty("emailTemplate")

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { url } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeThemesEditController extends Controller {
@service router;

View File

@ -12,10 +12,10 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { url } from "discourse/lib/computed";
import { makeArray } from "discourse-common/lib/helpers";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import ThemeSettingsEditor from "admin/components/theme-settings-editor";
import { COMPONENTS, THEMES } from "admin/models/theme";
import ThemeSettings from "admin/models/theme-settings";
import I18n from "I18n";
import ThemeUploadAddModal from "../components/theme-upload-add";
const THEME_UPLOAD_VAR = 2;

View File

@ -5,10 +5,10 @@ import { setting } from "discourse/lib/computed";
import getURL from "discourse-common/lib/get-url";
import { makeArray } from "discourse-common/lib/helpers";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import PeriodComputationMixin from "admin/mixins/period-computation";
import AdminDashboard from "admin/models/admin-dashboard";
import Report from "admin/models/report";
import I18n from "I18n";
import CustomDateRangeModal from "../components/modal/custom-date-range";
function staticReport(reportType) {

View File

@ -6,7 +6,7 @@ import { htmlSafe } from "@ember/template";
import { observes } from "@ember-decorators/object";
import { ajax } from "discourse/lib/ajax";
import { escapeExpression } from "discourse/lib/utilities";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminEmailIndexController extends Controller {
@service dialog;

View File

@ -3,7 +3,7 @@ import EmberObject, { action, computed } from "@ember/object";
import { sort } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import I18n from "I18n";
import I18n from "discourse-i18n";
const ALL_FILTER = "all";

View File

@ -6,8 +6,8 @@ import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import I18n from "discourse-i18n";
import ScreenedIpAddress from "admin/models/screened-ip-address";
import I18n from "I18n";
export default class AdminLogsScreenedIpAddressesController extends Controller {
@service dialog;

View File

@ -5,7 +5,7 @@ import { inject as service } from "@ember/service";
import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
import StaffActionLogDetailsModal from "../components/modal/staff-action-log-details";
import ThemeChangeModal from "../components/modal/theme-change";

View File

@ -6,8 +6,8 @@ import { observes } from "@ember-decorators/object";
import { clipboardCopy } from "discourse/lib/utilities";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import I18n from "discourse-i18n";
import Permalink from "admin/models/permalink";
import I18n from "I18n";
export default class AdminPermalinksController extends Controller {
@service dialog;

View File

@ -1,5 +1,5 @@
import Controller from "@ember/controller";
import I18n from "I18n";
import I18n from "discourse-i18n";
export const DEFAULT_PERIOD = "yearly";
export default class AdminSearchLogsIndexController extends Controller {

View File

@ -1,6 +1,6 @@
import Controller from "@ember/controller";
import I18n from "discourse-i18n";
import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index";
import I18n from "I18n";
export default class AdminSearchLogsTermController extends Controller {
loading = false;

View File

@ -6,7 +6,7 @@ import { isEmpty } from "@ember/utils";
import { observes } from "@ember-decorators/object";
import { INPUT_DELAY } from "discourse-common/config/environment";
import { debounce } from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminSiteSettingsController extends Controller {
@service router;

View File

@ -4,7 +4,7 @@ import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bufferedProperty } from "discourse/mixins/buffered-content";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default Controller.extend(bufferedProperty("siteText"), {
dialog: service(),

View File

@ -7,7 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import { grantableBadges } from "discourse/lib/grant-badge-utils";
import UserBadge from "discourse/models/user-badge";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminUserBadgesController extends Controller {
@service dialog;

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { gte, sort } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
const MAX_FIELDS = 30;

View File

@ -10,8 +10,8 @@ import DiscourseURL, { userPath } from "discourse/lib/url";
import CanCheckEmails from "discourse/mixins/can-check-emails";
import getURL from "discourse-common/lib/get-url";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import AdminUser from "admin/models/admin-user";
import I18n from "I18n";
import DeletePostsConfirmationModal from "../components/modal/delete-posts-confirmation";
import DeleteUserPostsProgressModal from "../components/modal/delete-user-posts-progress";
import MergeUsersConfirmationModal from "../components/modal/merge-users-confirmation";

View File

@ -6,8 +6,8 @@ import CanCheckEmails from "discourse/mixins/can-check-emails";
import { INPUT_DELAY } from "discourse-common/config/environment";
import discourseDebounce from "discourse-common/lib/debounce";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import AdminUser from "admin/models/admin-user";
import I18n from "I18n";
export default class AdminUsersListShowController extends Controller.extend(
CanCheckEmails

View File

@ -6,9 +6,9 @@ import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { fmt } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import WatchedWordTestModal from "admin/components/modal/watched-word-test";
import WatchedWord from "admin/models/watched-word";
import I18n from "I18n";
export default class AdminWatchedWordsActionController extends Controller {
@service dialog;

View File

@ -5,7 +5,7 @@ import { inject as service } from "@ember/service";
import { isEmpty } from "@ember/utils";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminWebHooksEditController extends Controller {
@service dialog;

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { alias } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminWebHooksIndexController extends Controller {
@service dialog;

View File

@ -2,7 +2,7 @@ import Controller, { inject as controller } from "@ember/controller";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminWebHooksShowController extends Controller {
@service dialog;

View File

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

View File

@ -1,5 +1,5 @@
import Helper from "@ember/component/helper";
import I18n from "I18n";
import I18n from "discourse-i18n";
function postActionTitle([id, nameKey]) {
let title = I18n.t(`admin.flags.short_names.${nameKey}`, {

View File

@ -1,4 +1,4 @@
import I18n from "I18n";
import I18n from "discourse-i18n";
export const templateFormFields = [
{

View File

@ -10,7 +10,7 @@ import { ajax } from "discourse/lib/ajax";
import { fmt, propertyNotEqual } from "discourse/lib/computed";
import { splitString } from "discourse/lib/utilities";
import discourseComputed, { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
import SiteSettingDefaultCategoriesModal from "../components/modal/site-setting-default-categories";
const CUSTOM_TYPES = [

View File

@ -3,7 +3,7 @@ import { readOnly } from "@ember/object/computed";
import Mixin from "@ember/object/mixin";
import { isPresent } from "@ember/utils";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default Mixin.create({
@discourseComputed("value", "default")

View File

@ -1,5 +1,5 @@
import { tracked } from "@glimmer/tracking";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminPlugin {
static create(args = {}) {

View File

@ -8,7 +8,7 @@ import Group from "discourse/models/group";
import User from "discourse/models/user";
import getURL from "discourse-common/lib/get-url";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminUser extends User {
static find(user_id) {

View File

@ -2,7 +2,7 @@ import EmberObject from "@ember/object";
import { observes, on } from "@ember-decorators/object";
import { propertyNotEqual } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class ColorSchemeColor extends EmberObject {
// Whether the current value is different than Discourse's default color scheme.

View File

@ -4,8 +4,8 @@ import EmberObject from "@ember/object";
import { not } from "@ember/object/computed";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import ColorSchemeColor from "admin/models/color-scheme-color";
import I18n from "I18n";
class ColorSchemes extends ArrayProxy {}

View File

@ -1,6 +1,6 @@
import RestModel from "discourse/models/rest";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class FlagType extends RestModel {
@discourseComputed("id")

View File

@ -13,7 +13,7 @@ import {
import getURL from "discourse-common/lib/get-url";
import { makeArray } from "discourse-common/lib/helpers";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
// Change this line each time report format change
// and you want to ensure cache is reset

View File

@ -1,7 +1,7 @@
import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class ScreenedEmail extends EmberObject {
static findAll() {

View File

@ -2,7 +2,7 @@ import EmberObject from "@ember/object";
import { equal } from "@ember/object/computed";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class ScreenedIpAddress extends EmberObject {
static findAll(filter) {

View File

@ -1,7 +1,7 @@
import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class ScreenedUrl extends EmberObject {
static findAll() {

View File

@ -1,8 +1,8 @@
import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import Setting from "admin/mixins/setting-object";
import I18n from "I18n";
export default class SiteSetting extends EmberObject.extend(Setting) {
static findAll() {

View File

@ -2,8 +2,8 @@ import { ajax } from "discourse/lib/ajax";
import { escapeExpression } from "discourse/lib/utilities";
import RestModel from "discourse/models/rest";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import AdminUser from "admin/models/admin-user";
import I18n from "I18n";
function format(label, value, escape = true) {
return value

View File

@ -4,7 +4,7 @@ import { isBlank, isEmpty } from "@ember/utils";
import { popupAjaxError } from "discourse/lib/ajax-error";
import RestModel from "discourse/models/rest";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
const THEME_UPLOAD_VAR = 2;
const FIELDS_IDS = [0, 1, 5];

View File

@ -1,6 +1,6 @@
import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class WatchedWord extends EmberObject {
static findAll() {

View File

@ -7,10 +7,10 @@ import User from "discourse/models/user";
import DiscourseRoute from "discourse/routes/discourse";
import getURL from "discourse-common/lib/get-url";
import { bind } from "discourse-common/utils/decorators";
import I18n from "discourse-i18n";
import StartBackupModal from "admin/components/modal/start-backup";
import Backup from "admin/models/backup";
import BackupStatus from "admin/models/backup-status";
import I18n from "I18n";
const LOG_CHANNEL = "/admin/backups/logs";

View File

@ -2,7 +2,7 @@ import { ajax } from "discourse/lib/ajax";
import Badge from "discourse/models/badge";
import BadgeGrouping from "discourse/models/badge-grouping";
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminBadgesRoute extends DiscourseRoute {
_json = null;

View File

@ -3,7 +3,7 @@ import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import Badge from "discourse/models/badge";
import I18n from "I18n";
import I18n from "discourse-i18n";
import BadgePreviewModal from "../../components/modal/badge-preview";
import EditBadgeGroupingsModal from "../../components/modal/edit-badge-groupings";

View File

@ -1,7 +1,7 @@
import { action } from "@ember/object";
import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeEmailStyleEditRoute extends Route {
@service dialog;

View File

@ -1,7 +1,7 @@
import { action } from "@ember/object";
import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminCustomizeThemesEditRoute extends Route {
@service dialog;

View File

@ -2,8 +2,8 @@ import { action } from "@ember/object";
import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import { scrollTop } from "discourse/mixins/scroll-top";
import I18n from "discourse-i18n";
import { COMPONENTS, THEMES } from "admin/models/theme";
import I18n from "I18n";
export default class AdminCustomizeThemesShowRoute extends Route {
@service dialog;

View File

@ -2,7 +2,7 @@ import { action } from "@ember/object";
import Route from "@ember/routing/route";
import { next } from "@ember/runloop";
import { inject as service } from "@ember/service";
import I18n from "I18n";
import I18n from "discourse-i18n";
import InstallThemeModal from "../components/modal/install-theme";
export default class AdminCustomizeThemesRoute extends Route {

View File

@ -1,6 +1,6 @@
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminSiteSettingsCategoryRoute extends DiscourseRoute {
model(params) {

View File

@ -1,6 +1,6 @@
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminWatchedWordsActionRoute extends DiscourseRoute {
model(params) {

View File

@ -1,5 +1,5 @@
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default class AdminRoute extends DiscourseRoute {
titleToken() {

View File

@ -4,9 +4,9 @@ import Service, { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { Promise } from "rsvp";
import { ajax } from "discourse/lib/ajax";
import I18n from "discourse-i18n";
import PenalizeUserModal from "admin/components/modal/penalize-user";
import AdminUser from "admin/models/admin-user";
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

View File

@ -1,5 +1,5 @@
import { htmlSafe } from "@ember/template";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default function boundI18n(key, options) {
return htmlSafe(I18n.t(key, options));

View File

@ -1,5 +1,5 @@
import { registerUnbound } from "discourse-common/lib/helpers";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default function i18n(key, params) {
return I18n.t(key, params);

View File

@ -3,7 +3,7 @@ import { isDevelopment } from "discourse-common/config/environment";
import attributeHook from "discourse-common/lib/attribute-hook";
import deprecated from "discourse-common/lib/deprecated";
import escape from "discourse-common/lib/escape";
import I18n from "I18n";
import I18n from "discourse-i18n";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
let _renderers = [];

View File

@ -1,5 +1,5 @@
import { computed } from "@ember/object";
import I18n from "I18n";
import I18n from "discourse-i18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
export default DropdownSelectBoxComponent.extend({

View File

@ -3,7 +3,7 @@ import { action } from "@ember/object";
import { isBlank } from "@ember/utils";
import UppyUploadMixin from "discourse/mixins/uppy-upload";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
import I18n from "discourse-i18n";
export default Component.extend(UppyUploadMixin, {
type: "avatar",

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