A platform for community discussion. Free, open, simple.
DEV: Consolidate i18n import paths (#29804)
David Taylor32665cf9dd26
diff --git a/app/assets/javascripts/admin/addon/components/admin-backups-actions.gjs b/app/assets/javascripts/admin/addon/components/admin-backups-actions.gjsindex b37a8692003..6598657efa7 100644--- a/app/assets/javascripts/admin/addon/components/admin-backups-actions.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-backups-actions.gjs@@ -4,7 +4,7 @@ import { service } from "@ember/service";import routeAction from "discourse/helpers/route-action";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminBackupsActions extends Component {@service currentUser;@@ -15,7 +15,7 @@ export default class AdminBackupsActions extends Component {toggleReadOnlyMode() {if (!this.site.isReadOnly) {this.dialog.yesNoConfirm({- message: I18n.t("admin.backups.read_only.enable.confirm"),+ message: i18n("admin.backups.read_only.enable.confirm"),didConfirm: () => {this.currentUser.set("hideReadOnlyAlert", true);this.#toggleReadOnlyMode(true);diff --git a/app/assets/javascripts/admin/addon/components/admin-backups-logs.js b/app/assets/javascripts/admin/addon/components/admin-backups-logs.jsindex ce0306a5b2c..0a02a657026 100644--- a/app/assets/javascripts/admin/addon/components/admin-backups-logs.js+++ b/app/assets/javascripts/admin/addon/components/admin-backups-logs.js@@ -3,13 +3,13 @@ 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 "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("admin-backups-logs")export default class AdminBackupsLogs extends Component {showLoadingSpinner = false;hasFormattedLogs = false;- noLogsMessage = I18n.t("admin.backups.logs.none");+ noLogsMessage = i18n("admin.backups.logs.none");formattedLogs = "";index = 0;diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjsindex 22af1e94b92..abe34fb4bca 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs@@ -1,13 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigAreaCard extends Component {@tracked collapsed = false;get computedHeading() {if (this.args.heading) {- return I18n.t(this.args.heading);+ return i18n(this.args.heading);}return this.args.translatedHeading;}@@ -18,7 +18,7 @@ export default class AdminConfigAreaCard extends Component {get computedDescription() {if (this.args.description) {- return I18n.t(this.args.description);+ return i18n(this.args.description);}return this.args.translatedDescription;}diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/contact-information.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/contact-information.gjsindex e0bf32ec63c..c215ae17a64 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/contact-information.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/contact-information.gjs@@ -6,8 +6,7 @@ import { service } from "@ember/service";import Form from "discourse/components/form";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import GroupChooser from "select-kit/components/group-chooser";import UserChooser from "select-kit/components/user-chooser";@@ -65,7 +64,7 @@ export default class AdminConfigAreasAboutContactInformation extends Component {this.toasts.success({duration: 3000,data: {- message: I18n.t(+ message: i18n("admin.config_areas.about.toasts.contact_information_saved"),},diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjsindex 7ba26e0b715..3fdf8d1a90a 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs@@ -5,8 +5,7 @@ import { service } from "@ember/service";import Form from "discourse/components/form";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigAreasAboutGeneralSettings extends Component {@service toasts;@@ -47,7 +46,7 @@ export default class AdminConfigAreasAboutGeneralSettings extends Component {this.toasts.success({duration: 3000,data: {- message: I18n.t(+ message: i18n("admin.config_areas.about.toasts.general_settings_saved"),},diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/your-organization.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/your-organization.gjsindex b43af60d62b..4a6b105e7b7 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/your-organization.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/your-organization.gjs@@ -5,8 +5,7 @@ import { service } from "@ember/service";import Form from "discourse/components/form";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigAreasAboutYourOrganization extends Component {@service toasts;@@ -41,7 +40,7 @@ export default class AdminConfigAreasAboutYourOrganization extends Component {this.toasts.success({duration: 30000,data: {- message: I18n.t(+ message: i18n("admin.config_areas.about.toasts.your_organization_saved"),},diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-empty-list.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-empty-list.gjsindex f5bf3444354..08a7009ef2c 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-area-empty-list.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-area-empty-list.gjs@@ -1,6 +1,6 @@import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const AdminConfigAreaEmptyList = <template><div class="admin-config-area-empty-list">diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjsindex 5edfdac830c..16105126737 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { fn } from "@ember/helper";import { service } from "@ember/service";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";import ComboBox from "select-kit/components/combo-box";diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-settings.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-settings.gjsindex 69789093c0f..e500cd7ccae 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-settings.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-settings.gjs@@ -4,8 +4,8 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import { ajax } from "discourse/lib/ajax";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AdminFilteredSiteSettings from "admin/components/admin-filtered-site-settings";import SiteSetting from "admin/models/site-setting";diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/flags-settings.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags-settings.gjsindex c4937c76c78..72ffe975c08 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-areas/flags-settings.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags-settings.gjs@@ -4,8 +4,8 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import { ajax } from "discourse/lib/ajax";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AdminFilteredSiteSettings from "admin/components/admin-filtered-site-settings";import SiteSetting from "admin/models/site-setting";diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjsindex 796ac683da2..9da7d5899bb 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/flags.gjs@@ -5,8 +5,8 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { SYSTEM_FLAG_IDS } from "discourse/lib/constants";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AdminFlagItem from "admin/components/admin-flag-item";export default class AdminConfigAreasFlags extends Component {diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjsindex 12ba5fce070..66c8b369b3f 100644--- a/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminPageSubheader from "admin/components/admin-page-subheader";import InstallThemeModal from "admin/components/modal/install-theme";import ThemesGrid from "admin/components/themes-grid";@@ -37,7 +37,7 @@ export default class AdminConfigAreasLookAndFeelThemes extends Component {addTheme(theme) {this.toasts.success({data: {- message: I18n.t("admin.customize.theme.install_success", {+ message: i18n("admin.customize.theme.install_success", {theme: theme.name,}),},diff --git a/app/assets/javascripts/admin/addon/components/admin-filtered-site-settings.gjs b/app/assets/javascripts/admin/addon/components/admin-filtered-site-settings.gjsindex 1ce46e36b0a..ae2c7fa2182 100644--- a/app/assets/javascripts/admin/addon/components/admin-filtered-site-settings.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-filtered-site-settings.gjs@@ -6,8 +6,8 @@ import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";import SiteSettingFilter from "discourse/lib/site-setting-filter";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";+import { i18n } from "discourse-i18n";import AdminSiteSettingsFilterControls from "admin/components/admin-site-settings-filter-controls";import SiteSetting from "admin/components/site-setting";diff --git a/app/assets/javascripts/admin/addon/components/admin-flag-item.gjs b/app/assets/javascripts/admin/addon/components/admin-flag-item.gjsindex 8e4c7637e92..d7fc69a5da4 100644--- a/app/assets/javascripts/admin/addon/components/admin-flag-item.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-flag-item.gjs@@ -13,7 +13,7 @@ import concatClass from "discourse/helpers/concat-class";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { SYSTEM_FLAG_IDS } from "discourse/lib/constants";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";export default class AdminFlagItem extends Component {diff --git a/app/assets/javascripts/admin/addon/components/admin-flags-form.gjs b/app/assets/javascripts/admin/addon/components/admin-flags-form.gjsindex df9f4f7b5b1..d82dbcad8e4 100644--- a/app/assets/javascripts/admin/addon/components/admin-flags-form.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-flags-form.gjs@@ -7,9 +7,8 @@ import BackButton from "discourse/components/back-button";import Form from "discourse/components/form";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminConfigAreaCard from "admin/components/admin-config-area-card";import MultiSelect from "select-kit/components/multi-select";@@ -50,7 +49,7 @@ export default class AdminFlagsForm extends Component {get appliesToValues() {return this.site.valid_flag_applies_to_types.map((type) => {return {- name: I18n.t(+ name: i18n(`admin.config_areas.flags.form.${type.toLowerCase().replace("::", "_")}`diff --git a/app/assets/javascripts/admin/addon/components/admin-page-header.gjs b/app/assets/javascripts/admin/addon/components/admin-page-header.gjsindex 2e9a7d02e69..8b77c0b0a12 100644--- a/app/assets/javascripts/admin/addon/components/admin-page-header.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-page-header.gjs@@ -7,7 +7,7 @@ import DBreadcrumbsContainer from "discourse/components/d-breadcrumbs-container"import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import DropdownMenu from "discourse/components/dropdown-menu";import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import {DangerActionListItem,DangerButton,diff --git a/app/assets/javascripts/admin/addon/components/admin-page-subheader.gjs b/app/assets/javascripts/admin/addon/components/admin-page-subheader.gjsindex 642bfb3e99d..79cbd282be7 100644--- a/app/assets/javascripts/admin/addon/components/admin-page-subheader.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-page-subheader.gjs@@ -3,7 +3,7 @@ import { hash } from "@ember/helper";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import DropdownMenu from "discourse/components/dropdown-menu";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import {DangerActionListItem,DangerButton,diff --git a/app/assets/javascripts/admin/addon/components/admin-penalty-post-action.js b/app/assets/javascripts/admin/addon/components/admin-penalty-post-action.jsindex 8931f417f0b..1d256185782 100644--- a/app/assets/javascripts/admin/addon/components/admin-penalty-post-action.js+++ b/app/assets/javascripts/admin/addon/components/admin-penalty-post-action.js@@ -4,7 +4,7 @@ import { equal } from "@ember/object/computed";import discourseComputed, {afterRender,} from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const ACTIONS = ["delete", "delete_replies", "edit", "none"];@@ -17,7 +17,7 @@ export default class AdminPenaltyPostAction extends Component {@discourseComputedpenaltyActions() {return ACTIONS.map((id) => {- return { id, name: I18n.t(`admin.user.penalty_post_${id}`) };+ return { id, name: i18n(`admin.user.penalty_post_${id}`) };});}diff --git a/app/assets/javascripts/admin/addon/components/admin-penalty-reason.js b/app/assets/javascripts/admin/addon/components/admin-penalty-reason.jsindex b3ccd658759..6a2f3aa4332 100644--- a/app/assets/javascripts/admin/addon/components/admin-penalty-reason.js+++ b/app/assets/javascripts/admin/addon/components/admin-penalty-reason.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";const CUSTOM_REASON_KEY = "custom";@@ -26,7 +26,7 @@ export default class AdminPenaltyReason extends Component {@discourseComputed("reasonKeys")reasons(keys) {return keys.map((key) => {- return { id: key, name: I18n.t(`admin.user.suspend_reasons.${key}`) };+ return { id: key, name: i18n(`admin.user.suspend_reasons.${key}`) };});}@@ -48,7 +48,7 @@ export default class AdminPenaltyReason extends Component {} else {this.set("reason",- I18n.t(`admin.user.suspend_reasons.${this.selectedReason}`)+ i18n(`admin.user.suspend_reasons.${this.selectedReason}`));}}diff --git a/app/assets/javascripts/admin/addon/components/admin-permalink-form.gjs b/app/assets/javascripts/admin/addon/components/admin-permalink-form.gjsindex 5a1986ccaf1..f5e517b88ee 100644--- a/app/assets/javascripts/admin/addon/components/admin-permalink-form.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-permalink-form.gjs@@ -8,8 +8,8 @@ import { eq } from "truth-helpers";import BackButton from "discourse/components/back-button";import Form from "discourse/components/form";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AdminConfigAreaCard from "admin/components/admin-config-area-card";import Permalink from "admin/models/permalink";diff --git a/app/assets/javascripts/admin/addon/components/admin-plugin-config-area.gjs b/app/assets/javascripts/admin/addon/components/admin-plugin-config-area.gjsindex 13d74e2bcfb..78ac71d1326 100644--- a/app/assets/javascripts/admin/addon/components/admin-plugin-config-area.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-plugin-config-area.gjs@@ -2,14 +2,14 @@ import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import concatClass from "discourse/helpers/concat-class";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminPluginConfigArea extends Component {@service adminPluginNavManager;linkText(navLink) {if (navLink.label) {- return I18n.t(navLink.label);+ return i18n(navLink.label);} else {return navLink.text;}diff --git a/app/assets/javascripts/admin/addon/components/admin-plugin-config-page.gjs b/app/assets/javascripts/admin/addon/components/admin-plugin-config-page.gjsindex a4f138b0a85..a2d27c9f80a 100644--- a/app/assets/javascripts/admin/addon/components/admin-plugin-config-page.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-plugin-config-page.gjs@@ -3,7 +3,7 @@ import { service } from "@ember/service";import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import NavItem from "discourse/components/nav-item";import { headerActionComponentForPlugin } from "discourse/lib/admin-plugin-header-actions";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminPageHeader from "./admin-page-header";import AdminPluginConfigArea from "./admin-plugin-config-area";diff --git a/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs b/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjsindex 3c3446c7f5e..6176115332d 100644--- a/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs@@ -8,7 +8,7 @@ import DToggleSwitch from "discourse/components/d-toggle-switch";import PluginOutlet from "discourse/components/plugin-outlet";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import SiteSetting from "admin/models/site-setting";import PluginCommitHash from "./plugin-commit-hash";diff --git a/app/assets/javascripts/admin/addon/components/admin-plugins-list.gjs b/app/assets/javascripts/admin/addon/components/admin-plugins-list.gjsindex 64cda2b513f..c54d5e4558b 100644--- a/app/assets/javascripts/admin/addon/components/admin-plugins-list.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-plugins-list.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminPluginsListItem from "./admin-plugins-list-item";const AdminPluginsList = <template>diff --git a/app/assets/javascripts/admin/addon/components/admin-report-storage-stats.js b/app/assets/javascripts/admin/addon/components/admin-report-storage-stats.jsindex 9a9c9b61ad2..ffb3e4ebf1c 100644--- a/app/assets/javascripts/admin/addon/components/admin-report-storage-stats.js+++ b/app/assets/javascripts/admin/addon/components/admin-report-storage-stats.js@@ -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 "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";@classNames("admin-report-storage-stats")export default class AdminReportStorageStats extends Component {@@ -20,7 +20,7 @@ export default class AdminReportStorageStats extends Component {@discourseComputed("backupLocation")backupLocationName(backupLocation) {- return I18n.t(`admin.backups.location.${backupLocation}`);+ return i18n(`admin.backups.location.${backupLocation}`);}@discourseComputed("backupStats.used_bytes")diff --git a/app/assets/javascripts/admin/addon/components/admin-report.js b/app/assets/javascripts/admin/addon/components/admin-report.jsindex 60045d55add..4f51e30c89d 100644--- a/app/assets/javascripts/admin/addon/components/admin-report.js+++ b/app/assets/javascripts/admin/addon/components/admin-report.js@@ -10,7 +10,7 @@ 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 { i18n } from "discourse-i18n";import Report, { DAILY_LIMIT_DAYS, SCHEMA_VERSION } from "admin/models/report";const TABLE_OPTIONS = {@@ -32,7 +32,7 @@ const CHART_OPTIONS = {};@classNames("admin-report")export default class AdminReport extends Component {isEnabled = true;- disabledLabel = I18n.t("admin.dashboard.disabled");+ disabledLabel = i18n("admin.dashboard.disabled");isLoading = false;rateLimitationString = null;dataSourceName = null;@@ -336,7 +336,7 @@ export default class AdminReport extends Component {if (response === 429) {this.set("rateLimitationString",- I18n.t("admin.dashboard.too_many_requests")+ i18n("admin.dashboard.too_many_requests"));} else if (response === 500) {this.set("model.error", "exception");diff --git a/app/assets/javascripts/admin/addon/components/admin-reports.gjs b/app/assets/javascripts/admin/addon/components/admin-reports.gjsindex bc8df730b6f..48f8a35d563 100644--- a/app/assets/javascripts/admin/addon/components/admin-reports.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-reports.gjs@@ -8,8 +8,8 @@ import { htmlSafe } from "@ember/template";import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";import { ajax } from "discourse/lib/ajax";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";export default class AdminReports extends Component {@service siteSettings;diff --git a/app/assets/javascripts/admin/addon/components/admin-section-landing-item.gjs b/app/assets/javascripts/admin/addon/components/admin-section-landing-item.gjsindex 71071b2e7fd..c81ae55ebe1 100644--- a/app/assets/javascripts/admin/addon/components/admin-section-landing-item.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-section-landing-item.gjs@@ -3,7 +3,7 @@ import { hash } from "@ember/helper";import { LinkTo } from "@ember/routing";import concatClass from "discourse/helpers/concat-class";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import {DangerButton,DefaultButton,diff --git a/app/assets/javascripts/admin/addon/components/admin-site-settings-filter-controls.gjs b/app/assets/javascripts/admin/addon/components/admin-site-settings-filter-controls.gjsindex e6d1a3b17ac..73d837d9555 100644--- a/app/assets/javascripts/admin/addon/components/admin-site-settings-filter-controls.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-site-settings-filter-controls.gjs@@ -6,7 +6,7 @@ import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import didUpdate from "@ember/render-modifiers/modifiers/did-update";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class AdminSiteSettingsFilterControls extends Component {@tracked filter = this.args.initialFilter || "";diff --git a/app/assets/javascripts/admin/addon/components/admin-theme-editor.js b/app/assets/javascripts/admin/addon/components/admin-theme-editor.jsindex 0ffdd46a55c..ae540f1d897 100644--- a/app/assets/javascripts/admin/addon/components/admin-theme-editor.js+++ b/app/assets/javascripts/admin/addon/components/admin-theme-editor.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminThemeEditor extends Component {warning = null;@@ -55,7 +55,7 @@ export default class AdminThemeEditor extends Component {" --mytheme-tertiary-or-highlight: #{dark-light-choose($tertiary, $highlight)};\n" +"}";- return I18n.t("admin.customize.theme.color_definitions.placeholder", {+ return i18n("admin.customize.theme.color_definitions.placeholder", {example: isDocumentRTL() ? `<div dir="ltr">${example}</div>` : example,});}diff --git a/app/assets/javascripts/admin/addon/components/admin-user-field-item.js b/app/assets/javascripts/admin/addon/components/admin-user-field-item.jsindex e3c2609a637..91bb9d6a79a 100644--- a/app/assets/javascripts/admin/addon/components/admin-user-field-item.js+++ b/app/assets/javascripts/admin/addon/components/admin-user-field-item.js@@ -7,7 +7,7 @@ import { isEmpty } from "@ember/utils";import { tagName } from "@ember-decorators/component";import { Promise } from "rsvp";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import UserField from "admin/models/user-field";@tagName("")@@ -48,7 +48,7 @@ export default class AdminUserFieldItem extends Component {return flags.map((flag) => {if (this.args.userField[flag]) {- return I18n.t(`admin.user_fields.${flag}.enabled`);+ return i18n(`admin.user_fields.${flag}.enabled`);}}).filter(Boolean)@@ -114,7 +114,7 @@ export default class AdminUserFieldItem extends Component {async _confirmChanges() {return new Promise((resolve) => {this.dialog.yesNoConfirm({- message: I18n.t("admin.user_fields.requirement.confirmation"),+ message: i18n("admin.user_fields.requirement.confirmation"),didCancel: () => resolve(false),didConfirm: () => resolve(true),});diff --git a/app/assets/javascripts/admin/addon/components/admin-watched-word.gjs b/app/assets/javascripts/admin/addon/components/admin-watched-word.gjsindex 1ebe82e9b20..4a2c61e3801 100644--- a/app/assets/javascripts/admin/addon/components/admin-watched-word.gjs+++ b/app/assets/javascripts/admin/addon/components/admin-watched-word.gjs@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { eq, or } from "truth-helpers";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class AdminWatchedWord extends Component {@service dialog;diff --git a/app/assets/javascripts/admin/addon/components/dashboard-new-feature-item.gjs b/app/assets/javascripts/admin/addon/components/dashboard-new-feature-item.gjsindex 02d86fb6e89..f42e4d225bc 100644--- a/app/assets/javascripts/admin/addon/components/dashboard-new-feature-item.gjs+++ b/app/assets/javascripts/admin/addon/components/dashboard-new-feature-item.gjs@@ -10,9 +10,8 @@ import DToggleSwitch from "discourse/components/d-toggle-switch";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DTooltip from "float-kit/components/d-tooltip";export default class DiscourseNewFeatureItem extends Component {@@ -33,7 +32,7 @@ export default class DiscourseNewFeatureItem extends Component {this.toasts.error({duration: 3000,data: {- message: I18n.t(+ message: i18n("admin.dashboard.new_features.experiment_toggled_too_fast"),},@@ -57,8 +56,8 @@ export default class DiscourseNewFeatureItem extends Component {duration: 3000,data: {message: this.experimentEnabled- ? I18n.t("admin.dashboard.new_features.experiment_enabled")- : I18n.t("admin.dashboard.new_features.experiment_disabled"),+ ? i18n("admin.dashboard.new_features.experiment_enabled")+ : i18n("admin.dashboard.new_features.experiment_disabled"),},});} catch (error) {diff --git a/app/assets/javascripts/admin/addon/components/dashboard-new-features.gjs b/app/assets/javascripts/admin/addon/components/dashboard-new-features.gjsindex 7d48e7d1a74..d94c4176b7d 100644--- a/app/assets/javascripts/admin/addon/components/dashboard-new-features.gjs+++ b/app/assets/javascripts/admin/addon/components/dashboard-new-features.gjs@@ -4,8 +4,8 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { ajax } from "discourse/lib/ajax";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AdminConfigAreaCard from "admin/components/admin-config-area-card";import DashboardNewFeatureItem from "admin/components/dashboard-new-feature-item";diff --git a/app/assets/javascripts/admin/addon/components/dashboard-problems.gjs b/app/assets/javascripts/admin/addon/components/dashboard-problems.gjsindex 882d65501d6..6db1c8ac0f2 100644--- a/app/assets/javascripts/admin/addon/components/dashboard-problems.gjs+++ b/app/assets/javascripts/admin/addon/components/dashboard-problems.gjs@@ -8,7 +8,7 @@ import concatClass from "discourse/helpers/concat-class";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminNotice from "admin/components/admin-notice";export default class DashboardProblems extends Component {diff --git a/app/assets/javascripts/admin/addon/components/email-styles-editor.js b/app/assets/javascripts/admin/addon/components/email-styles-editor.jsindex 63b8fde808f..ccacf59a7e1 100644--- a/app/assets/javascripts/admin/addon/components/email-styles-editor.js+++ b/app/assets/javascripts/admin/addon/components/email-styles-editor.js@@ -3,7 +3,7 @@ import { action, computed } from "@ember/object";import { reads } from "@ember/object/computed";import { service } from "@ember/service";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EmailStylesEditor extends Component {@service dialog;@@ -35,8 +35,8 @@ export default class EmailStylesEditor extends Component {@actionreset() {this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.email_style.reset_confirm", {- fieldName: I18n.t(`admin.customize.email_style.${this.fieldName}`),+ message: i18n("admin.customize.email_style.reset_confirm", {+ fieldName: i18n(`admin.customize.email_style.${this.fieldName}`),}),didConfirm: () => {this.styles.setField(diff --git a/app/assets/javascripts/admin/addon/components/embeddable-host.js b/app/assets/javascripts/admin/addon/components/embeddable-host.jsindex 6eba3399073..467b928f826 100644--- a/app/assets/javascripts/admin/addon/components/embeddable-host.js+++ b/app/assets/javascripts/admin/addon/components/embeddable-host.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("tr")export default class EmbeddableHost extends Component.extend(@@ -77,7 +77,7 @@ export default class EmbeddableHost extends Component.extend(@actiondelete() {return this.dialog.confirm({- message: I18n.t("admin.embedding.confirm_delete"),+ message: i18n("admin.embedding.confirm_delete"),didConfirm: () => {return this.host.destroyRecord().then(() => {this.deleteHost(this.host);diff --git a/app/assets/javascripts/admin/addon/components/emoji-uploader.js b/app/assets/javascripts/admin/addon/components/emoji-uploader.jsindex 50670dca373..e26de7271a7 100644--- a/app/assets/javascripts/admin/addon/components/emoji-uploader.js+++ b/app/assets/javascripts/admin/addon/components/emoji-uploader.js@@ -5,7 +5,7 @@ import { getOwner } from "@ember/owner";import { isEmpty } from "@ember/utils";import UppyUpload from "discourse/lib/uppy/uppy-upload";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DEFAULT_GROUP = "default";export default class EmojiUploader extends Component {@@ -74,9 +74,9 @@ export default class EmojiUploader extends Component {@discourseComputed("uppyUpload.uploading", "uppyUpload.uploadProgress")buttonLabel(uploading, uploadProgress) {if (uploading) {- return `${I18n.t("admin.emoji.uploading")} ${uploadProgress}%`;+ return `${i18n("admin.emoji.uploading")} ${uploadProgress}%`;} else {- return I18n.t("admin.emoji.choose_files");+ return i18n("admin.emoji.choose_files");}}diff --git a/app/assets/javascripts/admin/addon/components/emoji-value-list.js b/app/assets/javascripts/admin/addon/components/emoji-value-list.jsindex 0166c48ed07..b6a8a55ce3d 100644--- a/app/assets/javascripts/admin/addon/components/emoji-value-list.js+++ b/app/assets/javascripts/admin/addon/components/emoji-value-list.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";@classNameBindings(":value-list", ":emoji-list")export default class EmojiValueList extends Component {@@ -138,7 +138,7 @@ export default class EmojiValueList extends Component {_validateInput(input) {if (!emojiUrlFor(input)) {this.setValidationMessage(- I18n.t("admin.site_settings.emoji_list.invalid_input")+ i18n("admin.site_settings.emoji_list.invalid_input"));return false;}diff --git a/app/assets/javascripts/admin/addon/components/file-size-input.gjs b/app/assets/javascripts/admin/addon/components/file-size-input.gjsindex b4c144d2b2f..a08145a36eb 100644--- a/app/assets/javascripts/admin/addon/components/file-size-input.gjs+++ b/app/assets/javascripts/admin/addon/components/file-size-input.gjs@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { on } from "@ember/modifier";import { action } from "@ember/object";import { allowOnlyNumericInput } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import ComboBox from "select-kit/components/combo-box";const UNIT_KB = "kb";@@ -49,9 +49,9 @@ export default class FileSizeInput extends Component {get dropdownOptions() {return [- { label: I18n.t("number.human.storage_units.units.kb"), value: UNIT_KB },- { label: I18n.t("number.human.storage_units.units.mb"), value: UNIT_MB },- { label: I18n.t("number.human.storage_units.units.gb"), value: UNIT_GB },+ { label: i18n("number.human.storage_units.units.kb"), value: UNIT_KB },+ { label: i18n("number.human.storage_units.units.mb"), value: UNIT_MB },+ { label: i18n("number.human.storage_units.units.gb"), value: UNIT_GB },];}@@ -81,14 +81,14 @@ export default class FileSizeInput extends Component {if (sizeInKB > this.args.max) {this.args.setValidationMessage(- I18n.t("file_size_input.error.size_too_large", {+ i18n("file_size_input.error.size_too_large", {provided_file_size: I18n.toHumanSize(sizeInKB * 1024),max_file_size: I18n.toHumanSize(this.args.max * 1024),}));} else if (sizeInKB < this.args.min) {this.args.setValidationMessage(- I18n.t("file_size_input.error.size_too_small", {+ i18n("file_size_input.error.size_too_small", {provided_file_size: I18n.toHumanSize(sizeInKB * 1024),min_file_size: I18n.toHumanSize(this.args.min * 1024),})diff --git a/app/assets/javascripts/admin/addon/components/form-template/form.js b/app/assets/javascripts/admin/addon/components/form-template/form.jsindex 9f8d36d8efe..90e68f11288 100644--- a/app/assets/javascripts/admin/addon/components/form-template/form.js+++ b/app/assets/javascripts/admin/addon/components/form-template/form.js@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+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";@@ -91,7 +91,7 @@ export default class FormTemplateForm extends Component {@actiononDelete() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.form_templates.delete_confirm"),+ message: i18n("admin.form_templates.delete_confirm"),didConfirm: () => {FormTemplate.deleteTemplate(this.args.model.id).then(() => {diff --git a/app/assets/javascripts/admin/addon/components/form-template/row-item.js b/app/assets/javascripts/admin/addon/components/form-template/row-item.jsindex d6b4236b9fd..83f7adc29e8 100644--- a/app/assets/javascripts/admin/addon/components/form-template/row-item.js+++ b/app/assets/javascripts/admin/addon/components/form-template/row-item.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FormTemplateRowItem extends Component {@service router;@@ -27,7 +27,7 @@ export default class FormTemplateRowItem extends Component {@actiondeleteTemplate() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.form_templates.delete_confirm", {+ message: i18n("admin.form_templates.delete_confirm", {template_name: this.args.template.name,}),didConfirm: () => {diff --git a/app/assets/javascripts/admin/addon/components/images-uploader.js b/app/assets/javascripts/admin/addon/components/images-uploader.jsindex 7c1ff3f6195..ca69f24c32b 100644--- a/app/assets/javascripts/admin/addon/components/images-uploader.js+++ b/app/assets/javascripts/admin/addon/components/images-uploader.js@@ -2,7 +2,7 @@ import Component from "@ember/component";import { getOwner } from "@ember/owner";import { tagName } from "@ember-decorators/component";import UppyUpload from "discourse/lib/uppy/uppy-upload";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("span")export default class ImagesUploader extends Component {@@ -22,6 +22,6 @@ export default class ImagesUploader extends Component {}get uploadButtonText() {- return this.uploadingOrProcessing ? I18n.t("uploading") : I18n.t("upload");+ return this.uploadingOrProcessing ? i18n("uploading") : i18n("upload");}}diff --git a/app/assets/javascripts/admin/addon/components/install-theme-item.gjs b/app/assets/javascripts/admin/addon/components/install-theme-item.gjsindex a415600aeed..e53cfefa663 100644--- a/app/assets/javascripts/admin/addon/components/install-theme-item.gjs+++ b/app/assets/javascripts/admin/addon/components/install-theme-item.gjs@@ -1,6 +1,6 @@import RadioButton from "discourse/components/radio-button";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const InstallThemeItem = <template><div class="install-theme-item">diff --git a/app/assets/javascripts/admin/addon/components/ip-lookup.js b/app/assets/javascripts/admin/addon/components/ip-lookup.jsindex c50d6bde2cb..30fd6a48902 100644--- a/app/assets/javascripts/admin/addon/components/ip-lookup.js+++ b/app/assets/javascripts/admin/addon/components/ip-lookup.js@@ -8,7 +8,7 @@ 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 { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";@classNames("ip-lookup")@@ -67,18 +67,18 @@ export default class IpLookup extends Component {const location = this.location;if (location) {if (location.hostname) {- text += `${I18n.t("ip_lookup.hostname")}: ${location.hostname}\n`;+ text += `${i18n("ip_lookup.hostname")}: ${location.hostname}\n`;}- text += I18n.t("ip_lookup.location");+ text += i18n("ip_lookup.location");if (location.location) {text += `: ${location.location}\n`;} else {- text += `: ${I18n.t("ip_lookup.location_not_found")}\n`;+ text += `: ${i18n("ip_lookup.location_not_found")}\n`;}if (location.organization) {- text += I18n.t("ip_lookup.organisation");+ text += i18n("ip_lookup.organisation");text += `: ${location.organization}\n`;}}@@ -96,7 +96,7 @@ export default class IpLookup extends Component {@actiondeleteOtherAccounts() {this.dialog.yesNoConfirm({- message: I18n.t("ip_lookup.confirm_delete_other_accounts"),+ message: i18n("ip_lookup.confirm_delete_other_accounts"),didConfirm: () => {this.setProperties({other_accounts: null,diff --git a/app/assets/javascripts/admin/addon/components/modal/badge-preview.js b/app/assets/javascripts/admin/addon/components/modal/badge-preview.jsindex 6641803ea78..c51d7024c6c 100644--- a/app/assets/javascripts/admin/addon/components/modal/badge-preview.js+++ b/app/assets/javascripts/admin/addon/components/modal/badge-preview.js@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { escapeExpression } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BadgePreview extends Component {get processedSample() {@@ -18,11 +18,11 @@ export default class BadgePreview extends Component {if (grant.granted_at) {i18nKey += "_time";i18nParams.time = escapeExpression(- moment(grant.granted_at).format(I18n.t("dates.long_with_year"))+ moment(grant.granted_at).format(i18n("dates.long_with_year")));}- return I18n.t(i18nKey, i18nParams);+ return i18n(i18nKey, i18nParams);});}diff --git a/app/assets/javascripts/admin/addon/components/modal/delete-posts-confirmation.js b/app/assets/javascripts/admin/addon/components/modal/delete-posts-confirmation.jsindex 6dafd58a7e7..1e87b49e912 100644--- a/app/assets/javascripts/admin/addon/components/modal/delete-posts-confirmation.js+++ b/app/assets/javascripts/admin/addon/components/modal/delete-posts-confirmation.js@@ -1,12 +1,12 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class DeletePostsConfirmation extends Component {@tracked value;get text() {- return I18n.t("admin.user.delete_posts.confirmation.text", {+ return i18n("admin.user.delete_posts.confirmation.text", {username: this.args.model.user.username,post_count: this.args.model.user.post_count,});diff --git a/app/assets/javascripts/admin/addon/components/modal/delete-user-posts-progress.js b/app/assets/javascripts/admin/addon/components/modal/delete-user-posts-progress.jsindex 91aa4ca22b6..a726f3350ee 100644--- a/app/assets/javascripts/admin/addon/components/modal/delete-user-posts-progress.js+++ b/app/assets/javascripts/admin/addon/components/modal/delete-user-posts-progress.js@@ -2,7 +2,7 @@ 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 { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";export default class DeleteUserPostsProgress extends Component {@@ -36,7 +36,7 @@ export default class DeleteUserPostsProgress extends Component {AdminUser.find(this.args.model.user.id).then((u) =>this.args.model.user.setProperties(u));- this.flash = extractError(e, I18n.t("admin.user.delete_posts_failed"));+ this.flash = extractError(e, i18n("admin.user.delete_posts_failed"));}}}diff --git a/app/assets/javascripts/admin/addon/components/modal/edit-badge-groupings.js b/app/assets/javascripts/admin/addon/components/modal/edit-badge-groupings.jsindex c5cb9c1bbbe..fe6eab91a8d 100644--- a/app/assets/javascripts/admin/addon/components/modal/edit-badge-groupings.js+++ b/app/assets/javascripts/admin/addon/components/modal/edit-badge-groupings.js@@ -5,7 +5,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { TrackedArray } from "@ember-compat/tracked-built-ins";import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EditBadgeGroupings extends Component {@service dialog;@@ -43,7 +43,7 @@ export default class EditBadgeGroupings extends Component {add() {const obj = this.store.createRecord("badge-grouping", {editing: true,- name: I18n.t("admin.badges.badge_grouping"),+ name: i18n("admin.badges.badge_grouping"),});this.workingCopy.pushObject(obj);}@@ -69,7 +69,7 @@ export default class EditBadgeGroupings extends Component {this.args.model.updateGroupings(this.workingCopy);this.args.closeModal();} catch {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}}diff --git a/app/assets/javascripts/admin/addon/components/modal/form-template-validation-options.js b/app/assets/javascripts/admin/addon/components/modal/form-template-validation-options.jsindex d740398246d..815cff26b78 100644--- a/app/assets/javascripts/admin/addon/components/modal/form-template-validation-options.js+++ b/app/assets/javascripts/admin/addon/components/modal/form-template-validation-options.js@@ -1,5 +1,5 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const TABLE_HEADER_KEYS = ["key", "type", "description"];const VALIDATION_KEYS = ["required", "minimum", "maximum", "pattern", "type"];@@ -9,7 +9,7 @@ export default class FormTemplateValidationOptions extends Component {const translatedHeaders = [];TABLE_HEADER_KEYS.forEach((header) => {translatedHeaders.push(- I18n.t(`admin.form_templates.validations_modal.table_headers.${header}`)+ i18n(`admin.form_templates.validations_modal.table_headers.${header}`));});@@ -21,9 +21,9 @@ export default class FormTemplateValidationOptions extends Component {const prefix = "admin.form_templates.validations_modal.validations";VALIDATION_KEYS.forEach((validation) => {translatedValidations.push({- key: I18n.t(`${prefix}.${validation}.key`),- type: I18n.t(`${prefix}.${validation}.type`),- description: I18n.t(`${prefix}.${validation}.description`),+ key: i18n(`${prefix}.${validation}.key`),+ type: i18n(`${prefix}.${validation}.type`),+ description: i18n(`${prefix}.${validation}.description`),});});diff --git a/app/assets/javascripts/admin/addon/components/modal/install-theme.gjs b/app/assets/javascripts/admin/addon/components/modal/install-theme.gjsindex 193ae3e42f9..534c6ca63a7 100644--- a/app/assets/javascripts/admin/addon/components/modal/install-theme.gjs+++ b/app/assets/javascripts/admin/addon/components/modal/install-theme.gjs@@ -14,17 +14,16 @@ import withEventValue from "discourse/helpers/with-event-value";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { POPULAR_THEMES } from "discourse-common/lib/popular-themes";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import InstallThemeItem from "admin/components/install-theme-item";import { COMPONENTS, THEMES } from "admin/models/theme";import ComboBox from "select-kit/components/combo-box";const MIN_NAME_LENGTH = 4;const CREATE_TYPES = [- { name: I18n.t("admin.customize.theme.theme"), value: THEMES },- { name: I18n.t("admin.customize.theme.component"), value: COMPONENTS },+ { name: i18n("admin.customize.theme.theme"), value: THEMES },+ { name: i18n("admin.customize.theme.component"), value: COMPONENTS },];export default class InstallThemeModal extends Component {@@ -98,9 +97,9 @@ export default class InstallThemeModal extends Component {get placeholder() {if (this.component) {- return I18n.t("admin.customize.theme.component_name");+ return i18n("admin.customize.theme.component_name");} else {- return I18n.t("admin.customize.theme.theme_name");+ return i18n("admin.customize.theme.theme_name");}}@@ -200,7 +199,7 @@ export default class InstallThemeModal extends Component {this.themeHasSameUrl(theme, this.uploadUrl));if (duplicate && !this.duplicateRemoteThemeWarning) {- const warning = I18n.t("admin.customize.theme.duplicate_remote_theme", {+ const warning = i18n("admin.customize.theme.duplicate_remote_theme", {name: duplicate.name,});this.duplicateRemoteThemeWarning = warning;@@ -234,9 +233,7 @@ export default class InstallThemeModal extends Component {if (!this.publicKey || this.themeCannotBeInstalled) {return popupAjaxError(err);}- this.themeCannotBeInstalled = I18n.t(- "admin.customize.theme.force_install"- );+ this.themeCannotBeInstalled = i18n("admin.customize.theme.force_install");} finally {this.loading = false;}diff --git a/app/assets/javascripts/admin/addon/components/modal/merge-users-confirmation.js b/app/assets/javascripts/admin/addon/components/modal/merge-users-confirmation.jsindex 1aff4f7fe68..c9a30288e23 100644--- a/app/assets/javascripts/admin/addon/components/modal/merge-users-confirmation.js+++ b/app/assets/javascripts/admin/addon/components/modal/merge-users-confirmation.js@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class MergeUsersConfirmation extends Component {@tracked value;@@ -10,7 +10,7 @@ export default class MergeUsersConfirmation extends Component {}get text() {- return I18n.t("admin.user.merge.confirmation.text", {+ return i18n("admin.user.merge.confirmation.text", {username: this.args.model.username,targetUsername: this.args.model.targetUsername,});diff --git a/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js b/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.jsindex 0e776fed963..344a1e85219 100644--- a/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js+++ b/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js@@ -3,12 +3,12 @@ import { tracked } from "@glimmer/tracking";import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class MergeUsersProgress extends Component {@service messageBus;- @tracked message = I18n.t("admin.user.merging_user");+ @tracked message = i18n("admin.user.merging_user");constructor() {super(...arguments);@@ -33,7 +33,7 @@ export default class MergeUsersProgress extends Component {} else if (data.message) {this.message = data.message;} else if (data.failed) {- this.message = I18n.t("admin.user.merge_failed");+ this.message = i18n("admin.user.merge_failed");}}}diff --git a/app/assets/javascripts/admin/addon/components/modal/penalize-user.js b/app/assets/javascripts/admin/addon/components/modal/penalize-user.jsindex b775a69f0ab..ac87710f7fd 100644--- a/app/assets/javascripts/admin/addon/components/modal/penalize-user.js+++ b/app/assets/javascripts/admin/addon/components/modal/penalize-user.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import { extractError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";export default class PenalizeUser extends Component {@service dialog;@@ -114,7 +114,7 @@ export default class PenalizeUser extends Component {warnBeforeClosing() {if (!this.confirmClose && (this.reason?.length || this.message?.length)) {this.dialog.confirm({- message: I18n.t("admin.user.confirm_cancel_penalty"),+ message: i18n("admin.user.confirm_cancel_penalty"),didConfirm: () => this.args.closeModal(),});return false;diff --git a/app/assets/javascripts/admin/addon/components/modal/reseed.js b/app/assets/javascripts/admin/addon/components/modal/reseed.jsindex ea6b0761ad7..6db3656768c 100644--- a/app/assets/javascripts/admin/addon/components/modal/reseed.js+++ b/app/assets/javascripts/admin/addon/components/modal/reseed.js@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Reseed extends Component {@service dialog;@@ -49,7 +49,7 @@ export default class Reseed extends Component {this.flash = null;this.args.closeModal();} catch {- this.flash = I18n.t("generic_error");+ this.flash = i18n("generic_error");} finally {this.reseeding = false;}diff --git a/app/assets/javascripts/admin/addon/components/modal/start-backup.js b/app/assets/javascripts/admin/addon/components/modal/start-backup.jsindex 17e41feb43c..c463329247d 100644--- a/app/assets/javascripts/admin/addon/components/modal/start-backup.js+++ b/app/assets/javascripts/admin/addon/components/modal/start-backup.js@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class StartBackup extends Component {@service siteSettings;@@ -24,7 +24,7 @@ export default class StartBackup extends Component {this.siteSettings.enable_s3_uploads &&!this.siteSettings.include_s3_uploads_in_backups) {- return I18n.t("admin.backups.operations.backup.s3_upload_warning");+ return i18n("admin.backups.operations.backup.s3_upload_warning");}return "";}diff --git a/app/assets/javascripts/admin/addon/components/modal/watched-word-testing.gjs b/app/assets/javascripts/admin/addon/components/modal/watched-word-testing.gjsindex 45b059ccb11..c86bf0571cc 100644--- a/app/assets/javascripts/admin/addon/components/modal/watched-word-testing.gjs+++ b/app/assets/javascripts/admin/addon/components/modal/watched-word-testing.gjs@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { Textarea } from "@ember/component";import { or } from "truth-helpers";import DModal from "discourse/components/d-modal";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class WatchedWordTesting extends Component {@tracked value;diff --git a/app/assets/javascripts/admin/addon/components/permalink-form.js b/app/assets/javascripts/admin/addon/components/permalink-form.jsindex 9e55889384c..e903e5a6bfa 100644--- a/app/assets/javascripts/admin/addon/components/permalink-form.js+++ b/app/assets/javascripts/admin/addon/components/permalink-form.js@@ -5,7 +5,7 @@ import { 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 { i18n } from "discourse-i18n";import Permalink from "admin/models/permalink";@tagName("")@@ -23,12 +23,12 @@ export default class PermalinkForm extends Component {@discourseComputedpermalinkTypes() {return [- { id: "topic_id", name: I18n.t("admin.permalink.topic_id") },- { id: "post_id", name: I18n.t("admin.permalink.post_id") },- { id: "category_id", name: I18n.t("admin.permalink.category_id") },- { id: "tag_name", name: I18n.t("admin.permalink.tag_name") },- { id: "external_url", name: I18n.t("admin.permalink.external_url") },- { id: "user_id", name: I18n.t("admin.permalink.user_id") },+ { id: "topic_id", name: i18n("admin.permalink.topic_id") },+ { id: "post_id", name: i18n("admin.permalink.post_id") },+ { id: "category_id", name: i18n("admin.permalink.category_id") },+ { id: "tag_name", name: i18n("admin.permalink.tag_name") },+ { id: "external_url", name: i18n("admin.permalink.external_url") },+ { id: "user_id", name: i18n("admin.permalink.user_id") },];}@@ -74,11 +74,11 @@ export default class PermalinkForm extends Component {let error;if (e?.jqXHR?.responseJSON?.errors) {- error = I18n.t("generic_error_with_reason", {+ error = i18n("generic_error_with_reason", {error: e.jqXHR.responseJSON.errors.join(". "),});} else {- error = I18n.t("generic_error");+ error = i18n("generic_error");}this.dialog.alert({diff --git a/app/assets/javascripts/admin/addon/components/schema-theme-setting/editor.gjs b/app/assets/javascripts/admin/addon/components/schema-theme-setting/editor.gjsindex 0d769ac4b73..0335f70f41b 100644--- a/app/assets/javascripts/admin/addon/components/schema-theme-setting/editor.gjs+++ b/app/assets/javascripts/admin/addon/components/schema-theme-setting/editor.gjs@@ -7,7 +7,7 @@ import { gt } from "truth-helpers";import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Tree from "admin/components/schema-theme-setting/editor/tree";import FieldInput from "admin/components/schema-theme-setting/field";@@ -68,7 +68,7 @@ export default class SchemaThemeSettingNewEditor extends Component {const lastHistory = this.history[this.history.length - 1];- return I18n.t("admin.customize.theme.schema.back_button", {+ return i18n("admin.customize.theme.schema.back_button", {name: this.generateSchemaTitle(this.#resolveDataFromPaths(lastHistory.dataPaths)[lastHistory.index],this.#resolveSchemaFromPaths(lastHistory.schemaPaths),diff --git a/app/assets/javascripts/admin/addon/components/schema-theme-setting/number-field.gjs b/app/assets/javascripts/admin/addon/components/schema-theme-setting/number-field.gjsindex fd5707802ea..79f2c8f99d6 100644--- a/app/assets/javascripts/admin/addon/components/schema-theme-setting/number-field.gjs+++ b/app/assets/javascripts/admin/addon/components/schema-theme-setting/number-field.gjs@@ -4,7 +4,7 @@ import { Input } from "@ember/component";import { on } from "@ember/modifier";import { action } from "@ember/object";import { and, not } from "truth-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import FieldInputDescription from "admin/components/schema-theme-setting/field-input-description";export default class SchemaThemeSettingNumberField extends Component {@@ -43,20 +43,20 @@ export default class SchemaThemeSettingNumberField extends Component {if (!this.value) {if (this.required) {- return I18n.t("admin.customize.theme.schema.fields.required");+ return i18n("admin.customize.theme.schema.fields.required");} else {return;}}if (this.min && this.value < this.min) {- return I18n.t("admin.customize.theme.schema.fields.number.too_small", {+ return i18n("admin.customize.theme.schema.fields.number.too_small", {count: this.min,});}if (this.max && this.value > this.max) {- return I18n.t("admin.customize.theme.schema.fields.number.too_large", {+ return i18n("admin.customize.theme.schema.fields.number.too_large", {count: this.max,});}diff --git a/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/models.gjs b/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/models.gjsindex 6bc3958eb1d..aa1c820390f 100644--- a/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/models.gjs+++ b/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/models.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { isBlank } from "@ember/utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SchemaThemeSettingTypeModels extends Component {@tracked value = this.args.value;@@ -33,12 +33,9 @@ export default class SchemaThemeSettingTypeModels extends Component {(this.min && this.value && this.value.length < this.min) ||(this.required && isValueBlank)) {- return I18n.t(- `admin.customize.theme.schema.fields.${this.type}.at_least`,- {- count: this.min || 1,- }- );+ return i18n(`admin.customize.theme.schema.fields.${this.type}.at_least`, {+ count: this.min || 1,+ });}}}diff --git a/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/string.gjs b/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/string.gjsindex 92c83d82850..455514b7144 100644--- a/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/string.gjs+++ b/app/assets/javascripts/admin/addon/components/schema-theme-setting/types/string.gjs@@ -5,7 +5,7 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import { and, not } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import FieldInputDescription from "admin/components/schema-theme-setting/field-input-description";export default class SchemaThemeSettingTypeString extends Component {@@ -32,14 +32,14 @@ export default class SchemaThemeSettingTypeString extends Component {if (valueLength === 0) {if (this.required) {- return I18n.t("admin.customize.theme.schema.fields.required");+ return i18n("admin.customize.theme.schema.fields.required");} else {return;}}if (this.minLength && valueLength < this.minLength) {- return I18n.t("admin.customize.theme.schema.fields.string.too_short", {+ return i18n("admin.customize.theme.schema.fields.string.too_short", {count: this.minLength,});}diff --git a/app/assets/javascripts/admin/addon/components/screened-ip-address-form.js b/app/assets/javascripts/admin/addon/components/screened-ip-address-form.jsindex 8324b410335..452382823b7 100644--- a/app/assets/javascripts/admin/addon/components/screened-ip-address-form.js+++ b/app/assets/javascripts/admin/addon/components/screened-ip-address-form.js@@ -4,7 +4,7 @@ import { schedule } from "@ember/runloop";import { service } from "@ember/service";import { classNames, tagName } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ScreenedIpAddress from "admin/models/screened-ip-address";/**@@ -30,22 +30,22 @@ export default class ScreenedIpAddressForm extends Component {actionNames(adminAllowlistEnabled) {if (adminAllowlistEnabled) {return [- { id: "block", name: I18n.t("admin.logs.screened_ips.actions.block") },+ { id: "block", name: i18n("admin.logs.screened_ips.actions.block") },{id: "do_nothing",- name: I18n.t("admin.logs.screened_ips.actions.do_nothing"),+ name: i18n("admin.logs.screened_ips.actions.do_nothing"),},{id: "allow_admin",- name: I18n.t("admin.logs.screened_ips.actions.allow_admin"),+ name: i18n("admin.logs.screened_ips.actions.allow_admin"),},];} else {return [- { id: "block", name: I18n.t("admin.logs.screened_ips.actions.block") },+ { id: "block", name: i18n("admin.logs.screened_ips.actions.block") },{id: "do_nothing",- name: I18n.t("admin.logs.screened_ips.actions.do_nothing"),+ name: i18n("admin.logs.screened_ips.actions.do_nothing"),},];}@@ -75,10 +75,10 @@ export default class ScreenedIpAddressForm extends Component {.catch((e) => {this.set("formSubmitted", false);const message = e.jqXHR.responseJSON?.errors- ? I18n.t("generic_error_with_reason", {+ ? i18n("generic_error_with_reason", {error: e.jqXHR.responseJSON.errors.join(". "),})- : I18n.t("generic_error");+ : i18n("generic_error");this.dialog.alert({message,didConfirm: () => this.focusInput(),diff --git a/app/assets/javascripts/admin/addon/components/secret-value-list.js b/app/assets/javascripts/admin/addon/components/secret-value-list.jsindex 1bc7f87c6d0..11a87ec51d8 100644--- a/app/assets/javascripts/admin/addon/components/secret-value-list.js+++ b/app/assets/javascripts/admin/addon/components/secret-value-list.js@@ -2,7 +2,7 @@ import Component from "@ember/component";import { action, set } from "@ember/object";import { isEmpty } from "@ember/utils";import { classNameBindings } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNameBindings(":value-list", ":secret-value-list")export default class SecretValueList extends Component {@@ -59,7 +59,7 @@ export default class SecretValueList extends Component {for (let input of inputs) {if (isEmpty(input) || input.includes("|")) {this.setValidationMessage(- I18n.t("admin.site_settings.secret_list.invalid_input")+ i18n("admin.site_settings.secret_list.invalid_input"));return true;}diff --git a/app/assets/javascripts/admin/addon/components/site-settings/file-types-list.gjs b/app/assets/javascripts/admin/addon/components/site-settings/file-types-list.gjsindex 11fb7393ba9..9ddf7d785cf 100644--- a/app/assets/javascripts/admin/addon/components/site-settings/file-types-list.gjs+++ b/app/assets/javascripts/admin/addon/components/site-settings/file-types-list.gjs@@ -5,9 +5,8 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";import { makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ListSetting from "select-kit/components/list-setting";const IMAGE_TYPES = [@@ -89,7 +88,7 @@ export default class FileTypesList extends Component {this.toasts.success({data: {- message: I18n.t("admin.site_settings.file_types_list.add_types_toast", {+ message: i18n("admin.site_settings.file_types_list.add_types_toast", {types: diffTypes.join(", "),}),},diff --git a/app/assets/javascripts/admin/addon/components/tags-uploader.gjs b/app/assets/javascripts/admin/addon/components/tags-uploader.gjsindex 368cc88084a..0c87109eb66 100644--- a/app/assets/javascripts/admin/addon/components/tags-uploader.gjs+++ b/app/assets/javascripts/admin/addon/components/tags-uploader.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import concatClass from "discourse/helpers/concat-class";import UppyUpload from "discourse/lib/uppy/uppy-upload";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TagsUploader extends Component {@service dialog;diff --git a/app/assets/javascripts/admin/addon/components/theme-settings-editor.js b/app/assets/javascripts/admin/addon/components/theme-settings-editor.jsindex 7296fbf03ac..0473ddacf7d 100644--- a/app/assets/javascripts/admin/addon/components/theme-settings-editor.js+++ b/app/assets/javascripts/admin/addon/components/theme-settings-editor.js@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ThemeSettingsEditor extends Component {@service dialog;@@ -100,7 +100,7 @@ export default class ThemeSettingsEditor extends Component {this.errors = [...this.errors,{- setting: I18n.t("admin.customize.syntax_error"),+ setting: i18n("admin.customize.syntax_error"),errorMessage: e.message,},];@@ -112,8 +112,8 @@ export default class ThemeSettingsEditor extends Component {this.errors = [...this.errors,{- setting: I18n.t("admin.customize.syntax_error"),- errorMessage: I18n.t("admin.customize.validation_settings_keys"),+ setting: i18n("admin.customize.syntax_error"),+ errorMessage: i18n("admin.customize.validation_settings_keys"),},];this.saving = false;@@ -139,7 +139,7 @@ export default class ThemeSettingsEditor extends Component {...this.errors,{setting: deletedNames.join(", "),- errorMessage: I18n.t("admin.customize.validation_settings_deleted"),+ errorMessage: i18n("admin.customize.validation_settings_deleted"),},];}@@ -149,7 +149,7 @@ export default class ThemeSettingsEditor extends Component {...this.errors,{setting: addedNames.join(","),- errorMessage: I18n.t("admin.customize.validation_settings_added"),+ errorMessage: i18n("admin.customize.validation_settings_added"),},];}diff --git a/app/assets/javascripts/admin/addon/components/theme-upload-add.js b/app/assets/javascripts/admin/addon/components/theme-upload-add.jsindex 737d2c3a215..94a6dee333b 100644--- a/app/assets/javascripts/admin/addon/components/theme-upload-add.js+++ b/app/assets/javascripts/admin/addon/components/theme-upload-add.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";const THEME_FIELD_VARIABLE_TYPE_IDS = [2, 3, 4];const SCSS_VARIABLE_NAMES = [@@ -66,9 +66,9 @@ export default class ThemeUploadAdd extends Component {if (!this.name) {return;} else if (!this.name.match(/^[a-z_][a-z0-9_-]*$/i)) {- return I18n.t("admin.customize.theme.variable_name_error.invalid_syntax");+ return i18n("admin.customize.theme.variable_name_error.invalid_syntax");} else if (SCSS_VARIABLE_NAMES.includes(name.toLowerCase())) {- return I18n.t("admin.customize.theme.variable_name_error.no_overwrite");+ return i18n("admin.customize.theme.variable_name_error.no_overwrite");} else if (this.args.model.themeFields.some((tf) =>@@ -76,7 +76,7 @@ export default class ThemeUploadAdd extends Component {this.name === tf.name)) {- return I18n.t("admin.customize.theme.variable_name_error.must_be_unique");+ return i18n("admin.customize.theme.variable_name_error.must_be_unique");}}diff --git a/app/assets/javascripts/admin/addon/components/themes-grid-card.gjs b/app/assets/javascripts/admin/addon/components/themes-grid-card.gjsindex 3d8509edba4..493140dfc09 100644--- a/app/assets/javascripts/admin/addon/components/themes-grid-card.gjs+++ b/app/assets/javascripts/admin/addon/components/themes-grid-card.gjs@@ -7,8 +7,7 @@ import DButton from "discourse/components/d-button";import DropdownMenu from "discourse/components/dropdown-menu";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminConfigAreaCard from "admin/components/admin-config-area-card";import DMenu from "float-kit/components/d-menu";import ThemesGridPlaceholder from "./themes-grid-placeholder";@@ -74,7 +73,7 @@ export default class ThemeCard extends Component {this.toasts.success({data: {- message: I18n.t("admin.customize.theme.set_default_success", {+ message: i18n("admin.customize.theme.set_default_success", {theme: this.args.theme.name,}),},@@ -94,7 +93,7 @@ export default class ThemeCard extends Component {.then(() => {this.toasts.success({data: {- message: I18n.t("admin.customize.theme.update_success", {+ message: i18n("admin.customize.theme.update_success", {theme: this.args.theme.name,}),},diff --git a/app/assets/javascripts/admin/addon/components/themes-list-item.gjs b/app/assets/javascripts/admin/addon/components/themes-list-item.gjsindex f41ab0698a5..a28af72c6b9 100644--- a/app/assets/javascripts/admin/addon/components/themes-list-item.gjs+++ b/app/assets/javascripts/admin/addon/components/themes-list-item.gjs@@ -8,9 +8,9 @@ import { htmlSafe } from "@ember/template";import PluginOutlet from "discourse/components/plugin-outlet";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import escape from "discourse-common/lib/escape";import { iconHTML } from "discourse-common/lib/icon-library";+import { i18n } from "discourse-i18n";const MAX_COMPONENTS = 4;diff --git a/app/assets/javascripts/admin/addon/components/themes-list.js b/app/assets/javascripts/admin/addon/components/themes-list.jsindex 77172ff458d..d35e6f38261 100644--- a/app/assets/javascripts/admin/addon/components/themes-list.js+++ b/app/assets/javascripts/admin/addon/components/themes-list.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";import DeleteThemesConfirm from "discourse/components/modal/delete-themes-confirm";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { COMPONENTS, THEMES } from "admin/models/theme";const ALL_FILTER = "all";@@ -16,37 +16,37 @@ const DISABLED_FILTER = "disabled";const UPDATES_AVAILABLE_FILTER = "updates_available";const THEMES_FILTERS = [- { name: I18n.t("admin.customize.theme.all_filter"), id: ALL_FILTER },- { name: I18n.t("admin.customize.theme.active_filter"), id: ACTIVE_FILTER },+ { name: i18n("admin.customize.theme.all_filter"), id: ALL_FILTER },+ { name: i18n("admin.customize.theme.active_filter"), id: ACTIVE_FILTER },{- name: I18n.t("admin.customize.theme.inactive_filter"),+ name: i18n("admin.customize.theme.inactive_filter"),id: INACTIVE_FILTER,},{- name: I18n.t("admin.customize.theme.updates_available_filter"),+ name: i18n("admin.customize.theme.updates_available_filter"),id: UPDATES_AVAILABLE_FILTER,},];const COMPONENTS_FILTERS = [- { name: I18n.t("admin.customize.component.all_filter"), id: ALL_FILTER },+ { name: i18n("admin.customize.component.all_filter"), id: ALL_FILTER },{- name: I18n.t("admin.customize.component.used_filter"),+ name: i18n("admin.customize.component.used_filter"),id: ACTIVE_FILTER,},{- name: I18n.t("admin.customize.component.unused_filter"),+ name: i18n("admin.customize.component.unused_filter"),id: INACTIVE_FILTER,},{- name: I18n.t("admin.customize.component.enabled_filter"),+ name: i18n("admin.customize.component.enabled_filter"),id: ENABLED_FILTER,},{- name: I18n.t("admin.customize.component.disabled_filter"),+ name: i18n("admin.customize.component.disabled_filter"),id: DISABLED_FILTER,},{- name: I18n.t("admin.customize.component.updates_available_filter"),+ name: i18n("admin.customize.component.updates_available_filter"),id: UPDATES_AVAILABLE_FILTER,},];diff --git a/app/assets/javascripts/admin/addon/components/uppy-backup-uploader.gjs b/app/assets/javascripts/admin/addon/components/uppy-backup-uploader.gjsindex 81aa2669a65..1825f2e350f 100644--- a/app/assets/javascripts/admin/addon/components/uppy-backup-uploader.gjs+++ b/app/assets/javascripts/admin/addon/components/uppy-backup-uploader.gjs@@ -3,7 +3,7 @@ import { getOwner } from "@ember/owner";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import UppyUpload from "discourse/lib/uppy/uppy-upload";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class UppyBackupUploader extends Component {@service siteSettings;diff --git a/app/assets/javascripts/admin/addon/components/watched-word-form.js b/app/assets/javascripts/admin/addon/components/watched-word-form.jsindex 1feeaa88a78..df2ee1e0422 100644--- a/app/assets/javascripts/admin/addon/components/watched-word-form.js+++ b/app/assets/javascripts/admin/addon/components/watched-word-form.js@@ -7,7 +7,7 @@ import { classNames, tagName } from "@ember-decorators/component";import { observes } from "@ember-decorators/object";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import WatchedWord from "admin/models/watched-word";@tagName("form")@@ -84,7 +84,7 @@ export default class WatchedWordForm extends Component {if (!this.isUniqueWord) {this.setProperties({showMessage: true,- message: I18n.t("admin.watched_words.form.exists"),+ message: i18n("admin.watched_words.form.exists"),});return;}@@ -111,7 +111,7 @@ export default class WatchedWordForm extends Component {replacement: "",selectedTags: [],showMessage: true,- message: I18n.t("admin.watched_words.form.success"),+ message: i18n("admin.watched_words.form.success"),isCaseSensitive: false,isHtml: false,});diff --git a/app/assets/javascripts/admin/addon/components/watched-word-uploader.js b/app/assets/javascripts/admin/addon/components/watched-word-uploader.jsindex e20b8d9d0df..3ff3ddf4b19 100644--- a/app/assets/javascripts/admin/addon/components/watched-word-uploader.js+++ b/app/assets/javascripts/admin/addon/components/watched-word-uploader.js@@ -4,7 +4,7 @@ import { getOwner } from "@ember/owner";import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";import UppyUpload from "discourse/lib/uppy/uppy-upload";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("watched-words-uploader")export default class WatchedWordUploader extends Component {@@ -20,7 +20,7 @@ export default class WatchedWordUploader extends Component {},perFileData: () => ({ action_key: this.actionKey }),uploadDone: () => {- this.dialog.alert(I18n.t("admin.watched_words.form.upload_successful"));+ this.dialog.alert(i18n("admin.watched_words.form.upload_successful"));this.done();},});diff --git a/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js b/app/assets/javascripts/admin/addon/components/webhook-event-chooser.jsindex be5516ad0d3..88090f0e59e 100644--- a/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js+++ b/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js@@ -1,9 +1,9 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class WebhookEventChooser extends Component {get details() {- return I18n.t(+ return i18n(`admin.web_hooks.${this.args.group}_event.${this.args.type.name}`);}diff --git a/app/assets/javascripts/admin/addon/components/webhook-event.js b/app/assets/javascripts/admin/addon/components/webhook-event.jsindex ca16cbf3853..99853810edd 100644--- a/app/assets/javascripts/admin/addon/components/webhook-event.js+++ b/app/assets/javascripts/admin/addon/components/webhook-event.js@@ -5,7 +5,7 @@ import { 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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class WebhookEvent extends Component {@service dialog;@@ -37,7 +37,7 @@ export default class WebhookEvent extends Component {get completion() {const seconds = Math.floor(this.args.event.duration / 10.0) / 100.0;- return I18n.t("admin.web_hooks.events.completed_in", { count: seconds });+ return i18n("admin.web_hooks.events.completed_in", { count: seconds });}get expandRequestIcon() {@@ -55,7 +55,7 @@ export default class WebhookEvent extends Component {@actionredeliver() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.web_hooks.events.redeliver_confirm"),+ message: i18n("admin.web_hooks.events.redeliver_confirm"),didConfirm: async () => {try {const json = await ajax(@@ -82,7 +82,7 @@ export default class WebhookEvent extends Component {this.headers = plainJSON(headers);this.body = prettyJSON(this.args.event.payload);this.expandDetails = this.expandDetailsRequestKey;- this.bodyLabel = I18n.t("admin.web_hooks.events.payload");+ this.bodyLabel = i18n("admin.web_hooks.events.payload");} else {this.expandDetails = null;}@@ -94,7 +94,7 @@ export default class WebhookEvent extends Component {this.headers = plainJSON(this.args.event.response_headers);this.body = this.args.event.response_body;this.expandDetails = this.expandDetailsResponseKey;- this.bodyLabel = I18n.t("admin.web_hooks.events.body");+ this.bodyLabel = i18n("admin.web_hooks.events.body");} else {this.expandDetails = null;}diff --git a/app/assets/javascripts/admin/addon/components/webhook-events.js b/app/assets/javascripts/admin/addon/components/webhook-events.jsindex cc545e08f51..c4465bf49fa 100644--- a/app/assets/javascripts/admin/addon/components/webhook-events.js+++ b/app/assets/javascripts/admin/addon/components/webhook-events.js@@ -6,7 +6,7 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class WebhookEvents extends Component {@service messageBus;@@ -56,11 +56,11 @@ export default class WebhookEvents extends Component {return [{id: "successful",- name: I18n.t("admin.web_hooks.events.filter_status.successful"),+ name: i18n("admin.web_hooks.events.filter_status.successful"),},{id: "failed",- name: I18n.t("admin.web_hooks.events.filter_status.failed"),+ name: i18n("admin.web_hooks.events.filter_status.failed"),},];}@@ -152,15 +152,13 @@ export default class WebhookEvents extends Component {@actionasync redeliverFailed() {if (!this.failedEventIds.length) {- this.dialog.alert(- I18n.t("admin.web_hooks.events.no_events_to_redeliver")- );+ this.dialog.alert(i18n("admin.web_hooks.events.no_events_to_redeliver"));this.redeliverEnabled = false;return;}return this.dialog.yesNoConfirm({- message: I18n.t("admin.web_hooks.events.redeliver_failed_confirm", {+ message: i18n("admin.web_hooks.events.redeliver_failed_confirm", {count: this.failedEventIds.length,}),didConfirm: async () => {@@ -176,7 +174,7 @@ export default class WebhookEvents extends Component {});} else {this.dialog.alert(- I18n.t("admin.web_hooks.events.no_events_to_redeliver")+ i18n("admin.web_hooks.events.no_events_to_redeliver"));}} catch (error) {diff --git a/app/assets/javascripts/admin/addon/components/webhook-status.gjs b/app/assets/javascripts/admin/addon/components/webhook-status.gjsindex 1fc15e29fb4..f30c149617c 100644--- a/app/assets/javascripts/admin/addon/components/webhook-status.gjs+++ b/app/assets/javascripts/admin/addon/components/webhook-status.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class WebhookStatus extends Component {iconNames = ["far-circle", "circle-xmark", "circle", "circle"];@@ -12,7 +12,7 @@ export default class WebhookStatus extends Component {}get deliveryStatus() {- return I18n.t(`admin.web_hooks.delivery_status.${this.status.name}`);+ return i18n(`admin.web_hooks.delivery_status.${this.status.name}`);}get iconName() {diff --git a/app/assets/javascripts/admin/addon/controllers/admin-api-keys-new.js b/app/assets/javascripts/admin/addon/controllers/admin-api-keys-new.jsindex 64cb94207f0..32d7bd07a4c 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-api-keys-new.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-api-keys-new.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";import ApiKeyUrlsModal from "../components/modal/api-key-urls";export default class AdminApiKeysNewController extends Controller {@@ -14,13 +14,13 @@ export default class AdminApiKeysNewController extends Controller {@service modal;userModes = [- { id: "all", name: I18n.t("admin.api.all_users") },- { id: "single", name: I18n.t("admin.api.single_user") },+ { id: "all", name: i18n("admin.api.all_users") },+ { id: "single", name: i18n("admin.api.single_user") },];scopeModes = [- { id: "granular", name: I18n.t("admin.api.scopes.granular") },- { id: "read_only", name: I18n.t("admin.api.scopes.read_only") },- { id: "global", name: I18n.t("admin.api.scopes.global") },+ { id: "granular", name: i18n("admin.api.scopes.granular") },+ { id: "read_only", name: i18n("admin.api.scopes.read_only") },+ { id: "global", name: i18n("admin.api.scopes.global") },];globalScopes = null;scopes = null;diff --git a/app/assets/javascripts/admin/addon/controllers/admin-backups-index.js b/app/assets/javascripts/admin/addon/controllers/admin-backups-index.jsindex 9e75372dd89..865133ec3fd 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-backups-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-backups-index.js@@ -4,17 +4,17 @@ import { alias, equal } from "@ember/object/computed";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import { i18n, setting } from "discourse/lib/computed";+import { computedI18n, setting } from "discourse/lib/computed";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminBackupsIndexController extends Controller {@service dialog;@controller adminBackups;@alias("adminBackups.model") status;- @i18n("admin.backups.upload.label") uploadLabel;+ @computedI18n("admin.backups.upload.label") uploadLabel;@setting("backup_location") backupLocation;@equal("backupLocation", "local") localBackupStorage;@@ -37,7 +37,7 @@ export default class AdminBackupsIndexController extends Controller {async download(backup) {try {await ajax(`/admin/backups/${backup.filename}`, { type: "PUT" });- this.dialog.alert(I18n.t("admin.backups.operations.download.alert"));+ this.dialog.alert(i18n("admin.backups.operations.download.alert"));} catch (err) {popupAjaxError(err);}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-badges/award.js b/app/assets/javascripts/admin/addon/controllers/admin-badges/award.jsindex 0a5c5790ecd..44d325e3e1d 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-badges/award.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-badges/award.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminBadgesAwardController extends Controller {@service dialog;@@ -69,7 +69,7 @@ export default class AdminBadgesAwardController extends Controller {unmatched_entries: unmatchedEntries,unmatched_entries_count: unmatchedEntriesCount,}) => {- this.resultsMessage = I18n.t("admin.badges.mass_award.success", {+ this.resultsMessage = i18n("admin.badges.mass_award.success", {count: matchedCount,});this.success = true;@@ -85,7 +85,7 @@ export default class AdminBadgesAwardController extends Controller {}).finally(() => (this.saving = false));} else {- this.dialog.alert(I18n.t("admin.badges.mass_award.aborted"));+ this.dialog.alert(i18n("admin.badges.mass_award.aborted"));}}}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-badges/show.js b/app/assets/javascripts/admin/addon/controllers/admin-badges/show.jsindex 4f522673344..76cd13c24a3 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-badges/show.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-badges/show.js@@ -6,7 +6,7 @@ import { isNone } from "@ember/utils";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import BadgePreviewModal from "../../components/modal/badge-preview";const FORM_FIELDS = [@@ -136,11 +136,11 @@ export default class AdminBadgesShowController extends Controller {if (!data.icon && !data.image_url) {addError("icon", {title: "Icon",- message: I18n.t("admin.badges.icon_or_image"),+ message: i18n("admin.badges.icon_or_image"),});addError("image_url", {title: "Image",- message: I18n.t("admin.badges.icon_or_image"),+ message: i18n("admin.badges.icon_or_image"),});} else {removeError("image_url");@@ -191,7 +191,7 @@ export default class AdminBadgesShowController extends Controller {try {this.model = await this.model.save(data);- this.toasts.success({ data: { message: I18n.t("saved") } });+ this.toasts.success({ data: { message: i18n("saved") } });if (newBadge) {const adminBadges = this.get("adminBadges.model");@@ -217,7 +217,7 @@ export default class AdminBadgesShowController extends Controller {}return this.dialog.yesNoConfirm({- message: I18n.t("admin.badges.delete_confirm"),+ message: i18n("admin.badges.delete_confirm"),didConfirm: async () => {try {await this.formApi.reset();@@ -225,7 +225,7 @@ export default class AdminBadgesShowController extends Controller {this.adminBadges.model.removeObject(this.model);this.router.transitionTo("adminBadges.index");} catch {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}},});diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.jsindex 20dfbc62f5a..f8b5756e913 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors-show.js@@ -3,7 +3,7 @@ import { action, computed } from "@ember/object";import { service } from "@ember/service";import { clipboardCopy } from "discourse/lib/utilities";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeColorsShowController extends Controller {@service dialog;@@ -34,12 +34,12 @@ export default class AdminCustomizeColorsShowController extends Controller {if (clipboardCopy(this.model.schemeJson())) {this.set("model.savingStatus",- I18n.t("admin.customize.copied_to_clipboard")+ i18n("admin.customize.copied_to_clipboard"));} else {this.set("model.savingStatus",- I18n.t("admin.customize.copy_to_clipboard_error")+ i18n("admin.customize.copy_to_clipboard_error"));}@@ -53,7 +53,7 @@ export default class AdminCustomizeColorsShowController extends Controller {const newColorScheme = this.model.copy();newColorScheme.set("name",- I18n.t("admin.customize.colors.copy_name_prefix") ++ i18n("admin.customize.colors.copy_name_prefix") +" " +this.get("model.name"));@@ -76,7 +76,7 @@ export default class AdminCustomizeColorsShowController extends Controller {@actiondestroy() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.colors.delete_confirm"),+ message: i18n("admin.customize.colors.delete_confirm"),didConfirm: () => {return this.model.destroy().then(() => {this.allColors.removeObject(this.model);diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.jsindex aee4ce3eaf9..cbb3ff559d4 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-colors.js@@ -2,7 +2,7 @@ import Controller from "@ember/controller";import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ColorSchemeSelectBaseModal from "admin/components/modal/color-scheme-select-base";export default class AdminCustomizeColorsController extends Controller {@@ -33,7 +33,7 @@ export default class AdminCustomizeColorsController extends Controller {const base = this.baseColorSchemes.findBy("base_scheme_id", baseKey);const newColorScheme = base.copy();newColorScheme.setProperties({- name: I18n.t("admin.customize.colors.new_name"),+ name: i18n("admin.customize.colors.new_name"),base_scheme_id: base.get("base_scheme_id"),});newColorScheme.save().then(() => {diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-email-style-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-email-style-edit.jsindex 684317d95e2..38d048e10f8 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-email-style-edit.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-email-style-edit.js@@ -2,14 +2,14 @@ import Controller from "@ember/controller";import { action } from "@ember/object";import { service } from "@ember/service";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeEmailStyleEditController extends Controller {@service dialog;@discourseComputed("model.isSaving")saveButtonText(isSaving) {- return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save");+ return isSaving ? i18n("saving") : i18n("admin.customize.save");}@discourseComputed("model.changed", "model.isSaving")@@ -26,10 +26,10 @@ export default class AdminCustomizeEmailStyleEditController extends Controller {.catch((e) => {const msg =e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors- ? I18n.t("admin.customize.email_style.save_error_with_reason", {+ ? i18n("admin.customize.email_style.save_error_with_reason", {error: e.jqXHR.responseJSON.errors.join(". "),})- : I18n.t("generic_error");+ : i18n("generic_error");this.dialog.alert(msg);}).finally(() => this.set("model.changed", false));diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-email-templates-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-email-templates-edit.jsindex 2da6336a70b..0114a52a284 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-email-templates-edit.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-email-templates-edit.js@@ -4,7 +4,7 @@ import { 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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeEmailTemplatesEditController extends Controller.extend(bufferedProperty("emailTemplate")@@ -48,7 +48,7 @@ export default class AdminCustomizeEmailTemplatesEditController extends Controllthis.set("saved", false);this.dialog.yesNoConfirm({- title: I18n.t("admin.customize.email_templates.revert_confirm"),+ title: i18n("admin.customize.email_templates.revert_confirm"),didConfirm: () => {return this.emailTemplate.revert()diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.jsindex 47e5d0b1818..18a301db91e 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-edit.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { url } from "discourse/lib/computed";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeThemesEditController extends Controller {@service router;@@ -33,7 +33,7 @@ export default class AdminCustomizeThemesEditController extends Controller {@discourseComputed("model.isSaving")saveButtonText(isSaving) {- return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save");+ return isSaving ? i18n("saving") : i18n("admin.customize.save");}@discourseComputed("model.changed", "model.isSaving")diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.jsindex a6c6f838419..b4487152eab 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js@@ -14,7 +14,7 @@ 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 { 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";@@ -63,9 +63,9 @@ export default class AdminCustomizeThemesShowController extends Controller {if (fields.length < 1) {return;}- let resultString = I18n.t("admin.customize.theme." + target);+ let resultString = i18n("admin.customize.theme." + target);const formattedFields = fields- .map((f) => I18n.t("admin.customize.theme." + f.name + ".text"))+ .map((f) => i18n("admin.customize.theme." + f.name + ".text")).join(" , ");resultString += `: ${formattedFields}`;descriptions.push(resultString);@@ -97,13 +97,13 @@ export default class AdminCustomizeThemesShowController extends Controller {preview: null,anyValue: false,setting: "parent_theme_ids",- label: I18n.t("admin.customize.theme.component_on_themes"),+ label: i18n("admin.customize.theme.component_on_themes"),choices: this.availableThemesNames,default: this.parentThemesNames.join("|"),value: this.parentThemesNames.join("|"),defaultValues: this.availableActiveThemesNames.join("|"),allThemes: this.allThemes,- setDefaultValuesLabel: I18n.t("admin.customize.theme.add_all_themes"),+ setDefaultValuesLabel: i18n("admin.customize.theme.add_all_themes"),});}@@ -115,13 +115,13 @@ export default class AdminCustomizeThemesShowController extends Controller {preview: null,anyValue: false,setting: "child_theme_ids",- label: I18n.t("admin.customize.theme.included_components"),+ label: i18n("admin.customize.theme.included_components"),choices: this.availableComponentsNames,default: this.childThemesNames.join("|"),value: this.childThemesNames.join("|"),defaultValues: this.availableActiveComponentsNames.join("|"),allThemes: this.allThemes,- setDefaultValuesLabel: I18n.t("admin.customize.theme.add_all"),+ setDefaultValuesLabel: i18n("admin.customize.theme.add_all"),});}@@ -354,7 +354,7 @@ export default class AdminCustomizeThemesShowController extends Controller {editTheme() {if (this.get("model.remote_theme.is_git")) {this.dialog.confirm({- message: I18n.t("admin.customize.theme.edit_confirm"),+ message: i18n("admin.customize.theme.edit_confirm"),didConfirm: () => this.transitionToEditRoute(),});} else {@@ -396,7 +396,7 @@ export default class AdminCustomizeThemesShowController extends Controller {@actionremoveUpload(upload) {return this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.theme.delete_upload_confirm"),+ message: i18n("admin.customize.theme.delete_upload_confirm"),didConfirm: () => this.model.removeField(upload),});}@@ -409,7 +409,7 @@ export default class AdminCustomizeThemesShowController extends Controller {@actiondestroyTheme() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.delete_confirm", {+ message: i18n("admin.customize.delete_confirm", {theme_name: this.get("model.name"),}),didConfirm: () => {@@ -439,10 +439,10 @@ export default class AdminCustomizeThemesShowController extends Controller {? this.get("model.parentThemes"): this.get("model.childThemes");- let message = I18n.t(`${this.convertKey}_alert_generic`);+ let message = i18n(`${this.convertKey}_alert_generic`);if (relatives && relatives.length > 0) {- message = I18n.t(`${this.convertKey}_alert`, {+ message = i18n(`${this.convertKey}_alert`, {relatives: relatives.map((relative) => relative.get("name")).join(", "),});}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.jsindex b4dff539625..b9ad1f9b237 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-dashboard-general.js@@ -5,7 +5,7 @@ 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 { i18n } from "discourse-i18n";import AdminDashboard from "admin/models/admin-dashboard";import Report from "admin/models/report";import AdminDashboardTabController from "./admin-dashboard-tab";@@ -134,7 +134,7 @@ export default class AdminDashboardGeneralController extends AdminDashboardTabCo@discourseComputedtrendingSearchDisabledLabel() {- return I18n.t("admin.dashboard.reports.trending_search.disabled", {+ return i18n("admin.dashboard.reports.trending_search.disabled", {basePath: getURL(""),});}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-email-index.js b/app/assets/javascripts/admin/addon/controllers/admin-email-index.jsindex 0383aec3dec..9b5aeee919e 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-email-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-email-index.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminEmailIndexController extends Controller {@service dialog;@@ -51,13 +51,13 @@ export default class AdminEmailIndexController extends Controller {if (e.jqXHR.responseJSON?.errors) {this.dialog.alert({message: htmlSafe(- I18n.t("admin.email.error", {+ i18n("admin.email.error", {server_error: escapeExpression(e.jqXHR.responseJSON.errors[0]),})),});} else {- this.dialog.alert({ message: I18n.t("admin.email.test_error") });+ this.dialog.alert({ message: i18n("admin.email.test_error") });}}).finally(() => this.set("sendingEmail", false));diff --git a/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js b/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.jsindex faca62a3347..5157bf67ca6 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-ip-addresses.js@@ -6,7 +6,7 @@ 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 { i18n } from "discourse-i18n";import ScreenedIpAddress from "admin/models/screened-ip-address";export default class AdminLogsScreenedIpAddressesController extends Controller {@@ -68,12 +68,12 @@ export default class AdminLogsScreenedIpAddressesController extends Controller {.catch((e) => {if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {this.dialog.alert(- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: e.jqXHR.responseJSON.errors.join(". "),}));} else {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}if (wasEditing) {record.set("editing", true);@@ -84,7 +84,7 @@ export default class AdminLogsScreenedIpAddressesController extends Controller {@actiondestroyRecord(record) {return this.dialog.yesNoConfirm({- message: I18n.t("admin.logs.screened_ips.delete_confirm", {+ message: i18n("admin.logs.screened_ips.delete_confirm", {ip_address: record.get("ip_address"),}),didConfirm: () => {@@ -94,12 +94,12 @@ export default class AdminLogsScreenedIpAddressesController extends Controller {if (deleted) {this.model.removeObject(record);} else {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}}).catch((e) => {this.dialog.alert(- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: `http: ${e.status} - ${e.body}`,}));diff --git a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.jsindex 1d4401ca74d..87836507465 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js@@ -5,7 +5,7 @@ import { 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 "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminStaffActionLogComponent from "../components/modal/staff-action-log-change";import StaffActionLogDetailsModal from "../components/modal/staff-action-log-details";@@ -20,7 +20,7 @@ export default class AdminLogsStaffActionLogsController extends Controller {@discourseComputed("filters.action_name")actionFilter(name) {- return name ? I18n.t("admin.logs.staff_actions.actions." + name) : null;+ return name ? i18n("admin.logs.staff_actions.actions." + name) : null;}@discourseComputed("filters")@@ -39,7 +39,7 @@ export default class AdminLogsStaffActionLogsController extends Controller {.map((historyAction) => ({id: historyAction.id,action_id: historyAction.action_id,- name: I18n.t(+ name: i18n("admin.logs.staff_actions.actions." + historyAction.id),name_raw: historyAction.id,diff --git a/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js b/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.jsindex 139124f758b..6496aa840c1 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-permalinks-index.js@@ -6,7 +6,7 @@ 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 { i18n } from "discourse-i18n";import Permalink from "admin/models/permalink";export default class AdminPermalinksIndexController extends Controller {@@ -37,7 +37,7 @@ export default class AdminPermalinksIndexController extends Controller {this.toasts.success({duration: 3000,data: {- message: I18n.t("admin.permalink.copy_success"),+ message: i18n("admin.permalink.copy_success"),},});}@@ -45,13 +45,13 @@ export default class AdminPermalinksIndexController extends Controller {@actiondestroyRecord(permalink) {this.dialog.yesNoConfirm({- message: I18n.t("admin.permalink.delete_confirm"),+ message: i18n("admin.permalink.delete_confirm"),didConfirm: async () => {try {await this.store.destroyRecord("permalink", permalink);this.model.removeObject(permalink);} catch {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}},});diff --git a/app/assets/javascripts/admin/addon/controllers/admin-search-logs-index.js b/app/assets/javascripts/admin/addon/controllers/admin-search-logs-index.jsindex 697638f6ede..76345a7e3db 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-search-logs-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-search-logs-index.js@@ -1,5 +1,5 @@import Controller from "@ember/controller";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const DEFAULT_PERIOD = "yearly";export default class AdminSearchLogsIndexController extends Controller {@@ -9,12 +9,12 @@ export default class AdminSearchLogsIndexController extends Controller {searchTypeOptions = [{id: "all",- name: I18n.t("admin.logs.search_logs.types.all_search_types"),+ name: i18n("admin.logs.search_logs.types.all_search_types"),},- { id: "header", name: I18n.t("admin.logs.search_logs.types.header") },+ { id: "header", name: i18n("admin.logs.search_logs.types.header") },{id: "full_page",- name: I18n.t("admin.logs.search_logs.types.full_page"),+ name: i18n("admin.logs.search_logs.types.full_page"),},];}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-search-logs-term.js b/app/assets/javascripts/admin/addon/controllers/admin-search-logs-term.jsindex e09e862d383..4724515b59b 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-search-logs-term.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-search-logs-term.js@@ -1,5 +1,5 @@import Controller from "@ember/controller";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index";export default class AdminSearchLogsTermController extends Controller {@@ -10,16 +10,16 @@ export default class AdminSearchLogsTermController extends Controller {searchTypeOptions = [{id: "all",- name: I18n.t("admin.logs.search_logs.types.all_search_types"),+ name: i18n("admin.logs.search_logs.types.all_search_types"),},- { id: "header", name: I18n.t("admin.logs.search_logs.types.header") },+ { id: "header", name: i18n("admin.logs.search_logs.types.header") },{id: "full_page",- name: I18n.t("admin.logs.search_logs.types.full_page"),+ name: i18n("admin.logs.search_logs.types.full_page"),},{id: "click_through_only",- name: I18n.t("admin.logs.search_logs.types.click_through_only"),+ name: i18n("admin.logs.search_logs.types.click_through_only"),},];diff --git a/app/assets/javascripts/admin/addon/controllers/admin-site-text-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-site-text-edit.jsindex e2eca5c261d..9b89624ea2c 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-site-text-edit.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-site-text-edit.js@@ -4,7 +4,7 @@ import { 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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminSiteTextEdit extends Controller.extend(bufferedProperty("siteText")@@ -43,7 +43,7 @@ export default class AdminSiteTextEdit extends Controller.extend(this.set("saved", false);this.dialog.yesNoConfirm({- message: I18n.t("admin.site_text.revert_confirm"),+ message: i18n("admin.site_text.revert_confirm"),didConfirm: () => {this.siteText.revert(this.locale)diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js b/app/assets/javascripts/admin/addon/controllers/admin-user-badges.jsindex 4b4f2eede33..acd33ca7b9e 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";export default class AdminUserBadgesController extends Controller {@@ -105,7 +105,7 @@ export default class AdminUserBadgesController extends Controller {@actionrevokeBadge(userBadge) {return this.dialog.yesNoConfirm({- message: I18n.t("admin.badges.revoke_confirm"),+ message: i18n("admin.badges.revoke_confirm"),didConfirm: () => {return userBadge.revoke().then(() => {this.model.removeObject(userBadge);diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-fields.js b/app/assets/javascripts/admin/addon/controllers/admin-user-fields.jsindex 6f50ed070ff..46c367ed587 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-user-fields.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-user-fields.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { gte, sort } from "@ember/object/computed";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const MAX_FIELDS = 30;@@ -65,7 +65,7 @@ export default class AdminUserFieldsController extends Controller {// Only confirm if we already been savedif (f.get("id")) {this.dialog.yesNoConfirm({- message: I18n.t("admin.user_fields.delete_confirm"),+ message: i18n("admin.user_fields.delete_confirm"),didConfirm: () => {return f.destroyRecord()diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js b/app/assets/javascripts/admin/addon/controllers/admin-user-index.jsindex 0eb43bd5bd8..8ce6f69103f 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-user-index.js@@ -10,7 +10,7 @@ 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 { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";import DeletePostsConfirmationModal from "../components/modal/delete-posts-confirmation";import DeleteUserPostsProgressModal from "../components/modal/delete-user-posts-progress";@@ -98,14 +98,14 @@ export default class AdminUserIndexController extends Controller.extend(}if (staff) {- return I18n.t("admin.user.delete_posts_forbidden_because_staff");+ return i18n("admin.user.delete_posts_forbidden_because_staff");}if (postCount > this.siteSettings.delete_all_posts_max) {- return I18n.t("admin.user.cant_delete_all_too_many_posts", {+ return i18n("admin.user.cant_delete_all_too_many_posts", {count: this.siteSettings.delete_all_posts_max,});} else {- return I18n.t("admin.user.cant_delete_all_posts", {+ return i18n("admin.user.cant_delete_all_posts", {count: this.siteSettings.delete_user_max_post_age,});}@@ -118,9 +118,9 @@ export default class AdminUserIndexController extends Controller.extend(}if (staff) {- return I18n.t("admin.user.delete_forbidden_because_staff");+ return i18n("admin.user.delete_forbidden_because_staff");} else {- return I18n.t("admin.user.delete_forbidden", {+ return i18n("admin.user.delete_forbidden", {count: this.siteSettings.delete_user_max_post_age,});}@@ -134,7 +134,7 @@ export default class AdminUserIndexController extends Controller.extend(groupAdded(added) {this.model.groupAdded(added)- .catch(() => this.dialog.alert(I18n.t("generic_error")));+ .catch(() => this.dialog.alert(i18n("generic_error")));}groupRemoved(groupId) {@@ -145,7 +145,7 @@ export default class AdminUserIndexController extends Controller.extend(this.set("originalPrimaryGroupId", null);}})- .catch(() => this.dialog.alert(I18n.t("generic_error")));+ .catch(() => this.dialog.alert(i18n("generic_error")));}@discourseComputed("ssoLastPayload")@@ -160,9 +160,9 @@ export default class AdminUserIndexController extends Controller.extend(.then(() => DiscourseURL.redirectTo("/")).catch((e) => {if (e.status === 404) {- this.dialog.alert(I18n.t("admin.impersonate.not_found"));+ this.dialog.alert(i18n("admin.impersonate.not_found"));} else {- this.dialog.alert(I18n.t("admin.impersonate.invalid"));+ this.dialog.alert(i18n("admin.impersonate.invalid"));}});}@@ -171,7 +171,7 @@ export default class AdminUserIndexController extends Controller.extend(logOut() {return this.model.logOut()- .then(() => this.dialog.alert(I18n.t("admin.user.logged_out")));+ .then(() => this.dialog.alert(i18n("admin.user.logged_out")));}@action@@ -197,7 +197,7 @@ export default class AdminUserIndexController extends Controller.extend(this.model.setProperties({ active: false, can_activate: true })).catch((e) => {- const error = I18n.t("admin.user.deactivate_failed", {+ const error = i18n("admin.user.deactivate_failed", {error: this._formatError(e),});this.dialog.alert(error);@@ -208,7 +208,7 @@ export default class AdminUserIndexController extends Controller.extend(sendActivationEmail() {return this.model.sendActivationEmail()- .then(() => this.dialog.alert(I18n.t("admin.user.activation_email_sent")))+ .then(() => this.dialog.alert(i18n("admin.user.activation_email_sent"))).catch(popupAjaxError);}@@ -223,7 +223,7 @@ export default class AdminUserIndexController extends Controller.extend(})).catch((e) => {- const error = I18n.t("admin.user.activate_failed", {+ const error = i18n("admin.user.activate_failed", {error: this._formatError(e),});this.dialog.alert(error);@@ -241,7 +241,7 @@ export default class AdminUserIndexController extends Controller.extend(.grantAdmin().then((result) => {if (result.email_confirmation_required) {- this.dialog.alert(I18n.t("admin.user.grant_admin_confirm"));+ this.dialog.alert(i18n("admin.user.grant_admin_confirm"));}}).catch((error) => {@@ -278,7 +278,7 @@ export default class AdminUserIndexController extends Controller.extend(}error =error ||- I18n.t("admin.user.trust_level_change_failed", {+ i18n("admin.user.trust_level_change_failed", {error: this._formatError(e),});this.dialog.alert(error);@@ -302,7 +302,7 @@ export default class AdminUserIndexController extends Controller.extend(}error =error ||- I18n.t("admin.user.trust_level_change_failed", {+ i18n("admin.user.trust_level_change_failed", {error: this._formatError(e),});this.dialog.alert(error);@@ -322,7 +322,7 @@ export default class AdminUserIndexController extends Controller.extend(@actiondeleteAssociatedAccounts() {this.dialog.yesNoConfirm({- message: I18n.t("admin.user.delete_associated_accounts_confirm"),+ message: i18n("admin.user.delete_associated_accounts_confirm"),didConfirm: () => {this.model.deleteAssociatedAccounts().catch(popupAjaxError);},@@ -346,27 +346,27 @@ export default class AdminUserIndexController extends Controller.extend(document.location = getURL("/admin/users/list/active");}} else {- this.dialog.alert(I18n.t("admin.user.anonymize_failed"));+ this.dialog.alert(i18n("admin.user.anonymize_failed"));if (data.user) {user.setProperties(data.user);}}})- .catch(() => this.dialog.alert(I18n.t("admin.user.anonymize_failed")));+ .catch(() => this.dialog.alert(i18n("admin.user.anonymize_failed")));};this.dialog.alert({- message: I18n.t("admin.user.anonymize_confirm"),+ message: i18n("admin.user.anonymize_confirm"),class: "delete-user-modal",buttons: [{icon: "triangle-exclamation",- label: I18n.t("admin.user.anonymize_yes"),+ label: i18n("admin.user.anonymize_yes"),class: "btn-danger",action: () => performAnonymize(),},{- label: I18n.t("composer.cancel"),+ label: i18n("composer.cancel"),},],});@@ -375,7 +375,7 @@ export default class AdminUserIndexController extends Controller.extend(@actiondisableSecondFactor() {this.dialog.yesNoConfirm({- message: I18n.t("admin.user.disable_second_factor_confirm"),+ message: i18n("admin.user.disable_second_factor_confirm"),didConfirm: () => {return this.model.disableSecondFactor();},@@ -399,7 +399,7 @@ export default class AdminUserIndexController extends Controller.extend(const location = document.location.pathname;const performDestroy = (block) => {- this.dialog.notice(I18n.t("admin.user.deleting_user"));+ this.dialog.notice(i18n("admin.user.deleting_user"));let formData = { context: location };if (block) {formData["block_email"] = true;@@ -419,21 +419,21 @@ export default class AdminUserIndexController extends Controller.extend(document.location = getURL("/admin/users/list/active");}} else {- this.dialog.alert(I18n.t("admin.user.delete_failed"));+ this.dialog.alert(i18n("admin.user.delete_failed"));}}).catch(() => {- this.dialog.alert(I18n.t("admin.user.delete_failed"));+ this.dialog.alert(i18n("admin.user.delete_failed"));});};this.dialog.alert({- title: I18n.t("admin.user.delete_confirm_title"),- message: I18n.t("admin.user.delete_confirm"),+ title: i18n("admin.user.delete_confirm_title"),+ message: i18n("admin.user.delete_confirm"),class: "delete-user-modal",buttons: [{- label: I18n.t("admin.user.delete_dont_block"),+ label: i18n("admin.user.delete_dont_block"),class: "btn-primary",action: () => {return performDestroy(false);@@ -441,14 +441,14 @@ export default class AdminUserIndexController extends Controller.extend(},{icon: "triangle-exclamation",- label: I18n.t("admin.user.delete_and_block"),+ label: i18n("admin.user.delete_and_block"),class: "btn-danger",action: () => {return performDestroy(true);},},{- label: I18n.t("composer.cancel"),+ label: i18n("composer.cancel"),},],});@@ -492,12 +492,12 @@ export default class AdminUserIndexController extends Controller.extend(if (response.success) {this.modal.show(MergeUsersProgressModal);} else {- this.dialog.alert(I18n.t("admin.user.merge_failed"));+ this.dialog.alert(i18n("admin.user.merge_failed"));}}).catch(() => {AdminUser.find(user.id).then((u) => user.setProperties(u));- this.dialog.alert(I18n.t("admin.user.merge_failed"));+ this.dialog.alert(i18n("admin.user.merge_failed"));});}@@ -598,7 +598,7 @@ export default class AdminUserIndexController extends Controller.extend(data: { primary_group_id: primaryGroupId },}).then(() => this.set("originalPrimaryGroupId", primaryGroupId))- .catch(() => this.dialog.alert(I18n.t("generic_error")));+ .catch(() => this.dialog.alert(i18n("generic_error")));}@action@@ -609,7 +609,7 @@ export default class AdminUserIndexController extends Controller.extend(@actiondeleteSSORecord() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.user.discourse_connect.confirm_delete"),+ message: i18n("admin.user.discourse_connect.confirm_delete"),didConfirm: () => this.model.deleteSSORecord(),});}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js b/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.jsindex aab850adb6d..394473aa008 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-users-list-show.js@@ -1,12 +1,12 @@import Controller from "@ember/controller";import { action } from "@ember/object";import { observes } from "@ember-decorators/object";-import { i18n } from "discourse/lib/computed";+import { computedI18n } from "discourse/lib/computed";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 { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";export default class AdminUsersListShowController extends Controller.extend(@@ -21,7 +21,7 @@ export default class AdminUsersListShowController extends Controller.extend(listFilter = null;selectAll = false;- @i18n("search_hint") searchHint;+ @computedI18n("search_hint") searchHint;_page = 1;_results = [];@@ -29,7 +29,7 @@ export default class AdminUsersListShowController extends Controller.extend(@discourseComputed("query")title(query) {- return I18n.t("admin.users.titles." + query);+ return i18n("admin.users.titles." + query);}@discourseComputed("showEmails")diff --git a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.jsindex 1a7624a3028..40050a96efb 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-watched-words-action.js@@ -6,7 +6,7 @@ import { 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 { i18n } from "discourse-i18n";import WatchedWordTestingModal from "admin/components/modal/watched-word-testing";import WatchedWord from "admin/models/watched-word";@@ -38,14 +38,14 @@ export default class AdminWatchedWordsActionController extends Controller {try {RegExp(regexp);} catch {- return I18n.t("admin.watched_words.invalid_regex", { word });+ return i18n("admin.watched_words.invalid_regex", { word });}}}@discourseComputed("actionNameKey")actionDescription(actionNameKey) {- return I18n.t(`admin.watched_words.action_descriptions.${actionNameKey}`);+ return i18n(`admin.watched_words.action_descriptions.${actionNameKey}`);}@action@@ -96,8 +96,8 @@ export default class AdminWatchedWordsActionController extends Controller {clearAll() {const actionKey = this.actionNameKey;this.dialog.yesNoConfirm({- message: I18n.t("admin.watched_words.clear_all_confirm", {- action: I18n.t(`admin.watched_words.actions.${actionKey}`),+ message: i18n("admin.watched_words.clear_all_confirm", {+ action: i18n(`admin.watched_words.actions.${actionKey}`),}),didConfirm: async () => {await ajax(`/admin/customize/watched_words/action/${actionKey}.json`, {diff --git a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-edit.js b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-edit.jsindex dffa7db6f60..352cfe1c5fb 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-edit.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-edit.js@@ -5,7 +5,7 @@ import { 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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminWebHooksEditController extends Controller {@service dialog;@@ -26,9 +26,9 @@ export default class AdminWebHooksEditController extends Controller {@discourseComputed("model.isSaving", "saved", "saveButtonDisabled")savingStatus(isSaving, saved, saveButtonDisabled) {if (isSaving) {- return I18n.t("saving");+ return i18n("saving");} else if (!saveButtonDisabled && saved) {- return I18n.t("saved");+ return i18n("saved");}// Use side effect of validation to clear saved textthis.set("saved", false);@@ -38,8 +38,8 @@ export default class AdminWebHooksEditController extends Controller {@discourseComputed("model.isNew")saveButtonText(isNew) {return isNew- ? I18n.t("admin.web_hooks.create")- : I18n.t("admin.web_hooks.save");+ ? i18n("admin.web_hooks.create")+ : i18n("admin.web_hooks.save");}@discourseComputed("model.secret")@@ -48,14 +48,14 @@ export default class AdminWebHooksEditController extends Controller {if (secret.includes(" ")) {return EmberObject.create({failed: true,- reason: I18n.t("admin.web_hooks.secret_invalid"),+ reason: i18n("admin.web_hooks.secret_invalid"),});}if (secret.length < 12) {return EmberObject.create({failed: true,- reason: I18n.t("admin.web_hooks.secret_too_short"),+ reason: i18n("admin.web_hooks.secret_too_short"),});}}@@ -66,7 +66,7 @@ export default class AdminWebHooksEditController extends Controller {if (!isWildcard && isEmpty(eventTypes)) {return EmberObject.create({failed: true,- reason: I18n.t("admin.web_hooks.event_type_missing"),+ reason: i18n("admin.web_hooks.event_type_missing"),});}}diff --git a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.jsindex 59b9ccb674a..a8e064d7cce 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-index.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { alias } from "@ember/object/computed";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminWebHooksIndexController extends Controller {@service dialog;@@ -18,7 +18,7 @@ export default class AdminWebHooksIndexController extends Controller {@actiondestroyWebhook(webhook) {return this.dialog.deleteConfirm({- message: I18n.t("admin.web_hooks.delete_confirm"),+ message: i18n("admin.web_hooks.delete_confirm"),didConfirm: async () => {try {await webhook.destroyRecord();diff --git a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.jsindex 41fc6d26add..0eb997bfe77 100644--- a/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js+++ b/app/assets/javascripts/admin/addon/controllers/admin-web-hooks-show.js@@ -3,7 +3,7 @@ import Controller, { inject as controller } from "@ember/controller";import { action } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminWebHooksShowController extends Controller {@service dialog;@@ -21,7 +21,7 @@ export default class AdminWebHooksShowController extends Controller {@actiondestroyWebhook() {return this.dialog.deleteConfirm({- message: I18n.t("admin.web_hooks.delete_confirm"),+ message: i18n("admin.web_hooks.delete_confirm"),didConfirm: async () => {try {await this.model.destroyRecord();diff --git a/app/assets/javascripts/admin/addon/helpers/post-action-title.js b/app/assets/javascripts/admin/addon/helpers/post-action-title.jsindex 916d62e5d2d..75f58fae481 100644--- a/app/assets/javascripts/admin/addon/helpers/post-action-title.js+++ b/app/assets/javascripts/admin/addon/helpers/post-action-title.js@@ -1,14 +1,14 @@import Helper from "@ember/component/helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function postActionTitle([id, nameKey]) {- let title = I18n.t(`admin.flags.short_names.${nameKey}`, {+ let title = i18n(`admin.flags.short_names.${nameKey}`, {defaultValue: null,});// TODO: We can remove this once other translations have been updatedif (!title) {- return I18n.t(`admin.flags.summary.action_type_${id}`, { count: 1 });+ return i18n(`admin.flags.summary.action_type_${id}`, { count: 1 });}return title;diff --git a/app/assets/javascripts/admin/addon/lib/template-form-fields.js b/app/assets/javascripts/admin/addon/lib/template-form-fields.jsindex 2af3b9c10c6..4762f7ea8e9 100644--- a/app/assets/javascripts/admin/addon/lib/template-form-fields.js+++ b/app/assets/javascripts/admin/addon/lib/template-form-fields.js@@ -1,80 +1,76 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const templateFormFields = [{type: "checkbox",structure: `- type: checkbox- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}attributes:- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"+ label: "${i18n("admin.form_templates.field_placeholders.label")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},{type: "input",structure: `- type: input- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}attributes:- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"- placeholder: "${I18n.t(+ label: "${i18n("admin.form_templates.field_placeholders.label")}"+ placeholder: "${i18n("admin.form_templates.field_placeholders.placeholder")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},{type: "textarea",structure: `- type: textarea- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}attributes:- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"- placeholder: "${I18n.t(+ label: "${i18n("admin.form_templates.field_placeholders.label")}"+ placeholder: "${i18n("admin.form_templates.field_placeholders.placeholder")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},{type: "dropdown",structure: `- type: dropdown- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}choices:- - "${I18n.t("admin.form_templates.field_placeholders.choices.first")}"- - "${I18n.t("admin.form_templates.field_placeholders.choices.second")}"- - "${I18n.t("admin.form_templates.field_placeholders.choices.third")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.first")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.second")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.third")}"attributes:- none_label: "${I18n.t(- "admin.form_templates.field_placeholders.none_label"- )}"- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"+ none_label: "${i18n("admin.form_templates.field_placeholders.none_label")}"+ label: "${i18n("admin.form_templates.field_placeholders.label")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},{type: "upload",structure: `- type: upload- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}attributes:file_types: ".jpg, .png, .gif"allow_multiple: false- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"+ label: "${i18n("admin.form_templates.field_placeholders.label")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},{type: "multiselect",structure: `- type: multi-select- id: ${I18n.t("admin.form_templates.field_placeholders.id")}+ id: ${i18n("admin.form_templates.field_placeholders.id")}choices:- - "${I18n.t("admin.form_templates.field_placeholders.choices.first")}"- - "${I18n.t("admin.form_templates.field_placeholders.choices.second")}"- - "${I18n.t("admin.form_templates.field_placeholders.choices.third")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.first")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.second")}"+ - "${i18n("admin.form_templates.field_placeholders.choices.third")}"attributes:- none_label: "${I18n.t(- "admin.form_templates.field_placeholders.none_label"- )}"- label: "${I18n.t("admin.form_templates.field_placeholders.label")}"+ none_label: "${i18n("admin.form_templates.field_placeholders.none_label")}"+ label: "${i18n("admin.form_templates.field_placeholders.label")}"validations:- # ${I18n.t("admin.form_templates.field_placeholders.validations")}`,+ # ${i18n("admin.form_templates.field_placeholders.validations")}`,},];diff --git a/app/assets/javascripts/admin/addon/mixins/setting-component.js b/app/assets/javascripts/admin/addon/mixins/setting-component.jsindex e9e9da06592..226ff97de36 100644--- a/app/assets/javascripts/admin/addon/mixins/setting-component.js+++ b/app/assets/javascripts/admin/addon/mixins/setting-component.js@@ -12,7 +12,7 @@ import { fmt, propertyNotEqual } from "discourse/lib/computed";import { SITE_SETTING_REQUIRES_CONFIRMATION_TYPES } from "discourse/lib/constants";import { splitString } from "discourse/lib/utilities";import { deepEqual } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import SiteSettingDefaultCategoriesModal from "../components/modal/site-setting-default-categories";const CUSTOM_TYPES = [@@ -226,20 +226,20 @@ export default Mixin.create({// Fallback is needed in case the setting does not have a custom confirmation// prompt/confirm defined.this.dialog.alert({- message: I18n.t(+ message: i18n(`admin.site_settings.requires_confirmation_messages.${settingKey}.prompt`,{- translatedFallback: I18n.t(+ translatedFallback: i18n("admin.site_settings.requires_confirmation_messages.default.prompt"),}),buttons: [{- label: I18n.t(+ label: i18n(`admin.site_settings.requires_confirmation_messages.${settingKey}.confirm`,{- translatedFallback: I18n.t(+ translatedFallback: i18n("admin.site_settings.requires_confirmation_messages.default.confirm"),}@@ -248,7 +248,7 @@ export default Mixin.create({action: () => resolve(true),},{- label: I18n.t("no_value"),+ label: i18n("no_value"),class: "btn-default",action: () => resolve(false),},@@ -325,7 +325,7 @@ export default Mixin.create({this.set("validationMessage", errorString);} else {- this.set("validationMessage", I18n.t("generic_error"));+ this.set("validationMessage", i18n("generic_error"));}}}),diff --git a/app/assets/javascripts/admin/addon/mixins/setting-object.js b/app/assets/javascripts/admin/addon/mixins/setting-object.jsindex 6334399e454..8d6adc48634 100644--- a/app/assets/javascripts/admin/addon/mixins/setting-object.js+++ b/app/assets/javascripts/admin/addon/mixins/setting-object.js@@ -3,7 +3,7 @@ import { readOnly } from "@ember/object/computed";import Mixin from "@ember/object/mixin";import { isPresent } from "@ember/utils";import { deepEqual } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default Mixin.create({overridden: computed("value", "default", function () {@@ -56,7 +56,7 @@ export default Mixin.create({(validValues || []).forEach((v) => {if (v.name && v.name.length > 0 && translateNames) {- values.addObject({ name: I18n.t(v.name), value: v.value });+ values.addObject({ name: i18n(v.name), value: v.value });} else {values.addObject(v);}diff --git a/app/assets/javascripts/admin/addon/models/admin-plugin.js b/app/assets/javascripts/admin/addon/models/admin-plugin.jsindex 4b0bb10045b..53e86cf888b 100644--- a/app/assets/javascripts/admin/addon/models/admin-plugin.js+++ b/app/assets/javascripts/admin/addon/models/admin-plugin.js@@ -1,7 +1,7 @@import { cached, tracked } from "@glimmer/tracking";import { capitalize, dasherize } from "@ember/string";import { snakeCaseToCamelCase } from "discourse-common/lib/case-converter";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";export default class AdminPlugin {static create(args = {}) {@@ -82,10 +82,10 @@ export default class AdminPlugin {get author() {if (this.isOfficial || this.isDiscourseOwned) {- return I18n.t("admin.plugins.author", { author: "Discourse" });+ return i18n("admin.plugins.author", { author: "Discourse" });}- return I18n.t("admin.plugins.author", { author: this.authors });+ return i18n("admin.plugins.author", { author: this.authors });}get linkUrl() {diff --git a/app/assets/javascripts/admin/addon/models/admin-user.js b/app/assets/javascripts/admin/addon/models/admin-user.jsindex 0449fd5056c..952918db661 100644--- a/app/assets/javascripts/admin/addon/models/admin-user.js+++ b/app/assets/javascripts/admin/addon/models/admin-user.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminUser extends User {static find(user_id) {@@ -49,11 +49,11 @@ export default class AdminUser extends User {@discourseComputed("bounce_score")bounceScoreExplanation(bounce_score) {if (bounce_score === 0) {- return I18n.t("admin.user.bounce_score_explanation.none");+ return i18n("admin.user.bounce_score_explanation.none");} else if (bounce_score < this.siteSettings.bounce_score_threshold) {- return I18n.t("admin.user.bounce_score_explanation.some");+ return i18n("admin.user.bounce_score_explanation.some");} else {- return I18n.t("admin.user.bounce_score_explanation.threshold_reached");+ return i18n("admin.user.bounce_score_explanation.threshold_reached");}}diff --git a/app/assets/javascripts/admin/addon/models/color-scheme-color.js b/app/assets/javascripts/admin/addon/models/color-scheme-color.jsindex 84498e180f1..4c956de3645 100644--- a/app/assets/javascripts/admin/addon/models/color-scheme-color.js+++ b/app/assets/javascripts/admin/addon/models/color-scheme-color.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ColorSchemeColor extends EmberObject {// Whether the current value is different than Discourse's default color scheme.@@ -47,7 +47,7 @@ export default class ColorSchemeColor extends EmberObject {@discourseComputed("name")translatedName(name) {if (!this.is_advanced) {- return I18n.t(`admin.customize.colors.${name}.name`);+ return i18n(`admin.customize.colors.${name}.name`);} else {return name;}@@ -56,7 +56,7 @@ export default class ColorSchemeColor extends EmberObject {@discourseComputed("name")description(name) {if (!this.is_advanced) {- return I18n.t(`admin.customize.colors.${name}.description`);+ return i18n(`admin.customize.colors.${name}.description`);} else {return "";}diff --git a/app/assets/javascripts/admin/addon/models/color-scheme.js b/app/assets/javascripts/admin/addon/models/color-scheme.jsindex 73d2820efdb..b6c62d75f58 100644--- a/app/assets/javascripts/admin/addon/models/color-scheme.js+++ b/app/assets/javascripts/admin/addon/models/color-scheme.js@@ -4,7 +4,7 @@ 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 { i18n } from "discourse-i18n";import ColorSchemeColor from "admin/models/color-scheme-color";class ColorSchemes extends ArrayProxy {}@@ -117,7 +117,7 @@ export default class ColorScheme extends EmberObject {return;}- this.setProperties({ savingStatus: I18n.t("saving"), saving: true });+ this.setProperties({ savingStatus: i18n("saving"), saving: true });const data = {};if (!opts || !opts.enabledOnly) {@@ -150,7 +150,7 @@ export default class ColorScheme extends EmberObject {this.colors.forEach((c) => c.startTrackingChanges());}- this.setProperties({ savingStatus: I18n.t("saved"), saving: false });+ this.setProperties({ savingStatus: i18n("saved"), saving: false });this.notifyPropertyChange("description");});}diff --git a/app/assets/javascripts/admin/addon/models/flag-type.js b/app/assets/javascripts/admin/addon/models/flag-type.jsindex 7e1eb60daf8..9560ffa3809 100644--- a/app/assets/javascripts/admin/addon/models/flag-type.js+++ b/app/assets/javascripts/admin/addon/models/flag-type.js@@ -1,10 +1,10 @@import RestModel from "discourse/models/rest";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FlagType extends RestModel {@discourseComputed("id")name(id) {- return I18n.t(`admin.flags.summary.action_type_${id}`, { count: 1 });+ return i18n(`admin.flags.summary.action_type_${id}`, { count: 1 });}}diff --git a/app/assets/javascripts/admin/addon/models/report.js b/app/assets/javascripts/admin/addon/models/report.jsindex f05a620ae52..34d268fac8d 100644--- a/app/assets/javascripts/admin/addon/models/report.js+++ b/app/assets/javascripts/admin/addon/models/report.js@@ -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 "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";// Change this line each time report format change// and you want to ensure cache is reset@@ -398,7 +398,7 @@ export default class Report extends EmberObject {current = number(current);}- return I18n.t("admin.dashboard.reports.trend_title", {+ return i18n("admin.dashboard.reports.trend_title", {percent,prev,current,diff --git a/app/assets/javascripts/admin/addon/models/screened-email.js b/app/assets/javascripts/admin/addon/models/screened-email.jsindex da3cb900523..df302ca76ec 100644--- a/app/assets/javascripts/admin/addon/models/screened-email.js+++ b/app/assets/javascripts/admin/addon/models/screened-email.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ScreenedEmail extends EmberObject {static findAll() {@@ -16,7 +16,7 @@ export default class ScreenedEmail extends EmberObject {@discourseComputed("action")actionName(action) {- return I18n.t("admin.logs.screened_actions." + action);+ return i18n("admin.logs.screened_actions." + action);}clearBlock() {diff --git a/app/assets/javascripts/admin/addon/models/screened-ip-address.js b/app/assets/javascripts/admin/addon/models/screened-ip-address.jsindex 450c7ad57c7..80d625dad5c 100644--- a/app/assets/javascripts/admin/addon/models/screened-ip-address.js+++ b/app/assets/javascripts/admin/addon/models/screened-ip-address.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ScreenedIpAddress extends EmberObject {static findAll(filter) {@@ -16,7 +16,7 @@ export default class ScreenedIpAddress extends EmberObject {@equal("action_name", "block") isBlocked;@discourseComputed("action_name")actionName(actionName) {- return I18n.t(`admin.logs.screened_ips.actions.${actionName}`);+ return i18n(`admin.logs.screened_ips.actions.${actionName}`);}@discourseComputed("ip_address")diff --git a/app/assets/javascripts/admin/addon/models/screened-url.js b/app/assets/javascripts/admin/addon/models/screened-url.jsindex 74a14395c51..8d72617934a 100644--- a/app/assets/javascripts/admin/addon/models/screened-url.js+++ b/app/assets/javascripts/admin/addon/models/screened-url.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ScreenedUrl extends EmberObject {static findAll() {@@ -16,6 +16,6 @@ export default class ScreenedUrl extends EmberObject {@discourseComputed("action")actionName(action) {- return I18n.t("admin.logs.screened_actions." + action);+ return i18n("admin.logs.screened_actions." + action);}}diff --git a/app/assets/javascripts/admin/addon/models/site-setting.js b/app/assets/javascripts/admin/addon/models/site-setting.jsindex 5836d30ed28..9fd3b615bb8 100644--- a/app/assets/javascripts/admin/addon/models/site-setting.js+++ b/app/assets/javascripts/admin/addon/models/site-setting.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";import Setting from "admin/mixins/setting-object";export default class SiteSetting extends EmberObject.extend(Setting) {@@ -21,7 +21,7 @@ export default class SiteSetting extends EmberObject.extend(Setting) {return Object.keys(categories).map(function (n) {return {nameKey: n,- name: I18n.t("admin.site_settings.categories." + n),+ name: i18n("admin.site_settings.categories." + n),siteSettings: categories[n],};});diff --git a/app/assets/javascripts/admin/addon/models/staff-action-log.js b/app/assets/javascripts/admin/addon/models/staff-action-log.jsindex 66474f6d121..862ddf1755c 100644--- a/app/assets/javascripts/admin/addon/models/staff-action-log.js+++ b/app/assets/javascripts/admin/addon/models/staff-action-log.js@@ -2,12 +2,12 @@ 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 { i18n } from "discourse-i18n";import AdminUser from "admin/models/admin-user";function format(label, value, escape = true) {return value- ? `<b>${I18n.t(label)}</b>: ${escape ? escapeExpression(value) : value}`+ ? `<b>${i18n(label)}</b>: ${escape ? escapeExpression(value) : value}`: "";}@@ -39,7 +39,7 @@ export default class StaffActionLog extends RestModel {@discourseComputed("action_name")actionName(actionName) {- return I18n.t(`admin.logs.staff_actions.actions.${actionName}`);+ return i18n(`admin.logs.staff_actions.actions.${actionName}`);}@discourseComputed(diff --git a/app/assets/javascripts/admin/addon/models/theme.js b/app/assets/javascripts/admin/addon/models/theme.jsindex b7ca8babb06..3d4df49ce55 100644--- a/app/assets/javascripts/admin/addon/models/theme.js+++ b/app/assets/javascripts/admin/addon/models/theme.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";import ThemeSettings from "admin/models/theme-settings";const THEME_UPLOAD_VAR = 2;@@ -117,10 +117,10 @@ class Theme extends RestModel {if (target === "translations" || target === "extra_scss") {field.translatedName = fieldName;} else {- field.translatedName = I18n.t(+ field.translatedName = i18n(`admin.customize.theme.${fieldName}.text`);- field.title = I18n.t(`admin.customize.theme.${fieldName}.title`);+ field.title = i18n(`admin.customize.theme.${fieldName}.title`);}if (fieldName.indexOf("_tag") > 0) {diff --git a/app/assets/javascripts/admin/addon/models/watched-word.js b/app/assets/javascripts/admin/addon/models/watched-word.jsindex e6010084274..2095ca5d659 100644--- a/app/assets/javascripts/admin/addon/models/watched-word.js+++ b/app/assets/javascripts/admin/addon/models/watched-word.js@@ -1,6 +1,6 @@import EmberObject from "@ember/object";import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class WatchedWord extends EmberObject {static findAll() {@@ -18,7 +18,7 @@ export default class WatchedWord extends EmberObject {return Object.keys(actions).map((nameKey) => {return EmberObject.create({nameKey,- name: I18n.t("admin.watched_words.actions." + nameKey),+ name: i18n("admin.watched_words.actions." + nameKey),words: actions[nameKey],compiledRegularExpression: list.compiled_regular_expressions[nameKey],});diff --git a/app/assets/javascripts/admin/addon/routes/admin-backups-logs.js b/app/assets/javascripts/admin/addon/routes/admin-backups-logs.jsindex ba31db92f4f..08bd8ff51c8 100644--- a/app/assets/javascripts/admin/addon/routes/admin-backups-logs.js+++ b/app/assets/javascripts/admin/addon/routes/admin-backups-logs.js@@ -1,7 +1,7 @@import EmberObject from "@ember/object";import PreloadStore from "discourse/lib/preload-store";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminBackupsLogsRoute extends DiscourseRoute {// since the logs are pushed via the message bus@@ -28,6 +28,6 @@ export default class AdminBackupsLogsRoute extends DiscourseRoute {}titleToken() {- return I18n.t("admin.backups.menu.logs");+ return i18n("admin.backups.menu.logs");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-backups-settings.js b/app/assets/javascripts/admin/addon/routes/admin-backups-settings.jsindex fbee45d1d40..55ba1d7e662 100644--- a/app/assets/javascripts/admin/addon/routes/admin-backups-settings.js+++ b/app/assets/javascripts/admin/addon/routes/admin-backups-settings.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import SiteSetting from "admin/models/site-setting";export default class AdminBackupsSettingsRoute extends DiscourseRoute {@@ -8,7 +8,7 @@ export default class AdminBackupsSettingsRoute extends DiscourseRoute {};titleToken() {- return I18n.t("admin.backups.settings");+ return i18n("admin.backups.settings");}async model(params) {diff --git a/app/assets/javascripts/admin/addon/routes/admin-backups.js b/app/assets/javascripts/admin/addon/routes/admin-backups.jsindex fac8be71a01..18318685e17 100644--- a/app/assets/javascripts/admin/addon/routes/admin-backups.js+++ b/app/assets/javascripts/admin/addon/routes/admin-backups.js@@ -6,7 +6,7 @@ import PreloadStore from "discourse/lib/preload-store";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 { 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";@@ -21,7 +21,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {@service modal;titleToken() {- return I18n.t("admin.backups.title");+ return i18n("admin.backups.title");}activate() {@@ -53,7 +53,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {} else if (log.message === "[FAILED]") {this.controllerFor("adminBackups").set("model.isOperationRunning", false);this.dialog.alert(- I18n.t("admin.backups.operations.failed", {+ i18n("admin.backups.operations.failed", {operation: log.operation,}));@@ -91,7 +91,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {@actiondestroyBackup(backup) {return this.dialog.yesNoConfirm({- message: I18n.t("admin.backups.operations.destroy.confirm"),+ message: i18n("admin.backups.operations.destroy.confirm"),didConfirm: () => {backup.destroy()@@ -107,7 +107,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {@actionstartRestore(backup) {this.dialog.yesNoConfirm({- message: I18n.t("admin.backups.operations.restore.confirm"),+ message: i18n("admin.backups.operations.restore.confirm"),didConfirm: () => {this.router.transitionTo("admin.backups.logs");backup.restore();@@ -118,7 +118,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {@actioncancelOperation() {this.dialog.yesNoConfirm({- message: I18n.t("admin.backups.operations.cancel.confirm"),+ message: i18n("admin.backups.operations.cancel.confirm"),didConfirm: () => {Backup.cancel().then(() => {this.controllerFor("adminBackups").set(@@ -133,7 +133,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {@actionrollback() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.backups.operations.rollback.confirm"),+ message: i18n("admin.backups.operations.rollback.confirm"),didConfirm: () => {Backup.rollback().then((result) => {if (!result.success) {@@ -149,13 +149,13 @@ export default class AdminBackupsRoute extends DiscourseRoute {@actionuploadSuccess(filename) {- this.dialog.alert(I18n.t("admin.backups.upload.success", { filename }));+ this.dialog.alert(i18n("admin.backups.upload.success", { filename }));}@actionuploadError(filename, message) {this.dialog.alert(- I18n.t("admin.backups.upload.error", { filename, message })+ i18n("admin.backups.upload.error", { filename, message }));}@@ -171,7 +171,7 @@ export default class AdminBackupsRoute extends DiscourseRoute {}).catch((error) => {this.dialog.alert(- I18n.t("admin.backups.backup_storage_error", {+ i18n("admin.backups.backup_storage_error", {error_message: extractError(error),}));diff --git a/app/assets/javascripts/admin/addon/routes/admin-badges.js b/app/assets/javascripts/admin/addon/routes/admin-badges.jsindex 47260f5ade7..29a08a41237 100644--- a/app/assets/javascripts/admin/addon/routes/admin-badges.js+++ b/app/assets/javascripts/admin/addon/routes/admin-badges.js@@ -4,7 +4,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 "discourse-i18n";+import { i18n } from "discourse-i18n";import EditBadgeGroupingsModal from "../components/modal/edit-badge-groupings";export default class AdminBadgesRoute extends DiscourseRoute {@@ -43,7 +43,7 @@ export default class AdminBadgesRoute extends DiscourseRoute {const id = json.admin_badges.triggers[k];badgeTriggers.push({id,- name: I18n.t("admin.badges.trigger_type." + k),+ name: i18n("admin.badges.trigger_type." + k),});});diff --git a/app/assets/javascripts/admin/addon/routes/admin-badges/show.js b/app/assets/javascripts/admin/addon/routes/admin-badges/show.jsindex 16bf32a980d..266099748f0 100644--- a/app/assets/javascripts/admin/addon/routes/admin-badges/show.js+++ b/app/assets/javascripts/admin/addon/routes/admin-badges/show.js@@ -2,7 +2,7 @@ import { get } from "@ember/object";import Route from "@ember/routing/route";import { service } from "@ember/service";import Badge from "discourse/models/badge";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminBadgesShowRoute extends Route {@service dialog;@@ -14,7 +14,7 @@ export default class AdminBadgesShowRoute extends Route {model(params) {if (params.badge_id === "new") {return Badge.create({- name: I18n.t("admin.badges.new_badge"),+ name: i18n("admin.badges.new_badge"),});}return this.modelFor("adminBadges").findBy(diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js b/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.jsindex bbeeba7d0f3..cb92c7ff386 100644--- a/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js+++ b/app/assets/javascripts/admin/addon/routes/admin-config-flags-edit.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigFlagsEditRoute extends DiscourseRoute {@service site;@@ -10,6 +10,6 @@ export default class AdminConfigFlagsEditRoute extends DiscourseRoute {}titleToken() {- return I18n.t("admin.config_areas.flags.edit_header");+ return i18n("admin.config_areas.flags.edit_header");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-flags-index.js b/app/assets/javascripts/admin/addon/routes/admin-config-flags-index.jsindex e5a0d3d2f87..3eb61ca280b 100644--- a/app/assets/javascripts/admin/addon/routes/admin-config-flags-index.js+++ b/app/assets/javascripts/admin/addon/routes/admin-config-flags-index.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigFlagsIndexRoute extends DiscourseRoute {titleToken() {- return I18n.t("admin.config_areas.flags.header");+ return i18n("admin.config_areas.flags.header");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js b/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.jsindex ee2d03bfa58..7f4fc2bc1e1 100644--- a/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js+++ b/app/assets/javascripts/admin/addon/routes/admin-config-flags-settings.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigFlagsIndexRoute extends DiscourseRoute {titleToken() {- return I18n.t("admin.config_areas.flags.settings");+ return i18n("admin.config_areas.flags.settings");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel-themes.js b/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel-themes.jsindex c7fed0b1b77..8e6aeacc67f 100644--- a/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel-themes.js+++ b/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel-themes.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigLookAndFeelThemesRoute extends DiscourseRoute {async model() {@@ -8,6 +8,6 @@ export default class AdminConfigLookAndFeelThemesRoute extends DiscourseRoute {}titleToken() {- return I18n.t("admin.config_areas.look_and_feel.themes.title");+ return i18n("admin.config_areas.look_and_feel.themes.title");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel.js b/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel.jsindex d697bfb2cf9..925765983ca 100644--- a/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel.js+++ b/app/assets/javascripts/admin/addon/routes/admin-config-look-and-feel.js@@ -1,11 +1,11 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminConfigLookAndFeelRoute extends DiscourseRoute {@service router;titleToken() {- return I18n.t("admin.config_areas.look_and_feel.title");+ return i18n("admin.config_areas.look_and_feel.title");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-email-style-edit.js b/app/assets/javascripts/admin/addon/routes/admin-customize-email-style-edit.jsindex 6c641a21d36..458b6e7b602 100644--- a/app/assets/javascripts/admin/addon/routes/admin-customize-email-style-edit.js+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-email-style-edit.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import Route from "@ember/routing/route";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeEmailStyleEditRoute extends Route {@service dialog;@@ -30,7 +30,7 @@ export default class AdminCustomizeEmailStyleEditRoute extends Route {) {transition.abort();this.dialog.confirm({- message: I18n.t("admin.customize.theme.unsaved_changes_alert"),+ message: i18n("admin.customize.theme.unsaved_changes_alert"),confirmButtonLabel: "admin.customize.theme.discard",cancelButtonLabel: "admin.customize.theme.stay",didConfirm: () => {diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-edit.js b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-edit.jsindex 7b9a43afd78..ad5efcecd06 100644--- a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-edit.js+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-edit.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import Route from "@ember/routing/route";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminCustomizeThemesEditRoute extends Route {@service dialog;@@ -64,7 +64,7 @@ export default class AdminCustomizeThemesEditRoute extends Route {transition.abort();this.dialog.confirm({- message: I18n.t("admin.customize.theme.unsaved_changes_alert"),+ message: i18n("admin.customize.theme.unsaved_changes_alert"),confirmButtonLabel: "admin.customize.theme.discard",cancelButtonLabel: "admin.customize.theme.stay",didConfirm: () => {diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.jsindex f1377754b3a..ad09b6d78c9 100644--- a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js@@ -2,7 +2,7 @@ import { action } from "@ember/object";import Route from "@ember/routing/route";import { service } from "@ember/service";import { scrollTop } from "discourse/mixins/scroll-top";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { COMPONENTS, THEMES } from "admin/models/theme";export default class AdminCustomizeThemesShowRoute extends Route {@@ -72,7 +72,7 @@ export default class AdminCustomizeThemesShowRoute extends Route {transition.abort();this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.theme.unsaved_parent_themes"),+ message: i18n("admin.customize.theme.unsaved_parent_themes"),didConfirm: () => {model.set("recentlyInstalled", false);transition.retry();diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-themes.js b/app/assets/javascripts/admin/addon/routes/admin-customize-themes.jsindex 107110ca2d0..007702625ab 100644--- a/app/assets/javascripts/admin/addon/routes/admin-customize-themes.js+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-themes.js@@ -2,7 +2,7 @@ import { action } from "@ember/object";import Route from "@ember/routing/route";import { next } from "@ember/runloop";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import InstallThemeModal from "../components/modal/install-theme";export default class AdminCustomizeThemesRoute extends Route {@@ -66,7 +66,7 @@ export default class AdminCustomizeThemesRoute extends Route {const currentTheme = this.modelFor("adminCustomizeThemes");if (this.currentModel?.warnUnassignedComponent) {this.dialog.yesNoConfirm({- message: I18n.t("admin.customize.theme.unsaved_parent_themes"),+ message: i18n("admin.customize.theme.unsaved_parent_themes"),didConfirm: () => {currentTheme.set("recentlyInstalled", false);this.modal.show(InstallThemeModal, {diff --git a/app/assets/javascripts/admin/addon/routes/admin-emojis-settings.js b/app/assets/javascripts/admin/addon/routes/admin-emojis-settings.jsindex 643a20f8cdf..2512960d9b4 100644--- a/app/assets/javascripts/admin/addon/routes/admin-emojis-settings.js+++ b/app/assets/javascripts/admin/addon/routes/admin-emojis-settings.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminEmojisSettingsRoute extends DiscourseRoute {queryParams = {@@ -7,6 +7,6 @@ export default class AdminEmojisSettingsRoute extends DiscourseRoute {};titleToken() {- return I18n.t("settings");+ return i18n("settings");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-emojis.js b/app/assets/javascripts/admin/addon/routes/admin-emojis.jsindex 81678782203..830ccd698c6 100644--- a/app/assets/javascripts/admin/addon/routes/admin-emojis.js+++ b/app/assets/javascripts/admin/addon/routes/admin-emojis.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminEmojisRoute extends DiscourseRoute {titleToken() {- return I18n.t("admin.emoji.title");+ return i18n("admin.emoji.title");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-plugins-show-settings.js b/app/assets/javascripts/admin/addon/routes/admin-plugins-show-settings.jsindex d60b781b680..686a1b344e6 100644--- a/app/assets/javascripts/admin/addon/routes/admin-plugins-show-settings.js+++ b/app/assets/javascripts/admin/addon/routes/admin-plugins-show-settings.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import SiteSetting from "admin/models/site-setting";export default class AdminPluginsShowSettingsRoute extends DiscourseRoute {@@ -20,6 +20,6 @@ export default class AdminPluginsShowSettingsRoute extends DiscourseRoute {}titleToken() {- return I18n.t("admin.plugins.change_settings_short");+ return i18n("admin.plugins.change_settings_short");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-plugins.js b/app/assets/javascripts/admin/addon/routes/admin-plugins.jsindex bcb5f9fe407..a579bf1d3d9 100644--- a/app/assets/javascripts/admin/addon/routes/admin-plugins.js+++ b/app/assets/javascripts/admin/addon/routes/admin-plugins.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminPlugin from "admin/models/admin-plugin";export default class AdminPluginsRoute extends DiscourseRoute {@@ -12,6 +12,6 @@ export default class AdminPluginsRoute extends DiscourseRoute {}titleToken() {- return I18n.t("admin.plugins.title");+ return i18n("admin.plugins.title");}}diff --git a/app/assets/javascripts/admin/addon/routes/admin-site-settings-category.js b/app/assets/javascripts/admin/addon/routes/admin-site-settings-category.jsindex 32215571e82..0eac1d17e7b 100644--- a/app/assets/javascripts/admin/addon/routes/admin-site-settings-category.js+++ b/app/assets/javascripts/admin/addon/routes/admin-site-settings-category.js@@ -1,6 +1,6 @@import EmberObject from "@ember/object";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminSiteSettingsCategoryRoute extends DiscourseRoute {model(params) {@@ -15,7 +15,7 @@ export default class AdminSiteSettingsCategoryRoute extends DiscourseRoute {);return EmberObject.create({nameKey: params.category_id,- name: I18n.t("admin.site_settings.categories." + params.category_id),+ name: i18n("admin.site_settings.categories." + params.category_id),siteSettings: this.controllerFor("adminSiteSettingsCategory").get("filteredContent"),diff --git a/app/assets/javascripts/admin/addon/routes/admin-watched-words-action.js b/app/assets/javascripts/admin/addon/routes/admin-watched-words-action.jsindex d960000747c..2c1746b0e60 100644--- a/app/assets/javascripts/admin/addon/routes/admin-watched-words-action.js+++ b/app/assets/javascripts/admin/addon/routes/admin-watched-words-action.js@@ -1,6 +1,6 @@import EmberObject from "@ember/object";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminWatchedWordsActionRoute extends DiscourseRoute {model(params) {@@ -8,7 +8,7 @@ export default class AdminWatchedWordsActionRoute extends DiscourseRoute {controller.set("actionNameKey", params.action_id);return EmberObject.create({nameKey: params.action_id,- name: I18n.t("admin.watched_words.actions." + params.action_id),+ name: i18n("admin.watched_words.actions." + params.action_id),words: controller.filteredContent,});}diff --git a/app/assets/javascripts/admin/addon/routes/admin-whats-new.js b/app/assets/javascripts/admin/addon/routes/admin-whats-new.jsindex 9fdd6e246c2..b1d3af35158 100644--- a/app/assets/javascripts/admin/addon/routes/admin-whats-new.js+++ b/app/assets/javascripts/admin/addon/routes/admin-whats-new.js@@ -1,12 +1,12 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminWhatsNew extends DiscourseRoute {@service currentUser;titleToken() {- return I18n.t("admin.dashboard.new_features.title");+ return i18n("admin.dashboard.new_features.title");}activate() {diff --git a/app/assets/javascripts/admin/addon/routes/admin.js b/app/assets/javascripts/admin/addon/routes/admin.jsindex 1ae4eb735dd..5ea893f164c 100644--- a/app/assets/javascripts/admin/addon/routes/admin.js+++ b/app/assets/javascripts/admin/addon/routes/admin.js@@ -1,7 +1,7 @@import { tracked } from "@glimmer/tracking";import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminRoute extends DiscourseRoute {@service sidebarState;@@ -12,7 +12,7 @@ export default class AdminRoute extends DiscourseRoute {@tracked initialSidebarState;titleToken() {- return I18n.t("admin_title");+ return i18n("admin_title");}activate() {diff --git a/app/assets/javascripts/admin/addon/services/admin-emojis.js b/app/assets/javascripts/admin/addon/services/admin-emojis.jsindex 2ac00d7f957..1d66e3d4a36 100644--- a/app/assets/javascripts/admin/addon/services/admin-emojis.js+++ b/app/assets/javascripts/admin/addon/services/admin-emojis.js@@ -3,7 +3,7 @@ import EmberObject, { action } from "@ember/object";import Service, { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const ALL_FILTER = "all";const DEFAULT_GROUP = "default";@@ -54,7 +54,7 @@ export default class AdminEmojis extends Service {@actiondestroyEmoji(emoji) {this.dialog.yesNoConfirm({- message: I18n.t("admin.emoji.delete_confirm", {+ message: i18n("admin.emoji.delete_confirm", {name: emoji.get("name"),}),didConfirm: () => this.#destroyEmoji(emoji),diff --git a/app/assets/javascripts/admin/addon/services/admin-tools.js b/app/assets/javascripts/admin/addon/services/admin-tools.jsindex 4710e500755..f9fdfc34965 100644--- a/app/assets/javascripts/admin/addon/services/admin-tools.js+++ b/app/assets/javascripts/admin/addon/services/admin-tools.js@@ -3,7 +3,7 @@ import Service, { 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 I18n, { i18n } from "discourse-i18n";import PenalizeUserModal from "admin/components/modal/penalize-user";import AdminUser from "admin/models/admin-user";@@ -76,10 +76,9 @@ export default class AdminToolsService extends Service {POSTS: adminUser.get("post_count"),TOPICS: adminUser.get("topic_count"),email:- adminUser.get("email") || I18n.t("flagging.hidden_email_address"),+ adminUser.get("email") || i18n("flagging.hidden_email_address"),ip_address:- adminUser.get("ip_address") ||- I18n.t("flagging.ip_address_missing"),+ adminUser.get("ip_address") || i18n("flagging.ip_address_missing"),}));@@ -111,7 +110,7 @@ export default class AdminToolsService extends Service {}}).catch(() => {- this.dialog.alert(I18n.t("admin.user.delete_failed"));+ this.dialog.alert(i18n("admin.user.delete_failed"));reject();});},diff --git a/app/assets/javascripts/discourse-common/addon/helpers/bound-i18n.js b/app/assets/javascripts/discourse-common/addon/helpers/bound-i18n.jsindex a0e7d062f9e..8882b435450 100644--- a/app/assets/javascripts/discourse-common/addon/helpers/bound-i18n.js+++ b/app/assets/javascripts/discourse-common/addon/helpers/bound-i18n.js@@ -1,6 +1,6 @@import { htmlSafe } from "@ember/template";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function boundI18n(key, options) {- return htmlSafe(I18n.t(key, options));+ return htmlSafe(i18n(key, options));}diff --git a/app/assets/javascripts/discourse-common/addon/helpers/i18n-yes-no.js b/app/assets/javascripts/discourse-common/addon/helpers/i18n-yes-no.jsindex 7409f045519..89bb98143a7 100644--- a/app/assets/javascripts/discourse-common/addon/helpers/i18n-yes-no.js+++ b/app/assets/javascripts/discourse-common/addon/helpers/i18n-yes-no.js@@ -1,8 +1,8 @@import { registerRawHelper } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";registerRawHelper("i18n-yes-no", i18nYesNo);export default function i18nYesNo(value, params) {- return I18n.t(value ? "yes_value" : "no_value", params);+ return i18n(value ? "yes_value" : "no_value", params);}diff --git a/app/assets/javascripts/discourse-common/addon/helpers/i18n.js b/app/assets/javascripts/discourse-common/addon/helpers/i18n.jsindex 6be12e597ee..13c0e69f556 100644--- a/app/assets/javascripts/discourse-common/addon/helpers/i18n.js+++ b/app/assets/javascripts/discourse-common/addon/helpers/i18n.js@@ -1,8 +1,6 @@import { registerRawHelper } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";registerRawHelper("i18n", i18n);-export default function i18n(key, params) {- return I18n.t(key, params);-}+export default i18n;diff --git a/app/assets/javascripts/discourse-common/addon/lib/icon-library.js b/app/assets/javascripts/discourse-common/addon/lib/icon-library.jsindex dd5c061e071..a4c7dbf4d76 100644--- a/app/assets/javascripts/discourse-common/addon/lib/icon-library.js+++ b/app/assets/javascripts/discourse-common/addon/lib/icon-library.js@@ -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 "discourse-i18n";+import { i18n } from "discourse-i18n";export const SVG_NAMESPACE = "http://www.w3.org/2000/svg";let _renderers = [];@@ -192,7 +192,7 @@ registerIconRenderer({}if (params.title) {html = `<span class="svg-icon-title" title='${escape(- I18n.t(params.title)+ i18n(params.title))}'>${html}</span>`;}diff --git a/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js b/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.jsindex d537a97277c..8dcf5385503 100644--- a/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js+++ b/app/assets/javascripts/discourse-markdown-it/src/features/image-controls.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const SCALES = ["100", "75", "50"];@@ -83,7 +83,7 @@ function rule(state) {function buildScaleButton(selectedScale, scale) {const activeScaleClass = selectedScale === scale ? " active" : "";return `<span title="- ${I18n.t("composer.image_scale_button", { percent: scale })}"+ ${i18n("composer.image_scale_button", { percent: scale })}"class='scale-btn${activeScaleClass}' data-scale='${scale}'>${scale}%@@ -94,12 +94,12 @@ function buildImageShowAltTextControls(altText) {return `<span class="alt-text-readonly-container"><span class="alt-text-edit-btn"- title="${I18n.t("composer.image_alt_text.title")}"+ title="${i18n("composer.image_alt_text.title")}"><svg aria-hidden="true" class="fa d-icon d-icon-pencil svg-icon svg-string"><use href="#pencil"></use></svg></span><span class="alt-text"- aria-label="${I18n.t("composer.image_alt_text.aria_label")}"+ aria-label="${i18n("composer.image_alt_text.aria_label")}">${altText}</span></span>`;@@ -122,8 +122,8 @@ function buildImageEditAltTextControls(altText) {function buildImageDeleteButton() {return `<span class="delete-image-button"- title="${I18n.t("composer.delete_image_button")}"- aria-label="${I18n.t("composer.delete_image_button")}"+ title="${i18n("composer.delete_image_button")}"+ aria-label="${i18n("composer.delete_image_button")}"><svg class="fa d-icon d-icon-trash-can svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#trash-can"></use>@@ -134,7 +134,7 @@ function buildImageDeleteButton() {function buildImageGalleryControl(imageCount) {return `- <span class="wrap-image-grid-button" title="${I18n.t(+ <span class="wrap-image-grid-button" title="${i18n("composer.toggle_image_grid")}" data-image-count="${imageCount}"><svg class="fa d-icon d-icon-table-cells svg-icon svg-string" xmlns="http://www.w3.org/2000/svg">diff --git a/app/assets/javascripts/discourse/app/components/about-page-user.gjs b/app/assets/javascripts/discourse/app/components/about-page-user.gjsindex 10f9907eb81..2fbd849d592 100644--- a/app/assets/javascripts/discourse/app/components/about-page-user.gjs+++ b/app/assets/javascripts/discourse/app/components/about-page-user.gjs@@ -1,7 +1,7 @@import avatar from "discourse/helpers/avatar";import { prioritizeNameInUx } from "discourse/lib/settings";import { userPath } from "discourse/lib/url";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const AboutPageUser = <template><div data-username={{@user.username}} class="user-info small">diff --git a/app/assets/javascripts/discourse/app/components/about-page-users.gjs b/app/assets/javascripts/discourse/app/components/about-page-users.gjsindex af760c61648..bb9995ef5f1 100644--- a/app/assets/javascripts/discourse/app/components/about-page-users.gjs+++ b/app/assets/javascripts/discourse/app/components/about-page-users.gjs@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import AboutPageUser from "discourse/components/about-page-user";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class AboutPageUsers extends Component {@tracked expanded = false;diff --git a/app/assets/javascripts/discourse/app/components/about-page.gjs b/app/assets/javascripts/discourse/app/components/about-page.gjsindex 31a836a733c..40e08008156 100644--- a/app/assets/javascripts/discourse/app/components/about-page.gjs+++ b/app/assets/javascripts/discourse/app/components/about-page.gjs@@ -7,9 +7,8 @@ import AboutPageUsers from "discourse/components/about-page-users";import PluginOutlet from "discourse/components/plugin-outlet";import { number } from "discourse/lib/formatter";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import escape from "discourse-common/lib/escape";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";const pluginActivitiesFuncs = [];@@ -38,7 +37,7 @@ export default class AboutPage extends Component {{class: "members",icon: "users",- text: I18n.t("about.member_count", {+ text: i18n("about.member_count", {count: this.args.model.stats.users_count,formatted_number: I18n.toNumber(this.args.model.stats.users_count, {precision: 0,@@ -48,7 +47,7 @@ export default class AboutPage extends Component {{class: "admins",icon: "shield-halved",- text: I18n.t("about.admin_count", {+ text: i18n("about.admin_count", {count: this.adminsCount,formatted_number: I18n.toNumber(this.adminsCount, { precision: 0 }),}),@@ -56,7 +55,7 @@ export default class AboutPage extends Component {{class: "moderators",icon: "shield-halved",- text: I18n.t("about.moderator_count", {+ text: i18n("about.moderator_count", {count: this.moderatorsCount,formatted_number: I18n.toNumber(this.moderatorsCount, {precision: 0,@@ -76,47 +75,47 @@ export default class AboutPage extends Component {{icon: "scroll",class: "topics",- activityText: I18n.t("about.activities.topics", {+ activityText: i18n("about.activities.topics", {count: this.args.model.stats.topics_7_days,formatted_number: number(this.args.model.stats.topics_7_days),}),- period: I18n.t("about.activities.periods.last_7_days"),+ period: i18n("about.activities.periods.last_7_days"),},{icon: "pencil",class: "posts",- activityText: I18n.t("about.activities.posts", {+ activityText: i18n("about.activities.posts", {count: this.args.model.stats.posts_last_day,formatted_number: number(this.args.model.stats.posts_last_day),}),- period: I18n.t("about.activities.periods.today"),+ period: i18n("about.activities.periods.today"),},{icon: "user-group",class: "active-users",- activityText: I18n.t("about.activities.active_users", {+ activityText: i18n("about.activities.active_users", {count: this.args.model.stats.active_users_7_days,formatted_number: number(this.args.model.stats.active_users_7_days),}),- period: I18n.t("about.activities.periods.last_7_days"),+ period: i18n("about.activities.periods.last_7_days"),},{icon: "user-plus",class: "sign-ups",- activityText: I18n.t("about.activities.sign_ups", {+ activityText: i18n("about.activities.sign_ups", {count: this.args.model.stats.users_7_days,formatted_number: number(this.args.model.stats.users_7_days),}),- period: I18n.t("about.activities.periods.last_7_days"),+ period: i18n("about.activities.periods.last_7_days"),},{icon: "heart",class: "likes",- activityText: I18n.t("about.activities.likes", {+ activityText: i18n("about.activities.likes", {count: this.args.model.stats.likes_count,formatted_number: number(this.args.model.stats.likes_count),}),- period: I18n.t("about.activities.periods.all_time"),+ period: i18n("about.activities.periods.all_time"),},];@@ -130,7 +129,7 @@ export default class AboutPage extends Component {total_formatted_number: number(this.args.model.stats.visitors_7_days),eu_formatted_number: number(this.args.model.stats.eu_visitors_7_days),}),- period: I18n.t("about.activities.periods.last_7_days"),+ period: i18n("about.activities.periods.last_7_days"),});}@@ -150,11 +149,11 @@ export default class AboutPage extends Component {const email = escape(this.args.model.contact_email || "");if (url) {- return I18n.t("about.contact_info", {+ return i18n("about.contact_info", {contact_info: `<a href='${url}' target='_blank'>${url}</a>`,});} else if (email) {- return I18n.t("about.contact_info", {+ return i18n("about.contact_info", {contact_info: `<a href="mailto:${email}">${email}</a>`,});} else {@@ -169,12 +168,12 @@ export default class AboutPage extends Component {diff /= 1000 * 3600 * 24 * 30;if (diff < 1) {- return I18n.t("about.site_age.less_than_one_month");+ return i18n("about.site_age.less_than_one_month");} else if (diff < 12) {- return I18n.t("about.site_age.month", { count: Math.round(diff) });+ return i18n("about.site_age.month", { count: Math.round(diff) });} else {diff /= 12;- return I18n.t("about.site_age.year", { count: Math.round(diff) });+ return i18n("about.site_age.year", { count: Math.round(diff) });}}diff --git a/app/assets/javascripts/discourse/app/components/ace-editor.gjs b/app/assets/javascripts/discourse/app/components/ace-editor.gjsindex 01c49e3db9c..5f062329e6b 100644--- a/app/assets/javascripts/discourse/app/components/ace-editor.gjs+++ b/app/assets/javascripts/discourse/app/components/ace-editor.gjs@@ -9,7 +9,7 @@ import ConditionalLoadingSpinner from "discourse/components/conditional-loading-import loadAce from "discourse/lib/load-ace-editor";import { isTesting } from "discourse-common/config/environment";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const WAITER = buildWaiter("ace-editor");const COLOR_VARS_REGEX =@@ -216,7 +216,7 @@ export default class AceEditor extends Component {return {row,column: 0,- text: I18n.t("admin.customize.theme.scss_warning_inline"),+ text: i18n("admin.customize.theme.scss_warning_inline"),type: "warning",};}@@ -227,7 +227,7 @@ export default class AceEditor extends Component {this.args.setWarning?.(warnings.length- ? I18n.t("admin.customize.theme.scss_color_variables_warning")+ ? i18n("admin.customize.theme.scss_color_variables_warning"): false);}diff --git a/app/assets/javascripts/discourse/app/components/activation-email-form.gjs b/app/assets/javascripts/discourse/app/components/activation-email-form.gjsindex 01c672e7dfb..411be3b5598 100644--- a/app/assets/javascripts/discourse/app/components/activation-email-form.gjs+++ b/app/assets/javascripts/discourse/app/components/activation-email-form.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { on } from "@ember/modifier";import { action } from "@ember/object";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ActivationEmailForm extends Component {@actiondiff --git a/app/assets/javascripts/discourse/app/components/auth-token-dropdown.js b/app/assets/javascripts/discourse/app/components/auth-token-dropdown.jsindex 28bb6486762..a7240703a06 100644--- a/app/assets/javascripts/discourse/app/components/auth-token-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/auth-token-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -16,13 +16,13 @@ export default class AuthTokenDropdown extends DropdownSelectBoxComponent {{id: "notYou",icon: "user-xmark",- name: I18n.t("user.auth_tokens.not_you"),+ name: i18n("user.auth_tokens.not_you"),description: "",},{id: "logOut",icon: "right-from-bracket",- name: I18n.t("user.log_out"),+ name: i18n("user.log_out"),description: "",},];diff --git a/app/assets/javascripts/discourse/app/components/avatar-uploader.js b/app/assets/javascripts/discourse/app/components/avatar-uploader.jsindex 9e63badf070..2479c29367d 100644--- a/app/assets/javascripts/discourse/app/components/avatar-uploader.js+++ b/app/assets/javascripts/discourse/app/components/avatar-uploader.js@@ -5,7 +5,7 @@ import { isBlank } from "@ember/utils";import { tagName } from "@ember-decorators/component";import UppyUpload from "discourse/lib/uppy/uppy-upload";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("span")export default class AvatarUploader extends Component {@@ -39,8 +39,8 @@ export default class AvatarUploader extends Component {@discourseComputed("uppyUpload.uploading", "uppyUpload.uploadProgress")uploadLabel() {return this.uppyUpload.uploading- ? `${I18n.t("uploading")} ${this.uppyUpload.uploadProgress}%`- : I18n.t("upload");+ ? `${i18n("uploading")} ${this.uppyUpload.uploadProgress}%`+ : i18n("upload");}@actiondiff --git a/app/assets/javascripts/discourse/app/components/back-button.gjs b/app/assets/javascripts/discourse/app/components/back-button.gjsindex 6bed727f40a..0a8c6e8533a 100644--- a/app/assets/javascripts/discourse/app/components/back-button.gjs+++ b/app/assets/javascripts/discourse/app/components/back-button.gjs@@ -1,7 +1,7 @@import { LinkTo } from "@ember/routing";import { or } from "truth-helpers";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";<template><LinkTo class="btn btn-flat back-button" @route={{@route}}>diff --git a/app/assets/javascripts/discourse/app/components/backup-codes.gjs b/app/assets/javascripts/discourse/app/components/backup-codes.gjsindex 5e2ca42848b..7fa8483e28a 100644--- a/app/assets/javascripts/discourse/app/components/backup-codes.gjs+++ b/app/assets/javascripts/discourse/app/components/backup-codes.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import copyText from "discourse/lib/copy-text";import { slugify, toAsciiPrintable } from "discourse/lib/utilities";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";// https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decodingfunction b64EncodeUnicode(str) {diff --git a/app/assets/javascripts/discourse/app/components/badge-card.gjs b/app/assets/javascripts/discourse/app/components/badge-card.gjsindex 01b37671972..9c7b9add024 100644--- a/app/assets/javascripts/discourse/app/components/badge-card.gjs+++ b/app/assets/javascripts/discourse/app/components/badge-card.gjs@@ -9,7 +9,7 @@ import iconOrImage from "discourse/helpers/icon-or-image";import number from "discourse/helpers/number";import { emojiUnescape, sanitize } from "discourse/lib/text";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import PluginOutlet from "./plugin-outlet";export default class BadgeCard extends Component {diff --git a/app/assets/javascripts/discourse/app/components/badge-title.js b/app/assets/javascripts/discourse/app/components/badge-title.jsindex 72e3324ee06..916d36f13a2 100644--- a/app/assets/javascripts/discourse/app/components/badge-title.js+++ b/app/assets/javascripts/discourse/app/components/badge-title.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { tagName } from "@ember-decorators/component";import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class BadgeTitle extends Component {@@ -43,7 +43,7 @@ export default class BadgeTitle extends Component {this.currentUser.set("title", selectedUserBadge?.badge?.name || "");},() => {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}).finally(() => this.set("_isSaving", false));diff --git a/app/assets/javascripts/discourse/app/components/bookmark-actions-dropdown.js b/app/assets/javascripts/discourse/app/components/bookmark-actions-dropdown.jsindex 6dc1ad954cb..e1f9018086a 100644--- a/app/assets/javascripts/discourse/app/components/bookmark-actions-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/bookmark-actions-dropdown.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import { classNames } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -28,23 +28,23 @@ export default class BookmarkActionsDropdown extends DropdownSelectBoxComponentactions.push({id: ACTION_REMOVE,icon: "trash-can",- name: I18n.t("post.bookmarks.actions.delete_bookmark.name"),- description: I18n.t("post.bookmarks.actions.delete_bookmark.description"),+ name: i18n("post.bookmarks.actions.delete_bookmark.name"),+ description: i18n("post.bookmarks.actions.delete_bookmark.description"),});actions.push({id: ACTION_EDIT,icon: "pencil",- name: I18n.t("post.bookmarks.actions.edit_bookmark.name"),- description: I18n.t("post.bookmarks.actions.edit_bookmark.description"),+ name: i18n("post.bookmarks.actions.edit_bookmark.name"),+ description: i18n("post.bookmarks.actions.edit_bookmark.description"),});if (bookmark.reminder_at) {actions.push({id: ACTION_CLEAR_REMINDER,icon: "clock-rotate-left",- name: I18n.t("post.bookmarks.actions.clear_bookmark_reminder.name"),- description: I18n.t(+ name: i18n("post.bookmarks.actions.clear_bookmark_reminder.name"),+ description: i18n("post.bookmarks.actions.clear_bookmark_reminder.description"),});@@ -53,10 +53,10 @@ export default class BookmarkActionsDropdown extends DropdownSelectBoxComponentactions.push({id: ACTION_PIN,icon: "thumbtack",- name: I18n.t(+ name: i18n(`post.bookmarks.actions.${bookmark.pinAction()}_bookmark.name`),- description: I18n.t(+ description: i18n(`post.bookmarks.actions.${bookmark.pinAction()}_bookmark.description`),});diff --git a/app/assets/javascripts/discourse/app/components/bookmark-icon.js b/app/assets/javascripts/discourse/app/components/bookmark-icon.jsindex bcde72c66ac..11389c548ad 100644--- a/app/assets/javascripts/discourse/app/components/bookmark-icon.js+++ b/app/assets/javascripts/discourse/app/components/bookmark-icon.js@@ -5,7 +5,7 @@ import {NO_REMINDER_ICON,WITH_REMINDER_ICON,} from "discourse/models/bookmark";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BookmarkIcon extends Component {tagName = "";@@ -34,7 +34,7 @@ export default class BookmarkIcon extends Component {@computed("bookmark.title")get title() {if (!this.bookmark) {- return I18n.t("bookmarks.create");+ return i18n("bookmarks.create");}return this.bookmark.reminderTitle;diff --git a/app/assets/javascripts/discourse/app/components/bookmark-list.js b/app/assets/javascripts/discourse/app/components/bookmark-list.jsindex dfe1cfc7220..e56c7d92246 100644--- a/app/assets/javascripts/discourse/app/components/bookmark-list.js+++ b/app/assets/javascripts/discourse/app/components/bookmark-list.js@@ -11,7 +11,7 @@ import {openLinkInNewTab,shouldOpenInNewTab,} from "discourse/lib/click-track";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("bookmark-list-wrapper")export default class BookmarkList extends Component {@@ -53,7 +53,7 @@ export default class BookmarkList extends Component {return deleteBookmark();}this.dialog.deleteConfirm({- message: I18n.t("bookmarks.confirm_delete"),+ message: i18n("bookmarks.confirm_delete"),didConfirm: () => deleteBookmark(),didCancel: () => resolve(false),});diff --git a/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs b/app/assets/javascripts/discourse/app/components/bookmark-menu.gjsindex 31e769d0531..be920a0a47d 100644--- a/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs+++ b/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs@@ -13,8 +13,7 @@ import {timeShortcuts,} from "discourse/lib/time-shortcut";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";export default class BookmarkMenu extends Component {@@ -55,15 +54,15 @@ export default class BookmarkMenu extends Component {get buttonTitle() {if (!this.existingBookmark) {- return I18n.t("bookmarks.not_bookmarked");+ return i18n("bookmarks.not_bookmarked");} else {if (this.existingBookmark.reminderAt) {- return I18n.t("bookmarks.created_with_reminder_generic", {+ return i18n("bookmarks.created_with_reminder_generic", {date: this.existingBookmark.formattedReminder(this.timezone),name: this.existingBookmark.name || "",});} else {- return I18n.t("bookmarks.created_generic", {+ return i18n("bookmarks.created_generic", {name: this.existingBookmark.name || "",});}@@ -107,9 +106,9 @@ export default class BookmarkMenu extends Component {}if (this.existingBookmark) {- return I18n.t("bookmarked.edit_bookmark");+ return i18n("bookmarked.edit_bookmark");} else {- return I18n.t("bookmarked.title");+ return i18n("bookmarked.title");}}@@ -118,7 +117,7 @@ export default class BookmarkMenu extends Component {if (!option.time) {return "";}- return option.time.format(I18n.t(option.timeFormatKey));+ return option.time.format(i18n(option.timeFormatKey));}@action@@ -134,7 +133,7 @@ export default class BookmarkMenu extends Component {this.toasts.success({duration: 1500,views: ["mobile"],- data: { message: I18n.t("bookmarks.bookmarked_success") },+ data: { message: i18n("bookmarks.bookmarked_success") },});}).catch((error) => popupAjaxError(error))@@ -174,7 +173,7 @@ export default class BookmarkMenu extends Component {duration: 1500,data: {icon: "trash-can",- message: I18n.t("bookmarks.deleted_bookmark_success"),+ message: i18n("bookmarks.deleted_bookmark_success"),},});} catch (error) {@@ -202,7 +201,7 @@ export default class BookmarkMenu extends Component {this.toasts.success({duration: 1500,views: ["mobile"],- data: { message: I18n.t("bookmarks.reminder_set_success") },+ data: { message: i18n("bookmarks.reminder_set_success") },});} catch (error) {popupAjaxError(error);diff --git a/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.js b/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.jsindex e5c67dddc25..8ac08a1ee9c 100644--- a/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.js+++ b/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.js@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { empty } from "@ember/object/computed";import { topicLevels } from "discourse/lib/notification-levels";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Support for changing the notification level of various topicsexport default class NotificationLevel extends Component {@@ -13,8 +13,8 @@ export default class NotificationLevel extends Component {get notificationLevels() {return topicLevels.map((level) => ({id: level.id.toString(),- name: I18n.t(`topic.notifications.${level.key}.title`),- description: I18n.t(`topic.notifications.${level.key}.description`),+ name: i18n(`topic.notifications.${level.key}.title`),+ description: i18n(`topic.notifications.${level.key}.description`),}));}diff --git a/app/assets/javascripts/discourse/app/components/bulk-group-member-dropdown.js b/app/assets/javascripts/discourse/app/components/bulk-group-member-dropdown.jsindex 0b4653be113..36333331acc 100644--- a/app/assets/javascripts/discourse/app/components/bulk-group-member-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/bulk-group-member-dropdown.js@@ -1,6 +1,6 @@import { computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -20,16 +20,16 @@ export default class BulkGroupMemberDropdown extends DropdownSelectBoxComponentitems.push({id: "removeMembers",- name: I18n.t("groups.members.remove_members"),- description: I18n.t("groups.members.remove_members_description"),+ name: i18n("groups.members.remove_members"),+ description: i18n("groups.members.remove_members_description"),icon: "user-xmark",});if (this.bulkSelection.some((m) => !m.owner)) {items.push({id: "makeOwners",- name: I18n.t("groups.members.make_owners"),- description: I18n.t("groups.members.make_owners_description"),+ name: i18n("groups.members.make_owners"),+ description: i18n("groups.members.make_owners_description"),icon: "shield-halved",});}@@ -37,8 +37,8 @@ export default class BulkGroupMemberDropdown extends DropdownSelectBoxComponentif (this.bulkSelection.some((m) => m.owner)) {items.push({id: "removeOwners",- name: I18n.t("groups.members.remove_owners"),- description: I18n.t("groups.members.remove_owners_description"),+ name: i18n("groups.members.remove_owners"),+ description: i18n("groups.members.remove_owners_description"),icon: "shield-halved",});}@@ -47,8 +47,8 @@ export default class BulkGroupMemberDropdown extends DropdownSelectBoxComponentif (this.bulkSelection.some((m) => !m.primary)) {items.push({id: "setPrimary",- name: I18n.t("groups.members.make_all_primary"),- description: I18n.t("groups.members.make_all_primary_description"),+ name: i18n("groups.members.make_all_primary"),+ description: i18n("groups.members.make_all_primary_description"),icon: "id-card",});}@@ -56,8 +56,8 @@ export default class BulkGroupMemberDropdown extends DropdownSelectBoxComponentif (this.bulkSelection.some((m) => m.primary)) {items.push({id: "unsetPrimary",- name: I18n.t("groups.members.remove_all_primary"),- description: I18n.t("groups.members.remove_all_primary_description"),+ name: i18n("groups.members.remove_all_primary"),+ description: i18n("groups.members.remove_all_primary_description"),icon: "id-card",});}diff --git a/app/assets/javascripts/discourse/app/components/bulk-select-topics-dropdown.gjs b/app/assets/javascripts/discourse/app/components/bulk-select-topics-dropdown.gjsindex b1504147501..a3d09d166a9 100644--- a/app/assets/javascripts/discourse/app/components/bulk-select-topics-dropdown.gjs+++ b/app/assets/javascripts/discourse/app/components/bulk-select-topics-dropdown.gjs@@ -11,7 +11,7 @@ import DismissNew from "discourse/components/modal/dismiss-new";import DismissReadModal from "discourse/components/modal/dismiss-read";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";const _customButtons = [];diff --git a/app/assets/javascripts/discourse/app/components/calendar-date-time-input.js b/app/assets/javascripts/discourse/app/components/calendar-date-time-input.jsindex c7257892cee..42aacfe048e 100644--- a/app/assets/javascripts/discourse/app/components/calendar-date-time-input.js+++ b/app/assets/javascripts/discourse/app/components/calendar-date-time-input.js@@ -5,7 +5,7 @@ import { action } from "@ember/object";import { isEmpty } from "@ember/utils";import { Promise } from "rsvp";import loadScript from "discourse/lib/load-script";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class CalendarDateTimeInput extends Component {_timeFormat = this.args.timeFormat || "HH:mm:ss";@@ -91,8 +91,8 @@ export default class CalendarDateTimeInput extends Component {setDefaultDate: true,keyboardInput: false,i18n: {- previousMonth: I18n.t("dates.previous_month"),- nextMonth: I18n.t("dates.next_month"),+ previousMonth: i18n("dates.previous_month"),+ nextMonth: i18n("dates.next_month"),months: moment.months(),weekdays: moment.weekdays(),weekdaysShort: moment.weekdaysMin(),diff --git a/app/assets/javascripts/discourse/app/components/category-permission-row.gjs b/app/assets/javascripts/discourse/app/components/category-permission-row.gjsindex 1b3e46e97e4..a3528e25abd 100644--- a/app/assets/javascripts/discourse/app/components/category-permission-row.gjs+++ b/app/assets/javascripts/discourse/app/components/category-permission-row.gjs@@ -5,7 +5,7 @@ import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import PermissionType from "discourse/models/permission-type";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const EVERYONE = "everyone";@@ -62,8 +62,8 @@ export default class CategoryPermissionRow extends Component {get replyTooltip() {return this.replyDisabled- ? I18n.t("category.permissions.inherited")- : I18n.t("category.permissions.toggle_reply");+ ? i18n("category.permissions.inherited")+ : i18n("category.permissions.toggle_reply");}get createDisabled() {@@ -81,8 +81,8 @@ export default class CategoryPermissionRow extends Component {get createTooltip() {return this.createDisabled- ? I18n.t("category.permissions.inherited")- : I18n.t("category.permissions.toggle_full");+ ? i18n("category.permissions.inherited")+ : i18n("category.permissions.toggle_full");}get groupLink() {diff --git a/app/assets/javascripts/discourse/app/components/color-picker-choice.js b/app/assets/javascripts/discourse/app/components/color-picker-choice.jsindex 27d16ffcb28..924905416b1 100644--- a/app/assets/javascripts/discourse/app/components/color-picker-choice.js+++ b/app/assets/javascripts/discourse/app/components/color-picker-choice.js@@ -6,7 +6,7 @@ import {tagName,} from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("button")@attributeBindings("style", "title", "ariaLabel:aria-label")@@ -19,7 +19,7 @@ export default class ColorPickerChoice extends Component {@discourseComputed("isUsed")title(isUsed) {- return isUsed ? I18n.t("category.already_used") : null;+ return isUsed ? i18n("category.already_used") : null;}@discourseComputed("color")diff --git a/app/assets/javascripts/discourse/app/components/color-picker.js b/app/assets/javascripts/discourse/app/components/color-picker.jsindex 1c45c822b13..a450bcc44cb 100644--- a/app/assets/javascripts/discourse/app/components/color-picker.js+++ b/app/assets/javascripts/discourse/app/components/color-picker.js@@ -1,7 +1,7 @@import Component from "@ember/component";import { action } from "@ember/object";import { attributeBindings, classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("colors-container")@attributeBindings("role", "ariaLabel:aria-label")@@ -16,7 +16,7 @@ export default class ColorPicker extends Component {@actiongetColorLabel(color) {const isUsed = this.usedColors?.includes(color.toUpperCase())- ? I18n.t("category.color_used")+ ? i18n("category.color_used"): "";return `#${color} ${isUsed}`;}diff --git a/app/assets/javascripts/discourse/app/components/composer-action-title.js b/app/assets/javascripts/discourse/app/components/composer-action-title.jsindex a72c4607fa9..ae8b8e1a065 100644--- a/app/assets/javascripts/discourse/app/components/composer-action-title.js+++ b/app/assets/javascripts/discourse/app/components/composer-action-title.js@@ -13,7 +13,7 @@ import {import escape from "discourse-common/lib/escape";import { iconHTML } from "discourse-common/lib/icon-library";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const TITLES = {[PRIVATE_MESSAGE]: "topic.private_message",@@ -37,7 +37,7 @@ export default class ComposerActionTitle extends Component {}if (TITLES[action]) {- return I18n.t(TITLES[action]);+ return i18n(TITLES[action]);}if (action === REPLY) {diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.js b/app/assets/javascripts/discourse/app/components/composer-editor.jsindex 5063b5072e2..743081a0ac5 100644--- a/app/assets/javascripts/discourse/app/components/composer-editor.js+++ b/app/assets/javascripts/discourse/app/components/composer-editor.js@@ -34,7 +34,7 @@ import discourseComputed, {bind,debounce,} from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let uploadHandlers = [];export function addComposerUploadHandler(extensions, method) {@@ -225,18 +225,18 @@ export default class ComposerEditor extends Component {let reason;if (replyLength < 1) {- reason = I18n.t("composer.error.post_missing");+ reason = i18n("composer.error.post_missing");} else if (missingReplyCharacters > 0) {- reason = I18n.t("composer.error.post_length", {+ reason = i18n("composer.error.post_length", {count: minimumPostLength,});const tl = this.get("currentUser.trust_level");if ((tl === 0 || tl === 1) && !this._isNewTopic) {reason +="<br/>" +- I18n.t("composer.error.try_like", {+ i18n("composer.error.try_like", {heart: iconHTML("heart", {- label: I18n.t("likes_lowercase", { count: 1 }),+ label: i18n("likes_lowercase", { count: 1 }),}),});}diff --git a/app/assets/javascripts/discourse/app/components/composer-messages.js b/app/assets/javascripts/discourse/app/components/composer-messages.jsindex 853d7959cc0..6c14641160b 100644--- a/app/assets/javascripts/discourse/app/components/composer-messages.js+++ b/app/assets/javascripts/discourse/app/components/composer-messages.js@@ -8,7 +8,7 @@ import { ajax } from "discourse/lib/ajax";import LinkLookup from "discourse/lib/link-lookup";import { INPUT_DELAY } from "discourse-common/config/environment";import { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _messagesCache = {};@@ -112,8 +112,8 @@ export default class ComposerMessages extends Component {const message = this.composer.store.createRecord("composer-message", {id: "yourself_confirm",templateName: "education",- title: I18n.t("composer.yourself_confirm.title"),- body: I18n.t("composer.yourself_confirm.body"),+ title: i18n("composer.yourself_confirm.title"),+ body: i18n("composer.yourself_confirm.body"),});this.popup(message);@@ -168,7 +168,7 @@ export default class ComposerMessages extends Component {const message = this.composer.store.createRecord("composer-message", {id: "user-not-seen",templateName: "education",- body: I18n.t(body_key, {+ body: i18n(body_key, {usernames: usernames.join(", "),time_ago: response.time_ago,}),diff --git a/app/assets/javascripts/discourse/app/components/composer-save-button.gjs b/app/assets/javascripts/discourse/app/components/composer-save-button.gjsindex eb943f8bc55..67a0133152e 100644--- a/app/assets/javascripts/discourse/app/components/composer-save-button.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-save-button.gjs@@ -2,11 +2,11 @@ import Component from "@glimmer/component";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import { translateModKey } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ComposerSaveButton extends Component {get translatedTitle() {- return I18n.t("composer.title", { modifier: translateModKey("Meta+") });+ return i18n("composer.title", { modifier: translateModKey("Meta+") });}<template>diff --git a/app/assets/javascripts/discourse/app/components/composer-title.js b/app/assets/javascripts/discourse/app/components/composer-title.jsindex b874679c0d3..8117313a497 100644--- a/app/assets/javascripts/discourse/app/components/composer-title.js+++ b/app/assets/javascripts/discourse/app/components/composer-title.js@@ -11,7 +11,7 @@ import putCursorAtEnd from "discourse/lib/put-cursor-at-end";import { isTesting } 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 { i18n } from "discourse-i18n";@classNames("title-input")export default class ComposerTitle extends Component {@@ -68,13 +68,13 @@ export default class ComposerTitle extends Component {return;}if (titleLength < 1) {- reason = I18n.t("composer.error.title_missing");+ reason = i18n("composer.error.title_missing");} else if (missingTitleChars > 0) {- reason = I18n.t("composer.error.title_too_short", {+ reason = i18n("composer.error.title_too_short", {count: minimumTitleLength,});} else if (titleLength > this.siteSettings.max_topic_title_length) {- reason = I18n.t("composer.error.title_too_long", {+ reason = i18n("composer.error.title_too_long", {count: this.siteSettings.max_topic_title_length,});}diff --git a/app/assets/javascripts/discourse/app/components/conditional-loading-section.js b/app/assets/javascripts/discourse/app/components/conditional-loading-section.jsindex 5b2e1e80e3c..de9e508010a 100644--- a/app/assets/javascripts/discourse/app/components/conditional-loading-section.js+++ b/app/assets/javascripts/discourse/app/components/conditional-loading-section.js@@ -1,10 +1,10 @@import Component from "@ember/component";import { classNameBindings, classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("conditional-loading-section")@classNameBindings("isLoading")export default class ConditionalLoadingSection extends Component {isLoading = false;- title = I18n.t("conditional_loading_section.loading");+ title = i18n("conditional_loading_section.loading");}diff --git a/app/assets/javascripts/discourse/app/components/count-i18n.gjs b/app/assets/javascripts/discourse/app/components/count-i18n.gjsindex ca5a2ee98ee..6cfec7b2b80 100644--- a/app/assets/javascripts/discourse/app/components/count-i18n.gjs+++ b/app/assets/javascripts/discourse/app/components/count-i18n.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class CountI18n extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/d-button.gjs b/app/assets/javascripts/discourse/app/components/d-button.gjsindex adf33e825b5..f5756a71d35 100644--- a/app/assets/javascripts/discourse/app/components/d-button.gjs+++ b/app/assets/javascripts/discourse/app/components/d-button.gjs@@ -9,7 +9,7 @@ import GlimmerComponentWithDeprecatedParentView from "discourse/components/glimmimport concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";import deprecated from "discourse-common/lib/deprecated";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const ACTION_AS_STRING_DEPRECATION_ARGS = ["DButton no longer supports @action as a string. Please refactor to use an closure action instead.",@@ -50,21 +50,21 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {get computedTitle() {if (this.args.title) {- return I18n.t(this.args.title);+ return i18n(this.args.title);}return this.args.translatedTitle;}get computedLabel() {if (this.args.label) {- return I18n.t(this.args.label);+ return i18n(this.args.label);}return this.args.translatedLabel;}get computedAriaLabel() {if (this.args.ariaLabel) {- return I18n.t(this.args.ariaLabel);+ return i18n(this.args.ariaLabel);}if (this.args.translatedAriaLabel) {return this.args.translatedAriaLabel;diff --git a/app/assets/javascripts/discourse/app/components/d-document.js b/app/assets/javascripts/discourse/app/components/d-document.jsindex 121cff3b569..672efd8258e 100644--- a/app/assets/javascripts/discourse/app/components/d-document.js+++ b/app/assets/javascripts/discourse/app/components/d-document.js@@ -5,7 +5,7 @@ import { setLogoffCallback } from "discourse/lib/ajax";import { clearAllBodyScrollLocks } from "discourse/lib/body-scroll-lock";import logout from "discourse/lib/logout";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let pluginCounterFunctions = [];export function addPluginDocumentTitleCounter(counterFunction) {@@ -83,7 +83,7 @@ export default class DDocument extends Component {this.messageBus.stop();this.dialog.alert({- message: I18n.t("logout"),+ message: i18n("logout"),confirmButtonLabel: "refresh",didConfirm: () => logout(),didCancel: () => logout(),diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.jsindex 0e1ed221c65..6802f5bdbc8 100644--- a/app/assets/javascripts/discourse/app/components/d-editor.js+++ b/app/assets/javascripts/discourse/app/components/d-editor.js@@ -34,7 +34,7 @@ import deprecated from "discourse-common/lib/deprecated";import { getRegister } from "discourse-common/lib/get-owner";import { findRawTemplate } from "discourse-common/lib/raw-templates";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const FOUR_SPACES_INDENT = "4-spaces-indent";@@ -103,7 +103,7 @@ export default class DEditor extends Component {@discourseComputed("placeholder")placeholderTranslated(placeholder) {if (placeholder) {- return I18n.t(placeholder);+ return i18n(placeholder);}return null;}@@ -463,7 +463,7 @@ export default class DEditor extends Component {}).then((list) => {if (list.length) {- list.push({ label: I18n.t("composer.more_emoji"), term });+ list.push({ label: i18n("composer.more_emoji"), term });}return list;});@@ -515,7 +515,7 @@ export default class DEditor extends Component {} else {const [hval, hlen] = getHead(head);if (sel.start === sel.end) {- sel.value = I18n.t(`composer.${exampleKey}`);+ sel.value = i18n(`composer.${exampleKey}`);}const trimmedPre = sel.pre.trim();@@ -668,7 +668,7 @@ export default class DEditor extends Component {if (!hasNewLine) {if (selValue.length === 0 && isBlankLine) {if (isFourSpacesIndent) {- const example = I18n.t(`composer.code_text`);+ const example = i18n(`composer.code_text`);this.set("value", `${sel.pre} ${example}${sel.post}`);return this.textManipulation.selectText(sel.pre.length + 4,diff --git a/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs b/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjsindex 542df895981..0ca3df95791 100644--- a/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs+++ b/app/assets/javascripts/discourse/app/components/d-toggle-switch.gjs@@ -1,11 +1,11 @@import Component from "@glimmer/component";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class DToggleSwitch extends Component {get computedLabel() {if (this.args.label) {- return I18n.t(this.args.label);+ return i18n(this.args.label);}return this.args.translatedLabel;}diff --git a/app/assets/javascripts/discourse/app/components/date-input.js b/app/assets/javascripts/discourse/app/components/date-input.jsindex 8d6097a622d..6a5ee438384 100644--- a/app/assets/javascripts/discourse/app/components/date-input.js+++ b/app/assets/javascripts/discourse/app/components/date-input.js@@ -7,7 +7,7 @@ import { on } from "@ember-decorators/object";import { Promise } from "rsvp";import loadScript from "discourse/lib/load-script";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function isInputDateSupported() {const input = document.createElement("input");@@ -93,8 +93,8 @@ export default class DateInput extends Component {format: "LL",firstDay: 1,i18n: {- previousMonth: I18n.t("dates.previous_month"),- nextMonth: I18n.t("dates.next_month"),+ previousMonth: i18n("dates.previous_month"),+ nextMonth: i18n("dates.next_month"),months: moment.months(),weekdays: moment.weekdays(),weekdaysShort: moment.weekdaysShort(),@@ -154,7 +154,7 @@ export default class DateInput extends Component {@computed("_placeholder")get placeholder() {- return this._placeholder || I18n.t("dates.placeholder");+ return this._placeholder || i18n("dates.placeholder");}set placeholder(value) {diff --git a/app/assets/javascripts/discourse/app/components/date-picker.js b/app/assets/javascripts/discourse/app/components/date-picker.jsindex efabff113ec..6fdfc4cb3ee 100644--- a/app/assets/javascripts/discourse/app/components/date-picker.js+++ b/app/assets/javascripts/discourse/app/components/date-picker.js@@ -6,7 +6,7 @@ import { classNames } from "@ember-decorators/component";import { on } from "@ember-decorators/object";import loadScript from "discourse/lib/load-script";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DATE_FORMAT = "YYYY-MM-DD";@@ -40,8 +40,8 @@ export default class DatePicker extends Component {format: DATE_FORMAT,firstDay: 1,i18n: {- previousMonth: I18n.t("dates.previous_month"),- nextMonth: I18n.t("dates.next_month"),+ previousMonth: i18n("dates.previous_month"),+ nextMonth: i18n("dates.next_month"),months: moment.months(),weekdays: moment.weekdays(),weekdaysShort: moment.weekdaysMin(),@@ -88,7 +88,7 @@ export default class DatePicker extends Component {@computed("_placeholder")get placeholder() {- return this._placeholder || I18n.t("dates.placeholder");+ return this._placeholder || i18n("dates.placeholder");}set placeholder(value) {diff --git a/app/assets/javascripts/discourse/app/components/desktop-notification-config.gjs b/app/assets/javascripts/discourse/app/components/desktop-notification-config.gjsindex 4219f8355ab..33caf05c62b 100644--- a/app/assets/javascripts/discourse/app/components/desktop-notification-config.gjs+++ b/app/assets/javascripts/discourse/app/components/desktop-notification-config.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { service } from "@ember/service";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class DesktopNotificationsConfig extends Component {@service desktopNotifications;diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/confirm-session.gjs b/app/assets/javascripts/discourse/app/components/dialog-messages/confirm-session.gjsindex afe2718349d..6c7952d951d 100644--- a/app/assets/javascripts/discourse/app/components/dialog-messages/confirm-session.gjs+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/confirm-session.gjs@@ -11,7 +11,7 @@ import {getPasskeyCredential,isWebauthnSupported,} from "discourse/lib/webauthn";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ConfirmSession extends Component {@service dialog;@@ -21,10 +21,10 @@ export default class ConfirmSession extends Component {@tracked errorMessage;@tracked resetEmailSent = null;- passwordLabel = I18n.t("user.password.title");- instructions = I18n.t("user.confirm_access.instructions");- loggedInAs = I18n.t("user.confirm_access.logged_in_as");- finePrint = I18n.t("user.confirm_access.fine_print");+ passwordLabel = i18n("user.password.title");+ instructions = i18n("user.confirm_access.instructions");+ loggedInAs = i18n("user.confirm_access.logged_in_as");+ finePrint = i18n("user.confirm_access.fine_print");get canUsePasskeys() {return (@@ -55,7 +55,7 @@ export default class ConfirmSession extends Component {this.errorMessage = null;this.dialog.didConfirmWrapped();} else {- this.errorMessage = I18n.t("user.confirm_access.incorrect_passkey");+ this.errorMessage = i18n("user.confirm_access.incorrect_passkey");}} catch (e) {popupAjaxError(e);@@ -66,7 +66,7 @@ export default class ConfirmSession extends Component {async submit() {this.errorMessage = this.password? null- : I18n.t("user.confirm_access.incorrect_password");+ : i18n("user.confirm_access.incorrect_password");const result = await ajax("/u/confirm-session.json", {type: "POST",@@ -79,7 +79,7 @@ export default class ConfirmSession extends Component {this.errorMessage = null;this.dialog.didConfirmWrapped();} else {- this.errorMessage = I18n.t("user.confirm_access.incorrect_password");+ this.errorMessage = i18n("user.confirm_access.incorrect_password");}}@@ -93,18 +93,18 @@ export default class ConfirmSession extends Component {if (result.success) {this.errorMessage = null;- this.resetEmailSent = I18n.t(+ this.resetEmailSent = i18n("user.confirm_access.password_reset_email_sent");} else {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.confirm_access.cannot_send_password_reset_email");}} catch (e) {this.errorMessage = extractError(e,- I18n.t("user.confirm_access.cannot_send_password_reset_email")+ i18n("user.confirm_access.cannot_send_password_reset_email"));}}diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.js b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.jsindex 4df12738444..445e955918d 100644--- a/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.js+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.js@@ -2,14 +2,14 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorConfirmPhrase extends Component {@service dialog;@service currentUser;@tracked confirmPhraseInput = "";- disabledString = I18n.t("user.second_factor.disable");+ disabledString = i18n("user.second_factor.disable");@actiononConfirmPhraseInput() {diff --git a/app/assets/javascripts/discourse/app/components/discourse-linked-text.js b/app/assets/javascripts/discourse/app/components/discourse-linked-text.jsindex 9825f4eac15..fe8a94486c0 100644--- a/app/assets/javascripts/discourse/app/components/discourse-linked-text.js+++ b/app/assets/javascripts/discourse/app/components/discourse-linked-text.js@@ -1,14 +1,14 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("span")export default class DiscourseLinkedText extends Component {@discourseComputed("text", "textParams")translatedText(text) {if (text) {- return I18n.t(...arguments);+ return i18n(...arguments);}}diff --git a/app/assets/javascripts/discourse/app/components/discovery/topics.js b/app/assets/javascripts/discourse/app/components/discovery/topics.jsindex a41ca637221..9fdc1a071a2 100644--- a/app/assets/javascripts/discourse/app/components/discovery/topics.js+++ b/app/assets/javascripts/discourse/app/components/discovery/topics.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import { filterTypeForMode } from "discourse/lib/filter-mode";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class DiscoveryTopics extends Component {@service router;@@ -117,21 +117,21 @@ export default class DiscoveryTopics extends Component {const { category, tag } = this.args;if (category) {- return I18n.t("topics.bottom.category", {+ return i18n("topics.bottom.category", {category: category.get("name"),});} else if (tag) {- return I18n.t("topics.bottom.tag", {+ return i18n("topics.bottom.tag", {tag: tag.id,});} else {const split = (this.args.model.get("filter") || "").split("/");if (topicsLength === 0) {- return I18n.t("topics.none." + split[0], {+ return i18n("topics.none." + split[0], {category: split[1],});} else {- return I18n.t("topics.bottom." + split[0], {+ return i18n("topics.bottom." + split[0], {category: split[1],});}@@ -157,7 +157,7 @@ export default class DiscoveryTopics extends Component {tab = "new_new";}- return I18n.t("topics.none.educate." + tab, {+ return i18n("topics.none.educate." + tab, {userPrefsUrl: userPath(`${this.currentUser.get("username_lower")}/preferences/tracking`),diff --git a/app/assets/javascripts/discourse/app/components/edit-category-settings.js b/app/assets/javascripts/discourse/app/components/edit-category-settings.jsindex 09a4333e198..1db502d83ca 100644--- a/app/assets/javascripts/discourse/app/components/edit-category-settings.js+++ b/app/assets/javascripts/discourse/app/components/edit-category-settings.js@@ -4,7 +4,7 @@ import { buildCategoryPanel } from "discourse/components/edit-category-panel";import { setting } from "discourse/lib/computed";import { SEARCH_PRIORITIES } from "discourse/lib/constants";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const categorySortCriteria = [];export function addCategorySortCriteria(criteria) {@@ -29,19 +29,19 @@ export default class EditCategorySettings extends buildCategoryPanel(@discourseComputedavailableSubcategoryListStyles() {return [- { name: I18n.t("category.subcategory_list_styles.rows"), value: "rows" },+ { name: i18n("category.subcategory_list_styles.rows"), value: "rows" },{- name: I18n.t(+ name: i18n("category.subcategory_list_styles.rows_with_featured_topics"),value: "rows_with_featured_topics",},{- name: I18n.t("category.subcategory_list_styles.boxes"),+ name: i18n("category.subcategory_list_styles.boxes"),value: "boxes",},{- name: I18n.t(+ name: i18n("category.subcategory_list_styles.boxes_with_featured_topics"),value: "boxes_with_featured_topics",@@ -52,8 +52,8 @@ export default class EditCategorySettings extends buildCategoryPanel(@discourseComputedavailableViews() {return [- { name: I18n.t("filters.latest.title"), value: "latest" },- { name: I18n.t("filters.top.title"), value: "top" },+ { name: i18n("filters.latest.title"), value: "latest" },+ { name: i18n("filters.top.title"), value: "top" },];}@@ -61,7 +61,7 @@ export default class EditCategorySettings extends buildCategoryPanel(availableTopPeriods() {return ["all", "yearly", "quarterly", "monthly", "weekly", "daily"].map((p) => {- return { name: I18n.t(`filters.top.${p}.title`), value: p };+ return { name: i18n(`filters.top.${p}.title`), value: p };});}@@ -69,7 +69,7 @@ export default class EditCategorySettings extends buildCategoryPanel(@discourseComputedavailableListFilters() {return ["all", "none"].map((p) => {- return { name: I18n.t(`category.list_filters.${p}`), value: p };+ return { name: i18n(`category.list_filters.${p}`), value: p };});}@@ -81,7 +81,7 @@ export default class EditCategorySettings extends buildCategoryPanel(const [name, value] = entry;options.push({- name: I18n.t(`category.search_priority.options.${name}`),+ name: i18n(`category.search_priority.options.${name}`),value,});});@@ -102,7 +102,7 @@ export default class EditCategorySettings extends buildCategoryPanel("created",].concat(categorySortCriteria)- .map((s) => ({ name: I18n.t("category.sort_options." + s), value: s }))+ .map((s) => ({ name: i18n("category.sort_options." + s), value: s })).sort((a, b) => a.name.localeCompare(b.name));}@@ -120,8 +120,8 @@ export default class EditCategorySettings extends buildCategoryPanel(@discourseComputedsortAscendingOptions() {return [- { name: I18n.t("category.sort_ascending"), value: true },- { name: I18n.t("category.sort_descending"), value: false },+ { name: i18n("category.sort_ascending"), value: true },+ { name: i18n("category.sort_descending"), value: false },];}diff --git a/app/assets/javascripts/discourse/app/components/edit-category-tab.js b/app/assets/javascripts/discourse/app/components/edit-category-tab.jsindex c51c65335cb..0073a251a78 100644--- a/app/assets/javascripts/discourse/app/components/edit-category-tab.js+++ b/app/assets/javascripts/discourse/app/components/edit-category-tab.js@@ -8,7 +8,7 @@ import { propertyEqual } from "discourse/lib/computed";import DiscourseURL from "discourse/lib/url";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("li")@classNameBindings("active", "tabClassName")@@ -23,7 +23,7 @@ export default class EditCategoryTab extends Component {@discourseComputed("tab")title(tab) {- return I18n.t(`category.${underscore(tab)}`);+ return i18n(`category.${underscore(tab)}`);}didInsertElement() {diff --git a/app/assets/javascripts/discourse/app/components/edit-topic-timer-form.js b/app/assets/javascripts/discourse/app/components/edit-topic-timer-form.jsindex 68f9dec40d0..51feb782780 100644--- a/app/assets/javascripts/discourse/app/components/edit-topic-timer-form.js+++ b/app/assets/javascripts/discourse/app/components/edit-topic-timer-form.js@@ -18,7 +18,7 @@ import {TIME_SHORTCUT_TYPES,timeShortcuts,} from "discourse/lib/time-shortcut";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { FORMAT } from "select-kit/components/future-date-input-selector";export default class EditTopicTimerForm extends Component {@@ -132,12 +132,12 @@ export default class EditTopicTimerForm extends Component {(new Date() - new Date(this.args.topic.last_posted_at)) /(1000 * 60 * 60));- return I18n.t("topic.auto_close_momentarily", { count: diff });+ return i18n("topic.auto_close_momentarily", { count: diff });}}get durationLabel() {- return I18n.t(+ return i18n(`topic.topic_status_update.num_of_${this.autoDeleteReplies ? "days" : "hours"}`diff --git a/app/assets/javascripts/discourse/app/components/email-dropdown.js b/app/assets/javascripts/discourse/app/components/email-dropdown.jsindex 67cb6115e22..116d6b5855c 100644--- a/app/assets/javascripts/discourse/app/components/email-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/email-dropdown.js@@ -1,7 +1,7 @@import { action, computed } from "@ember/object";import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -21,7 +21,7 @@ export default class EmailDropdown extends DropdownSelectBoxComponent {content.push({id: "updateEmail",icon: "pencil",- name: I18n.t("user.email.update_email"),+ name: i18n("user.email.update_email"),description: "",});}@@ -30,7 +30,7 @@ export default class EmailDropdown extends DropdownSelectBoxComponent {content.push({id: "setPrimaryEmail",icon: "star",- name: I18n.t("user.email.set_primary"),+ name: i18n("user.email.set_primary"),description: "",});}@@ -39,7 +39,7 @@ export default class EmailDropdown extends DropdownSelectBoxComponent {content.push({id: "destroyEmail",icon: "xmark",- name: I18n.t("user.email.destroy"),+ name: i18n("user.email.destroy"),description: "",});}diff --git a/app/assets/javascripts/discourse/app/components/fast-edit.gjs b/app/assets/javascripts/discourse/app/components/fast-edit.gjsindex 8cea3164bf1..c68e8d8e777 100644--- a/app/assets/javascripts/discourse/app/components/fast-edit.gjs+++ b/app/assets/javascripts/discourse/app/components/fast-edit.gjs@@ -9,13 +9,13 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { translateModKey } from "discourse/lib/utilities";import autoFocus from "discourse/modifiers/auto-focus";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FastEdit extends Component {@tracked isSaving = false;@tracked value = this.args.newValue || this.args.initialValue;- buttonTitle = I18n.t("composer.title", {+ buttonTitle = i18n("composer.title", {modifier: translateModKey("Meta+"),});diff --git a/app/assets/javascripts/discourse/app/components/flag-action-type.js b/app/assets/javascripts/discourse/app/components/flag-action-type.jsindex 59ed6ac8135..e01e8360021 100644--- a/app/assets/javascripts/discourse/app/components/flag-action-type.js+++ b/app/assets/javascripts/discourse/app/components/flag-action-type.js@@ -3,7 +3,7 @@ import { and, equal, not } from "@ember/object/computed";import { tagName } from "@ember-decorators/component";import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class FlagActionType extends Component {@@ -19,8 +19,8 @@ export default class FlagActionType extends Component {@discourseComputed("flag.name_key")customPlaceholder(nameKey) {- return I18n.t("flagging.custom_placeholder_" + nameKey, {- defaultValue: I18n.t("flagging.custom_placeholder_notify_moderators"),+ return i18n("flagging.custom_placeholder_" + nameKey, {+ defaultValue: i18n("flagging.custom_placeholder_notify_moderators"),});}@@ -29,7 +29,7 @@ export default class FlagActionType extends Component {if (["notify_user", "notify_moderators"].includes(nameKey)) {return name.replace(/{{username}}|%{username}/, username);} else {- return I18n.t("flagging.formatted_name." + nameKey, {+ return i18n("flagging.formatted_name." + nameKey, {defaultValue: name,});}@@ -57,11 +57,11 @@ export default class FlagActionType extends Component {const len = messageLength || 0;const minLen = this.siteSettings.min_personal_message_post_length;if (len === 0) {- return I18n.t("flagging.custom_message.at_least", { count: minLen });+ return i18n("flagging.custom_message.at_least", { count: minLen });} else if (len < minLen) {- return I18n.t("flagging.custom_message.more", { count: minLen - len });+ return i18n("flagging.custom_message.more", { count: minLen - len });} else {- return I18n.t("flagging.custom_message.left", {+ return i18n("flagging.custom_message.left", {count: MAX_MESSAGE_LENGTH - len,});}diff --git a/app/assets/javascripts/discourse/app/components/flat-button.js b/app/assets/javascripts/discourse/app/components/flat-button.jsindex 9952ba5324b..e77fc44a215 100644--- a/app/assets/javascripts/discourse/app/components/flat-button.js+++ b/app/assets/javascripts/discourse/app/components/flat-button.js@@ -5,7 +5,7 @@ import {tagName,} from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("button")@classNames("btn-flat")@@ -14,7 +14,7 @@ export default class FlatButton extends Component {@discourseComputed("title", "translatedTitle")resolvedTitle(title, translatedTitle) {if (title) {- return I18n.t(title);+ return i18n(title);} else if (translatedTitle) {return translatedTitle;}diff --git a/app/assets/javascripts/discourse/app/components/future-date-input.js b/app/assets/javascripts/discourse/app/components/future-date-input.jsindex a89db34ee38..0e30724f42d 100644--- a/app/assets/javascripts/discourse/app/components/future-date-input.js+++ b/app/assets/javascripts/discourse/app/components/future-date-input.js@@ -9,7 +9,7 @@ import {timeShortcuts,} from "discourse/lib/time-shortcut";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { FORMAT } from "select-kit/components/future-date-input-selector";export default class FutureDateInput extends Component {@@ -36,7 +36,7 @@ export default class FutureDateInput extends Component {super.didReceiveAttrs(...arguments);if (this.label) {- this.set("displayLabel", I18n.t(this.label));+ this.set("displayLabel", i18n(this.label));}if (this.input) {@@ -80,7 +80,7 @@ export default class FutureDateInput extends Component {return shortcuts.map((s) => {return {id: s.id,- name: I18n.t(s.label),+ name: i18n(s.label),time: s.time,timeFormatted: formatTime(s),icon: s.icon,diff --git a/app/assets/javascripts/discourse/app/components/generated-invite-link.gjs b/app/assets/javascripts/discourse/app/components/generated-invite-link.gjsindex 6845c73f0be..b2f8eb913fd 100644--- a/app/assets/javascripts/discourse/app/components/generated-invite-link.gjs+++ b/app/assets/javascripts/discourse/app/components/generated-invite-link.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const GeneratedInviteLink = <template><div>diff --git a/app/assets/javascripts/discourse/app/components/global-notice.js b/app/assets/javascripts/discourse/app/components/global-notice.jsindex 4f526f9aef6..9d0a633ad34 100644--- a/app/assets/javascripts/discourse/app/components/global-notice.js+++ b/app/assets/javascripts/discourse/app/components/global-notice.js@@ -6,7 +6,7 @@ import { tagName } from "@ember-decorators/component";import cookie, { removeCookie } from "discourse/lib/cookie";import { DeferredTrackedSet } from "discourse/lib/tracked-tools";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const _pluginNotices = new DeferredTrackedSet();@@ -87,8 +87,8 @@ export default class GlobalNotice extends Component {notices.push(Notice.create({text: this.siteSettings.login_required- ? I18n.t("forced_anonymous_login_required")- : I18n.t("forced_anonymous"),+ ? i18n("forced_anonymous_login_required")+ : i18n("forced_anonymous"),id: "forced-anonymous",}));@@ -96,21 +96,21 @@ export default class GlobalNotice extends Component {if (this.session.get("safe_mode")) {notices.push(- Notice.create({ text: I18n.t("safe_mode.enabled"), id: "safe-mode" })+ Notice.create({ text: i18n("safe_mode.enabled"), id: "safe-mode" }));}if (this.site.get("isStaffWritesOnly")) {notices.push(Notice.create({- text: I18n.t("staff_writes_only_mode.enabled"),+ text: i18n("staff_writes_only_mode.enabled"),id: "alert-staff-writes-only",}));} else if (this.site.get("isReadOnly")) {notices.push(Notice.create({- text: I18n.t("read_only_mode.enabled"),+ text: i18n("read_only_mode.enabled"),id: "alert-read-only",}));@@ -119,7 +119,7 @@ export default class GlobalNotice extends Component {if (this.router.currentRoute?.queryParams?.preview_theme_id) {notices.push(Notice.create({- text: I18n.t("theme_preview_notice"),+ text: i18n("theme_preview_notice"),id: "theme-preview",}));@@ -128,7 +128,7 @@ export default class GlobalNotice extends Component {if (this.siteSettings.disable_emails === "yes") {notices.push(Notice.create({- text: I18n.t("emails_are_disabled"),+ text: i18n("emails_are_disabled"),id: "alert-emails-disabled",options: {dismissable: true,@@ -139,7 +139,7 @@ export default class GlobalNotice extends Component {} else if (this.siteSettings.disable_emails === "non-staff") {notices.push(Notice.create({- text: I18n.t("emails_are_disabled_non_staff"),+ text: i18n("emails_are_disabled_non_staff"),id: "alert-emails-disabled",options: {dismissable: true,diff --git a/app/assets/javascripts/discourse/app/components/group-activity-filter.gjs b/app/assets/javascripts/discourse/app/components/group-activity-filter.gjsindex 64cb201969b..6870cd5afc6 100644--- a/app/assets/javascripts/discourse/app/components/group-activity-filter.gjs+++ b/app/assets/javascripts/discourse/app/components/group-activity-filter.gjs@@ -1,6 +1,6 @@import { concat, hash } from "@ember/helper";import { LinkTo } from "@ember/routing";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const GroupActivityFilter = <template><li>diff --git a/app/assets/javascripts/discourse/app/components/group-flair-inputs.js b/app/assets/javascripts/discourse/app/components/group-flair-inputs.jsindex ac91f32b62a..d573685fb9c 100644--- a/app/assets/javascripts/discourse/app/components/group-flair-inputs.js+++ b/app/assets/javascripts/discourse/app/components/group-flair-inputs.js@@ -8,7 +8,7 @@ import discourseDebounce from "discourse-common/lib/debounce";import getURL from "discourse-common/lib/get-url";import { convertIconClass } from "discourse-common/lib/icon-library";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("group-flair-inputs")export default class GroupFlairInputs extends Component {@@ -75,7 +75,7 @@ export default class GroupFlairInputs extends Component {@discourseComputed("flairPreviewImage")flairPreviewLabel(flairPreviewImage) {const key = flairPreviewImage ? "image" : "icon";- return I18n.t(`groups.flair_preview_${key}`);+ return i18n(`groups.flair_preview_${key}`);}@actiondiff --git a/app/assets/javascripts/discourse/app/components/group-manage-email-settings.js b/app/assets/javascripts/discourse/app/components/group-manage-email-settings.jsindex 8a569a617c7..499cfd3e048 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-email-settings.js+++ b/app/assets/javascripts/discourse/app/components/group-manage-email-settings.js@@ -5,7 +5,7 @@ import { isEmpty } from "@ember/utils";import { tagName } from "@ember-decorators/component";import { on } from "@ember-decorators/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class GroupManageEmailSettings extends Component {@@ -80,7 +80,7 @@ export default class GroupManageEmailSettings extends Component {this._anySmtpFieldsFilled()) {this.dialog.confirm({- message: I18n.t("groups.manage.email.smtp_disable_confirm"),+ message: i18n("groups.manage.email.smtp_disable_confirm"),didConfirm: () => this.group.set("smtp_enabled", true),didCancel: () => this.group.set("imap_enabled", false),});@@ -97,7 +97,7 @@ export default class GroupManageEmailSettings extends Component {this._anyImapFieldsFilled()) {this.dialog.confirm({- message: I18n.t("groups.manage.email.imap_disable_confirm"),+ message: i18n("groups.manage.email.imap_disable_confirm"),didConfirm: () => this.group.set("imap_enabled", true),});}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.js b/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.jsindex 2bd06a15319..b746e7b0ddc 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.js+++ b/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.js@@ -1,19 +1,17 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class GroupManageLogsFilter extends Component {@discourseComputed("type")label(type) {- return I18n.t(`groups.manage.logs.${type}`);+ return i18n(`groups.manage.logs.${type}`);}@discourseComputed("value", "type")filterText(value, type) {- return type === "action"- ? I18n.t(`group_histories.actions.${value}`)- : value;+ return type === "action" ? i18n(`group_histories.actions.${value}`) : value;}}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-save-button.js b/app/assets/javascripts/discourse/app/components/group-manage-save-button.jsindex 2948207e506..33ed0cfd5ea 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-save-button.js+++ b/app/assets/javascripts/discourse/app/components/group-manage-save-button.js@@ -6,7 +6,7 @@ import GroupDefaultNotificationsModal from "discourse/components/modal/group-defimport { popupAutomaticMembershipAlert } from "discourse/controllers/groups-new";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageSaveButton extends Component {@service modal;@@ -19,7 +19,7 @@ export default class GroupManageSaveButton extends Component {@discourseComputed("saving")savingText(saving) {- return saving ? I18n.t("saving") : I18n.t("save");+ return saving ? i18n("saving") : i18n("save");}@discourseComputed(@@ -33,11 +33,11 @@ export default class GroupManageSaveButton extends Component {}if (isPrimaryGroup) {- return I18n.t("admin.groups.manage.alert.primary_group", {+ return i18n("admin.groups.manage.alert.primary_group", {group_name: this.model.name,});} else if (hasFlair) {- return I18n.t("admin.groups.manage.alert.flair_group", {+ return i18n("admin.groups.manage.alert.flair_group", {group_name: this.model.name,});}diff --git a/app/assets/javascripts/discourse/app/components/group-member-dropdown.js b/app/assets/javascripts/discourse/app/components/group-member-dropdown.jsindex b95d860747c..e235f6d49ef 100644--- a/app/assets/javascripts/discourse/app/components/group-member-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/group-member-dropdown.js@@ -1,6 +1,6 @@import { computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -19,8 +19,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {const items = [{id: "removeMember",- name: I18n.t("groups.members.remove_member"),- description: I18n.t("groups.members.remove_member_description", {+ name: i18n("groups.members.remove_member"),+ description: i18n("groups.members.remove_member_description", {username: this.get("member.username"),}),icon: "user-xmark",@@ -31,8 +31,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {if (this.member.owner) {items.push({id: "removeOwner",- name: I18n.t("groups.members.remove_owner"),- description: I18n.t("groups.members.remove_owner_description", {+ name: i18n("groups.members.remove_owner"),+ description: i18n("groups.members.remove_owner_description", {username: this.get("member.username"),}),icon: "shield-halved",@@ -40,8 +40,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {} else {items.push({id: "makeOwner",- name: I18n.t("groups.members.make_owner"),- description: I18n.t("groups.members.make_owner_description", {+ name: i18n("groups.members.make_owner"),+ description: i18n("groups.members.make_owner_description", {username: this.get("member.username"),}),icon: "shield-halved",@@ -50,8 +50,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {} else if (this.canEditGroup && !this.member.owner) {items.push({id: "makeOwner",- name: I18n.t("groups.members.make_owner"),- description: I18n.t("groups.members.make_owner_description", {+ name: i18n("groups.members.make_owner"),+ description: i18n("groups.members.make_owner_description", {username: this.get("member.username"),}),icon: "shield-halved",@@ -62,8 +62,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {if (this.member.primary) {items.push({id: "removePrimary",- name: I18n.t("groups.members.remove_primary"),- description: I18n.t("groups.members.remove_primary_description", {+ name: i18n("groups.members.remove_primary"),+ description: i18n("groups.members.remove_primary_description", {username: this.get("member.username"),}),icon: "id-card",@@ -71,8 +71,8 @@ export default class GroupMemberDropdown extends DropdownSelectBoxComponent {} else {items.push({id: "makePrimary",- name: I18n.t("groups.members.make_primary"),- description: I18n.t("groups.members.make_primary_description", {+ name: i18n("groups.members.make_primary"),+ description: i18n("groups.members.make_primary_description", {username: this.get("member.username"),}),icon: "id-card",diff --git a/app/assets/javascripts/discourse/app/components/group-membership-button.js b/app/assets/javascripts/discourse/app/components/group-membership-button.jsindex 0b37f0fcc35..6232f89b3e3 100644--- a/app/assets/javascripts/discourse/app/components/group-membership-button.js+++ b/app/assets/javascripts/discourse/app/components/group-membership-button.js@@ -5,7 +5,7 @@ import { classNames } from "@ember-decorators/component";import { popupAjaxError } from "discourse/lib/ajax-error";import cookie from "discourse/lib/cookie";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import RequestGroupMembershipForm from "./modal/request-group-membership-form";@classNames("group-membership-button")@@ -81,7 +81,7 @@ export default class GroupMembershipButton extends Component {this.removeFromGroup();} else {return this.dialog.yesNoConfirm({- message: I18n.t("groups.confirm_leave"),+ message: i18n("groups.confirm_leave"),didConfirm: () => this.removeFromGroup(),didCancel: () => this.set("updatingMembership", false),});diff --git a/app/assets/javascripts/discourse/app/components/group-post.js b/app/assets/javascripts/discourse/app/components/group-post.jsindex ac83d923a56..7a6419f2106 100644--- a/app/assets/javascripts/discourse/app/components/group-post.js+++ b/app/assets/javascripts/discourse/app/components/group-post.js@@ -5,7 +5,7 @@ import { prioritizeNameInUx } from "discourse/lib/settings";import { userPath } from "discourse/lib/url";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNameBindings(":user-stream-item",@@ -44,6 +44,6 @@ export default class GroupPost extends Component {@discourseComputed("post.title", "post.post_number")titleAriaLabel(title, postNumber) {- return I18n.t("groups.aria_post_number", { postNumber, title });+ return i18n("groups.aria_post_number", { postNumber, title });}}diff --git a/app/assets/javascripts/discourse/app/components/group-selector.js b/app/assets/javascripts/discourse/app/components/group-selector.jsindex 2ffab3d181c..e013a38e207 100644--- a/app/assets/javascripts/discourse/app/components/group-selector.js+++ b/app/assets/javascripts/discourse/app/components/group-selector.js@@ -4,12 +4,12 @@ import { observes, on } from "@ember-decorators/object";import $ from "jquery";import { findRawTemplate } from "discourse-common/lib/raw-templates";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupSelector extends Component {@discourseComputed("placeholderKey")placeholder(placeholderKey) {- return placeholderKey ? I18n.t(placeholderKey) : "";+ return placeholderKey ? i18n(placeholderKey) : "";}@observes("groupNames")diff --git a/app/assets/javascripts/discourse/app/components/group-smtp-email-settings.gjs b/app/assets/javascripts/discourse/app/components/group-smtp-email-settings.gjsindex 88ac991302a..faff3a4005c 100644--- a/app/assets/javascripts/discourse/app/components/group-smtp-email-settings.gjs+++ b/app/assets/javascripts/discourse/app/components/group-smtp-email-settings.gjs@@ -12,8 +12,7 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { GROUP_SMTP_SSL_MODES } from "discourse/lib/constants";import emailProviderDefaultSettings from "discourse/lib/email-provider-default-settings";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupSmtpEmailSettings extends Component {@service currentUser;@@ -26,7 +25,7 @@ export default class GroupSmtpEmailSettings extends Component {return Object.keys(GROUP_SMTP_SSL_MODES).map((key) => {return {value: GROUP_SMTP_SSL_MODES[key],- name: I18n.t(`groups.manage.email.ssl_modes.${key}`),+ name: i18n(`groups.manage.email.ssl_modes.${key}`),};});}@@ -94,7 +93,7 @@ export default class GroupSmtpEmailSettings extends Component {this.toasts.success({duration: 3000,- data: { message: I18n.t("groups.manage.email.smtp_settings_valid") },+ data: { message: i18n("groups.manage.email.smtp_settings_valid") },});}).catch(popupAjaxError)diff --git a/app/assets/javascripts/discourse/app/components/groups-form-interaction-fields.js b/app/assets/javascripts/discourse/app/components/groups-form-interaction-fields.jsindex e2c85851959..cdb4a4d95b1 100644--- a/app/assets/javascripts/discourse/app/components/groups-form-interaction-fields.js+++ b/app/assets/javascripts/discourse/app/components/groups-form-interaction-fields.js@@ -2,7 +2,7 @@ import Component from "@ember/component";import { or } from "@ember/object/computed";import { NotificationLevels } from "discourse/lib/notification-levels";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsFormInteractionFields extends Component {@or(@@ -19,36 +19,36 @@ export default class GroupsFormInteractionFields extends Component {visibilityLevelOptions = [{- name: I18n.t("admin.groups.manage.interaction.visibility_levels.public"),+ name: i18n("admin.groups.manage.interaction.visibility_levels.public"),value: 0,},{- name: I18n.t(+ name: i18n("admin.groups.manage.interaction.visibility_levels.logged_on_users"),value: 1,},{- name: I18n.t("admin.groups.manage.interaction.visibility_levels.members"),+ name: i18n("admin.groups.manage.interaction.visibility_levels.members"),value: 2,},{- name: I18n.t("admin.groups.manage.interaction.visibility_levels.staff"),+ name: i18n("admin.groups.manage.interaction.visibility_levels.staff"),value: 3,},{- name: I18n.t("admin.groups.manage.interaction.visibility_levels.owners"),+ name: i18n("admin.groups.manage.interaction.visibility_levels.owners"),value: 4,},];aliasLevelOptions = [- { name: I18n.t("groups.alias_levels.nobody"), value: 0 },- { name: I18n.t("groups.alias_levels.only_admins"), value: 1 },- { name: I18n.t("groups.alias_levels.mods_and_admins"), value: 2 },- { name: I18n.t("groups.alias_levels.members_mods_and_admins"), value: 3 },- { name: I18n.t("groups.alias_levels.owners_mods_and_admins"), value: 4 },- { name: I18n.t("groups.alias_levels.everyone"), value: 99 },+ { name: i18n("groups.alias_levels.nobody"), value: 0 },+ { name: i18n("groups.alias_levels.only_admins"), value: 1 },+ { name: i18n("groups.alias_levels.mods_and_admins"), value: 2 },+ { name: i18n("groups.alias_levels.members_mods_and_admins"), value: 3 },+ { name: i18n("groups.alias_levels.owners_mods_and_admins"), value: 4 },+ { name: i18n("groups.alias_levels.everyone"), value: 99 },];watchingNotificationLevel = NotificationLevels.WATCHING;diff --git a/app/assets/javascripts/discourse/app/components/groups-form-membership-fields.js b/app/assets/javascripts/discourse/app/components/groups-form-membership-fields.jsindex 0c0974f613a..7b6fca0d2b0 100644--- a/app/assets/javascripts/discourse/app/components/groups-form-membership-fields.js+++ b/app/assets/javascripts/discourse/app/components/groups-form-membership-fields.js@@ -3,7 +3,7 @@ import { action, computed } from "@ember/object";import { not, readOnly } from "@ember/object/computed";import AssociatedGroup from "discourse/models/associated-group";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsFormMembershipFields extends Component {tokenSeparator = "|";@@ -13,7 +13,7 @@ export default class GroupsFormMembershipFields extends Component {trustLevelOptions = [{- name: I18n.t("admin.groups.manage.membership.trust_levels_none"),+ name: i18n("admin.groups.manage.membership.trust_levels_none"),value: 0,},{ name: 1, value: 1 },diff --git a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.jsindex 45c05c4b877..570589e9a52 100644--- a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js+++ b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js@@ -7,7 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import Group from "discourse/models/group";import discourseDebounce from "discourse-common/lib/debounce";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsFormProfileFields extends Component {disableSave = null;@@ -43,26 +43,24 @@ export default class GroupsFormProfileFields extends Component {if (this.nameInput === "") {this.set("uniqueNameValidation", null);- return this._failedInputValidation(I18n.t("admin.groups.new.name.blank"));+ return this._failedInputValidation(i18n("admin.groups.new.name.blank"));}if (this.nameInput.length < this.siteSettings.min_username_length) {return this._failedInputValidation(- I18n.t("admin.groups.new.name.too_short")+ i18n("admin.groups.new.name.too_short"));}if (this.nameInput.length > this.siteSettings.max_username_length) {return this._failedInputValidation(- I18n.t("admin.groups.new.name.too_long")+ i18n("admin.groups.new.name.too_long"));}this.checkGroupNameDebounced();- return this._failedInputValidation(- I18n.t("admin.groups.new.name.checking")- );+ return this._failedInputValidation(i18n("admin.groups.new.name.checking"));}checkGroupNameDebounced() {@@ -83,7 +81,7 @@ export default class GroupsFormProfileFields extends Component {validationName,EmberObject.create({ok: true,- reason: I18n.t("admin.groups.new.name.available"),+ reason: i18n("admin.groups.new.name.available"),}));@@ -95,7 +93,7 @@ export default class GroupsFormProfileFields extends Component {if (response.errors) {reason = response.errors.join(" ");} else {- reason = I18n.t("admin.groups.new.name.not_available");+ reason = i18n("admin.groups.new.name.not_available");}this.set(validationName, this._failedInputValidation(reason));diff --git a/app/assets/javascripts/discourse/app/components/header/dropdown.gjs b/app/assets/javascripts/discourse/app/components/header/dropdown.gjsindex 08db5afd0a1..0db137265dc 100644--- a/app/assets/javascripts/discourse/app/components/header/dropdown.gjs+++ b/app/assets/javascripts/discourse/app/components/header/dropdown.gjs@@ -6,7 +6,7 @@ import { and } from "truth-helpers";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import { wantsNewWindow } from "discourse/lib/intercept-click";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import closeOnClickOutside from "../../modifiers/close-on-click-outside";export default class Dropdown extends Component {diff --git a/app/assets/javascripts/discourse/app/components/header/sidebar-toggle.gjs b/app/assets/javascripts/discourse/app/components/header/sidebar-toggle.gjsindex 415cbc14201..fae63755c03 100644--- a/app/assets/javascripts/discourse/app/components/header/sidebar-toggle.gjs+++ b/app/assets/javascripts/discourse/app/components/header/sidebar-toggle.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class SidebarToggle extends Component {@service site;diff --git a/app/assets/javascripts/discourse/app/components/header/topic/info.gjs b/app/assets/javascripts/discourse/app/components/header/topic/info.gjsindex f91fce500d4..683d995eee7 100644--- a/app/assets/javascripts/discourse/app/components/header/topic/info.gjs+++ b/app/assets/javascripts/discourse/app/components/header/topic/info.gjs@@ -11,7 +11,7 @@ import { wantsNewWindow } from "discourse/lib/intercept-click";import renderTags from "discourse/lib/render-tags";import DiscourseURL from "discourse/lib/url";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import PluginOutlet from "../../plugin-outlet";import FeaturedLink from "./featured-link";import Participant from "./participant";diff --git a/app/assets/javascripts/discourse/app/components/header/topic/status.gjs b/app/assets/javascripts/discourse/app/components/header/topic/status.gjsindex 662f135bf12..7ee0971646a 100644--- a/app/assets/javascripts/discourse/app/components/header/topic/status.gjs+++ b/app/assets/javascripts/discourse/app/components/header/topic/status.gjs@@ -6,7 +6,7 @@ import concatClass from "discourse/helpers/concat-class";import TopicStatusIcons from "discourse/helpers/topic-status-icons";import { escapeExpression } from "discourse/lib/utilities";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Status extends Component {@service currentUser;@@ -22,7 +22,7 @@ export default class Status extends Component {const statusIcon = { name, iconArgs };const attributes = {- title: escapeExpression(I18n.t(`topic_statuses.${key}.help`)),+ title: escapeExpression(i18n(`topic_statuses.${key}.help`)),};let klass = ["topic-status"];if (key === "unpinned" || key === "pinned") {diff --git a/app/assets/javascripts/discourse/app/components/header/user-dropdown.gjs b/app/assets/javascripts/discourse/app/components/header/user-dropdown.gjsindex ab005810db4..2fdf1b6d1b4 100644--- a/app/assets/javascripts/discourse/app/components/header/user-dropdown.gjs+++ b/app/assets/javascripts/discourse/app/components/header/user-dropdown.gjs@@ -6,7 +6,7 @@ import { or } from "truth-helpers";import PluginOutlet from "discourse/components/plugin-outlet";import concatClass from "discourse/helpers/concat-class";import { wantsNewWindow } from "discourse/lib/intercept-click";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import Notifications from "./user-dropdown/notifications";export default class UserDropdown extends Component {diff --git a/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs b/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjsindex 67bf36c52d8..3e047d25879 100644--- a/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs+++ b/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs@@ -9,7 +9,7 @@ import {} from "discourse/helpers/user-avatar";import { applyValueTransformer } from "discourse/lib/transformer";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import UserTip from "../../user-tip";import UserStatusBubble from "./user-status-bubble";diff --git a/app/assets/javascripts/discourse/app/components/header/user-dropdown/user-status-bubble.gjs b/app/assets/javascripts/discourse/app/components/header/user-dropdown/user-status-bubble.gjsindex 5398001248a..57477499e1f 100644--- a/app/assets/javascripts/discourse/app/components/header/user-dropdown/user-status-bubble.gjs+++ b/app/assets/javascripts/discourse/app/components/header/user-dropdown/user-status-bubble.gjs@@ -1,7 +1,7 @@import { concat } from "@ember/helper";import emoji from "discourse/helpers/emoji";import escape from "discourse-common/lib/escape";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const title = (description, endsAt, timezone) => {let content = escape(description);@@ -9,9 +9,9 @@ const title = (description, endsAt, timezone) => {if (endsAt) {const until = moment.tz(endsAt, timezone)- .format(I18n.t("dates.long_date_without_year"));+ .format(i18n("dates.long_date_without_year"));- content += `\n${I18n.t("until")} ${until}`;+ content += `\n${i18n("until")} ${until}`;}return content;diff --git a/app/assets/javascripts/discourse/app/components/ignored-user-list.gjs b/app/assets/javascripts/discourse/app/components/ignored-user-list.gjsindex 74e205e8c98..1177b5979a1 100644--- a/app/assets/javascripts/discourse/app/components/ignored-user-list.gjs+++ b/app/assets/javascripts/discourse/app/components/ignored-user-list.gjs@@ -4,7 +4,7 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";import User from "discourse/models/user";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import IgnoredUserListItem from "./ignored-user-list-item";import IgnoreDurationModal from "./modal/ignore-duration-with-username";diff --git a/app/assets/javascripts/discourse/app/components/invite-panel.js b/app/assets/javascripts/discourse/app/components/invite-panel.jsindex 2b8792a79f9..3f2928430da 100644--- a/app/assets/javascripts/discourse/app/components/invite-panel.js+++ b/app/assets/javascripts/discourse/app/components/invite-panel.js@@ -2,12 +2,12 @@ import Component from "@ember/component";import EmberObject, { action } from "@ember/object";import { alias, and, equal, readOnly } from "@ember/object/computed";import { isEmpty } from "@ember/utils";-import { i18n } from "discourse/lib/computed";+import { computedI18n } from "discourse/lib/computed";import { getNativeContact } from "discourse/lib/pwa-utils";import { emailValid } from "discourse/lib/utilities";import Group from "discourse/models/group";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class InvitePanel extends Component {@readOnly("currentUser.staff") isStaff;@@ -23,7 +23,7 @@ export default class InvitePanel extends Component {// scope to allowed usernames@alias("invitingToTopic") allowExistingMembers;- @i18n("invite.custom_message_placeholder") customMessagePlaceholder;+ @computedI18n("invite.custom_message_placeholder") customMessagePlaceholder;groupIds = null;allGroups = null;@@ -217,30 +217,30 @@ export default class InvitePanel extends Component {) {if (!canInviteViaEmail) {// can't invite via email, only existing users- return I18n.t("topic.invite_reply.discourse_connect_enabled");+ return i18n("topic.invite_reply.discourse_connect_enabled");} else if (isPM) {// inviting to a message- return I18n.t("topic.invite_private.email_or_username");+ return i18n("topic.invite_private.email_or_username");} else if (invitingToTopic) {// inviting to a private/public topicif (isPrivateTopic && !isAdmin) {// inviting to a private topic and is not admin- return I18n.t("topic.invite_reply.to_username");+ return i18n("topic.invite_reply.to_username");} else {// when inviting to a topic, display instructions based on provided entityif (isEmpty(invitee)) {- return I18n.t("topic.invite_reply.to_topic_blank");+ return i18n("topic.invite_reply.to_topic_blank");} else if (emailValid(invitee)) {this.set("inviteIcon", "envelope");- return I18n.t("topic.invite_reply.to_topic_email");+ return i18n("topic.invite_reply.to_topic_email");} else {this.set("inviteIcon", "hand-point-right");- return I18n.t("topic.invite_reply.to_topic_username");+ return i18n("topic.invite_reply.to_topic_username");}}} else {// inviting to forum- return I18n.t("topic.invite_reply.to_forum");+ return i18n("topic.invite_reply.to_forum");}}@@ -252,17 +252,17 @@ export default class InvitePanel extends Component {@discourseComputed("isPM", "invitee", "invitingExistingUserToTopic")successMessage(isPM, invitee, invitingExistingUserToTopic) {if (this.isInviteeGroup) {- return I18n.t("topic.invite_private.success_group");+ return i18n("topic.invite_private.success_group");} else if (isPM) {- return I18n.t("topic.invite_private.success");+ return i18n("topic.invite_private.success");} else if (invitingExistingUserToTopic) {- return I18n.t("topic.invite_reply.success_existing_email", {+ return i18n("topic.invite_reply.success_existing_email", {invitee,});} else if (emailValid(invitee)) {- return I18n.t("topic.invite_reply.success_email", { invitee });+ return i18n("topic.invite_reply.success_email", { invitee });} else {- return I18n.t("topic.invite_reply.success_username");+ return i18n("topic.invite_reply.success_username");}}@@ -272,8 +272,8 @@ export default class InvitePanel extends Component {return ajaxError;}return isPM- ? I18n.t("topic.invite_private.error")- : I18n.t("topic.invite_reply.error");+ ? i18n("topic.invite_private.error")+ : i18n("topic.invite_reply.error");}@discourseComputed("canInviteViaEmail")@@ -403,15 +403,9 @@ export default class InvitePanel extends Component {this.toggleProperty("hasCustomMessage");if (this.hasCustomMessage) {if (this.inviteModel === this.currentUser) {- this.set(- "customMessage",- I18n.t("invite.custom_message_template_forum")- );+ this.set("customMessage", i18n("invite.custom_message_template_forum"));} else {- this.set(- "customMessage",- I18n.t("invite.custom_message_template_topic")- );+ this.set("customMessage", i18n("invite.custom_message_template_topic"));}} else {this.set("customMessage", null);diff --git a/app/assets/javascripts/discourse/app/components/local-login-form.js b/app/assets/javascripts/discourse/app/components/local-login-form.jsindex b871b6f8438..138dd0ece0e 100644--- a/app/assets/javascripts/discourse/app/components/local-login-form.js+++ b/app/assets/javascripts/discourse/app/components/local-login-form.js@@ -9,7 +9,7 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { escapeExpression } from "discourse/lib/utilities";import { getWebauthnCredential } from "discourse/lib/webauthn";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class LocalLoginForm extends Component {@service modal;@@ -61,7 +61,7 @@ export default class LocalLoginForm extends Component {}if (isEmpty(this.args.loginName)) {- this.args.flashChanged(I18n.t("login.blank_username"));+ this.args.flashChanged(i18n("login.blank_username"));this.args.flashTypeChanged("info");return;}@@ -80,7 +80,7 @@ export default class LocalLoginForm extends Component {if (data.user_found === false) {this.args.flashChanged(htmlSafe(- I18n.t(`${key}_not_found`, {+ i18n(`${key}_not_found`, {email: loginName,username: loginName,})@@ -91,7 +91,7 @@ export default class LocalLoginForm extends Component {const postfix = data.hide_taken ? "" : "_found";this.args.flashChanged(htmlSafe(- I18n.t(`${key}${postfix}`, {+ i18n(`${key}${postfix}`, {email: loginName,username: loginName,})diff --git a/app/assets/javascripts/discourse/app/components/login-page-cta.gjs b/app/assets/javascripts/discourse/app/components/login-page-cta.gjsindex 659c04e09a0..09283d2df8d 100644--- a/app/assets/javascripts/discourse/app/components/login-page-cta.gjs+++ b/app/assets/javascripts/discourse/app/components/login-page-cta.gjs@@ -1,6 +1,6 @@import DButton from "discourse/components/d-button";import PluginOutlet from "discourse/components/plugin-outlet";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const LoginPageCta = <template><div class="login-page-cta">diff --git a/app/assets/javascripts/discourse/app/components/modal/bookmark.js b/app/assets/javascripts/discourse/app/components/modal/bookmark.jsindex d5bb3234151..0abbf266104 100644--- a/app/assets/javascripts/discourse/app/components/modal/bookmark.js+++ b/app/assets/javascripts/discourse/app/components/modal/bookmark.js@@ -17,7 +17,7 @@ import {import { now, parseCustomDatetime, startOfDay } from "discourse/lib/time-utils";import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const BOOKMARK_BINDINGS = {enter: { handler: "saveAndClose" },@@ -58,14 +58,14 @@ export default class BookmarkModal extends Component {}get modalTitle() {- return I18n.t(this.bookmark.id ? "bookmarks.edit" : "bookmarks.create");+ return i18n(this.bookmark.id ? "bookmarks.edit" : "bookmarks.create");}get autoDeletePreferences() {return Object.keys(AUTO_DELETE_PREFERENCES).map((key) => {return {id: AUTO_DELETE_PREFERENCES[key],- name: I18n.t(`bookmarks.auto_delete_preference.${key.toLowerCase()}`),+ name: i18n(`bookmarks.auto_delete_preference.${key.toLowerCase()}`),};});}@@ -234,7 +234,7 @@ export default class BookmarkModal extends Component {if (this.existingBookmarkHasReminder) {this.dialog.deleteConfirm({- message: I18n.t("bookmarks.confirm_delete"),+ message: i18n("bookmarks.confirm_delete"),didConfirm: () => deleteAction(),});} else {@@ -260,7 +260,7 @@ export default class BookmarkModal extends Component {#saveBookmark() {if (this.bookmark.selectedReminderType === TIME_SHORTCUT_TYPES.CUSTOM) {if (!this.bookmark.reminderAtISO) {- return Promise.reject(I18n.t("bookmarks.invalid_custom_datetime"));+ return Promise.reject(i18n("bookmarks.invalid_custom_datetime"));}}diff --git a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjsindex c224003616e..70c4682978e 100644--- a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs@@ -16,7 +16,7 @@ import { topicLevels } from "discourse/lib/notification-levels";import Category from "discourse/models/category";import Topic from "discourse/models/topic";import autoFocus from "discourse/modifiers/auto-focus";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import CategoryChooser from "select-kit/components/category-chooser";import TagChooser from "select-kit/components/tag-chooser";diff --git a/app/assets/javascripts/discourse/app/components/modal/change-owner.js b/app/assets/javascripts/discourse/app/components/modal/change-owner.jsindex 42e99fccf46..62ca41d60bf 100644--- a/app/assets/javascripts/discourse/app/components/modal/change-owner.js+++ b/app/assets/javascripts/discourse/app/components/modal/change-owner.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { isEmpty } from "@ember/utils";import DiscourseURL from "discourse/lib/url";import Topic from "discourse/models/topic";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChangeOwnerModal extends Component {@tracked saving = false;@@ -44,7 +44,7 @@ export default class ChangeOwnerModal extends Component {}DiscourseURL.routeTo(this.args.model.topic.url);} catch {- this.flash = I18n.t("topic.change_owner.error");+ this.flash = i18n("topic.change_owner.error");this.saving = false;}diff --git a/app/assets/javascripts/discourse/app/components/modal/change-timestamp.js b/app/assets/javascripts/discourse/app/components/modal/change-timestamp.jsindex 308a564fbdc..dafd067309e 100644--- a/app/assets/javascripts/discourse/app/components/modal/change-timestamp.js+++ b/app/assets/javascripts/discourse/app/components/modal/change-timestamp.js@@ -5,7 +5,7 @@ import { next } from "@ember/runloop";import { isEmpty } from "@ember/utils";import DiscourseURL from "discourse/lib/url";import Topic from "discourse/models/topic";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Modal related to changing the timestamp of postsexport default class ChangeTimestamp extends Component {@@ -37,7 +37,7 @@ export default class ChangeTimestamp extends Component {this.args.closeModal();next(() => DiscourseURL.routeTo(this.args.model.topic.url));} catch {- this.flash = I18n.t("topic.change_timestamp.error");+ this.flash = i18n("topic.change_timestamp.error");} finally {this.saving = false;}diff --git a/app/assets/javascripts/discourse/app/components/modal/create-account.js b/app/assets/javascripts/discourse/app/components/modal/create-account.jsindex 5b5dca2cd06..965bfb669ea 100644--- a/app/assets/javascripts/discourse/app/components/modal/create-account.js+++ b/app/assets/javascripts/discourse/app/components/modal/create-account.js@@ -19,7 +19,7 @@ import { findAll } from "discourse/models/login-method";import User from "discourse/models/user";import discourseDebounce from "discourse-common/lib/debounce";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class CreateAccount extends Component.extend(PasswordValidation,@@ -150,7 +150,7 @@ export default class CreateAccount extends Component.extend(@discourseComputeddisclaimerHtml() {if (this.site.tos_url && this.site.privacy_policy_url) {- return I18n.t("create_account.disclaimer", {+ return i18n("create_account.disclaimer", {tos_link: this.site.tos_url,privacy_link: this.site.privacy_policy_url,});@@ -186,8 +186,8 @@ export default class CreateAccount extends Component.extend(if (isEmpty(email)) {return EmberObject.create(Object.assign(failedAttrs, {- message: I18n.t("user.email.required"),- reason: forceValidationReason ? I18n.t("user.email.required") : null,+ message: i18n("user.email.required"),+ reason: forceValidationReason ? i18n("user.email.required") : null,}));}@@ -195,7 +195,7 @@ export default class CreateAccount extends Component.extend(if (rejectedEmails.includes(email) || !emailValid(email)) {return EmberObject.create(Object.assign(failedAttrs, {- reason: I18n.t("user.email.invalid"),+ reason: i18n("user.email.invalid"),}));}@@ -206,7 +206,7 @@ export default class CreateAccount extends Component.extend() {return EmberObject.create({ok: true,- reason: I18n.t("user.email.authenticated", {+ reason: i18n("user.email.authenticated", {provider: this.authProviderDisplayName(this.get("model.authOptions.auth_provider")),@@ -216,7 +216,7 @@ export default class CreateAccount extends Component.extend(return EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),});}@@ -259,7 +259,7 @@ export default class CreateAccount extends Component.extend(serverAccountEmail: this.model.accountEmail,serverEmailValidation: EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),}),});}@@ -408,7 +408,7 @@ export default class CreateAccount extends Component.extend(}return new Promise(() => {}); // This will never resolve, the page will reload instead} else {- this.set("flash", result.message || I18n.t("create_account.failed"));+ this.set("flash", result.message || i18n("create_account.failed"));if (result.is_developer) {this.set("isDeveloper", true);}@@ -434,7 +434,7 @@ export default class CreateAccount extends Component.extend(() => {this.set("formSubmitted", false);removeCookie("destination_url");- return this.set("flash", I18n.t("create_account.failed"));+ return this.set("flash", i18n("create_account.failed"));});}@@ -447,9 +447,9 @@ export default class CreateAccount extends Component.extend(if (!url) {return;}- return I18n.t("create_account.associate", {+ return i18n("create_account.associate", {associate_link: url,- provider: I18n.t(`login.${provider}.name`),+ provider: i18n(`login.${provider}.name`),});}diff --git a/app/assets/javascripts/discourse/app/components/modal/create-invite.gjs b/app/assets/javascripts/discourse/app/components/modal/create-invite.gjsindex e9b6454f26f..f29f6a4f50f 100644--- a/app/assets/javascripts/discourse/app/components/modal/create-invite.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/create-invite.gjs@@ -17,8 +17,7 @@ import { sanitize } from "discourse/lib/text";import { emailValid, hostnameValid } from "discourse/lib/utilities";import Group from "discourse/models/group";import Invite from "discourse/models/invite";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import { FORMAT as DATE_INPUT_FORMAT } from "select-kit/components/future-date-input-selector";import GroupChooser from "select-kit/components/group-chooser";import TopicChooser from "select-kit/components/topic-chooser";@@ -71,13 +70,13 @@ export default class CreateInvite extends Component {.map((days) => {return {value: days,- text: I18n.t("dates.medium.x_days", { count: days }),+ text: i18n("dates.medium.x_days", { count: days }),};});list.push({value: 999999,- text: I18n.t("time_shortcut.never"),+ text: i18n("time_shortcut.never"),});return list;@@ -146,11 +145,11 @@ export default class CreateInvite extends Component {if (!this.simpleMode) {if (this.sendEmail) {this.flashText = sanitize(- I18n.t("user.invited.invite.invite_saved_with_sending_email")+ i18n("user.invited.invite.invite_saved_with_sending_email"));} else {this.flashText = sanitize(- I18n.t("user.invited.invite.invite_saved_without_sending_email")+ i18n("user.invited.invite.invite_saved_without_sending_email"));}this.flashClass = "success";diff --git a/app/assets/javascripts/discourse/app/components/modal/customize-form-template-view.js b/app/assets/javascripts/discourse/app/components/modal/customize-form-template-view.jsindex f2eaa095554..bcf1f7a4e11 100644--- a/app/assets/javascripts/discourse/app/components/modal/customize-form-template-view.js+++ b/app/assets/javascripts/discourse/app/components/modal/customize-form-template-view.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class CustomizeFormTemplateViewModal extends Component {@service router;@@ -27,7 +27,7 @@ export default class CustomizeFormTemplateViewModal extends Component {@actiondeleteTemplate() {return this.dialog.yesNoConfirm({- message: I18n.t("admin.form_templates.delete_confirm", {+ message: i18n("admin.form_templates.delete_confirm", {template_name: this.args.model.name,}),didConfirm: () => {diff --git a/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.js b/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.jsindex d6488195feb..cd6354baa76 100644--- a/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.js+++ b/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.js@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Modal that displays confirmation text when user deletes a topic// The modal will display only if the topic exceeds a certain amount of views@@ -20,7 +20,7 @@ export default class DeleteTopicConfirm extends Component {await this.args.model.topic.destroy(this.currentUser);this.args.closeModal();} catch {- this.flash = I18n.t("post.controls.delete_topic_error");+ this.flash = i18n("post.controls.delete_topic_error");this.deletingTopic = false;}}diff --git a/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs b/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjsindex 2ca560daa87..0134fe7af96 100644--- a/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/discard-draft.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class DiscardDraftModal extends Component {@actiondiff --git a/app/assets/javascripts/discourse/app/components/modal/dismiss-new.gjs b/app/assets/javascripts/discourse/app/components/modal/dismiss-new.gjsindex b19dec06e14..6462d10d54f 100644--- a/app/assets/javascripts/discourse/app/components/modal/dismiss-new.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/dismiss-new.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import PreferenceCheckbox from "discourse/components/preference-checkbox";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const REPLIES_SUBSET = "replies";const TOPICS_SUBSET = "topics";@@ -85,7 +85,7 @@ export default class DismissNew extends Component {}get modalTitle() {- return I18n.t("topics.bulk.dismiss_new_modal.title");+ return i18n("topics.bulk.dismiss_new_modal.title");}@actiondiff --git a/app/assets/javascripts/discourse/app/components/modal/dismiss-read.gjs b/app/assets/javascripts/discourse/app/components/modal/dismiss-read.gjsindex dbee5fb1abf..4db8b494f5a 100644--- a/app/assets/javascripts/discourse/app/components/modal/dismiss-read.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/dismiss-read.gjs@@ -4,7 +4,7 @@ import { fn } from "@ember/helper";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import PreferenceCheckbox from "discourse/components/preference-checkbox";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class DismissRead extends Component {@tracked dismissTopics = false;diff --git a/app/assets/javascripts/discourse/app/components/modal/edit-slow-mode.js b/app/assets/javascripts/discourse/app/components/modal/edit-slow-mode.jsindex 78db5eb784c..413a01725a6 100644--- a/app/assets/javascripts/discourse/app/components/modal/edit-slow-mode.js+++ b/app/assets/javascripts/discourse/app/components/modal/edit-slow-mode.js@@ -6,52 +6,52 @@ import { fromSeconds, toSeconds } from "discourse/helpers/slow-mode";import { extractError } from "discourse/lib/ajax-error";import { timeShortcuts } from "discourse/lib/time-shortcut";import Topic from "discourse/models/topic";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const SLOW_MODE_OPTIONS = [{id: "600",- name: I18n.t("topic.slow_mode_update.durations.10_minutes"),+ name: i18n("topic.slow_mode_update.durations.10_minutes"),},{id: "900",- name: I18n.t("topic.slow_mode_update.durations.15_minutes"),+ name: i18n("topic.slow_mode_update.durations.15_minutes"),},{id: "1800",- name: I18n.t("topic.slow_mode_update.durations.30_minutes"),+ name: i18n("topic.slow_mode_update.durations.30_minutes"),},{id: "2700",- name: I18n.t("topic.slow_mode_update.durations.45_minutes"),+ name: i18n("topic.slow_mode_update.durations.45_minutes"),},{id: "3600",- name: I18n.t("topic.slow_mode_update.durations.1_hour"),+ name: i18n("topic.slow_mode_update.durations.1_hour"),},{id: "7200",- name: I18n.t("topic.slow_mode_update.durations.2_hours"),+ name: i18n("topic.slow_mode_update.durations.2_hours"),},{id: "14400",- name: I18n.t("topic.slow_mode_update.durations.4_hours"),+ name: i18n("topic.slow_mode_update.durations.4_hours"),},{id: "28800",- name: I18n.t("topic.slow_mode_update.durations.8_hours"),+ name: i18n("topic.slow_mode_update.durations.8_hours"),},{id: "43200",- name: I18n.t("topic.slow_mode_update.durations.12_hours"),+ name: i18n("topic.slow_mode_update.durations.12_hours"),},{id: "86400",- name: I18n.t("topic.slow_mode_update.durations.24_hours"),+ name: i18n("topic.slow_mode_update.durations.24_hours"),},{id: "custom",- name: I18n.t("topic.slow_mode_update.durations.custom"),+ name: i18n("topic.slow_mode_update.durations.custom"),},];@@ -141,7 +141,7 @@ export default class EditSlowMode extends Component {this.args.model.topic.set("slow_mode_seconds", seconds);this.args.closeModal();} catch {- this.flash = I18n.t("generic_error");+ this.flash = i18n("generic_error");} finally {this.saveDisabled = false;}diff --git a/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.js b/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.jsindex 918f0b1786c..fcc8275a996 100644--- a/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.js+++ b/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.js@@ -6,7 +6,7 @@ import { service } from "@ember/service";import { TrackedObject } from "@ember-compat/tracked-built-ins";import { popupAjaxError } from "discourse/lib/ajax-error";import TopicTimer from "discourse/models/topic-timer";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { FORMAT } from "select-kit/components/future-date-input-selector";export const CLOSE_STATUS_TYPE = "close";@@ -49,51 +49,51 @@ export default class EditTopicTimer extends Component {if (!closed) {types.push({id: CLOSE_STATUS_TYPE,- name: I18n.t("topic.auto_close.title"),+ name: i18n("topic.auto_close.title"),});types.push({id: CLOSE_AFTER_LAST_POST_STATUS_TYPE,- name: I18n.t("topic.auto_close_after_last_post.title"),+ name: i18n("topic.auto_close_after_last_post.title"),});}if (closed) {types.push({id: OPEN_STATUS_TYPE,- name: I18n.t("topic.auto_reopen.title"),+ name: i18n("topic.auto_reopen.title"),});}if (this.args.model.topic.details.can_delete) {types.push({id: DELETE_STATUS_TYPE,- name: I18n.t("topic.auto_delete.title"),+ name: i18n("topic.auto_delete.title"),});}types.push({id: BUMP_TYPE,- name: I18n.t("topic.auto_bump.title"),+ name: i18n("topic.auto_bump.title"),});if (this.args.model.topic.details.can_delete) {types.push({id: DELETE_REPLIES_TYPE,- name: I18n.t("topic.auto_delete_replies.title"),+ name: i18n("topic.auto_delete_replies.title"),});}if (closed) {types.push({id: CLOSE_STATUS_TYPE,- name: I18n.t("topic.temp_open.title"),+ name: i18n("topic.temp_open.title"),});}if (!closed) {types.push({id: OPEN_STATUS_TYPE,- name: I18n.t("topic.temp_close.title"),+ name: i18n("topic.temp_close.title"),});}@@ -104,7 +104,7 @@ export default class EditTopicTimer extends Component {) {types.push({id: PUBLISH_TO_CATEGORY_STATUS_TYPE,- name: I18n.t("topic.publish_to_category.title"),+ name: i18n("topic.publish_to_category.title"),});}@@ -184,19 +184,19 @@ export default class EditTopicTimer extends Component {this.flash = null;if (!this.topicTimer.updateTime && !this.topicTimer.duration_minutes) {- this.flash = I18n.t("topic.topic_status_update.time_frame_required");+ this.flash = i18n("topic.topic_status_update.time_frame_required");return;}if (this.topicTimer.duration_minutes && !this.topicTimer.updateTime) {if (this.topicTimer.duration_minutes <= 0) {- this.flash = I18n.t("topic.topic_status_update.min_duration");+ this.flash = i18n("topic.topic_status_update.min_duration");return;}// cannot be more than 20 yearsif (this.topicTimer.duration_minutes > 20 * 365 * 1440) {- this.flash = I18n.t("topic.topic_status_update.max_duration");+ this.flash = i18n("topic.topic_status_update.max_duration");return;}}diff --git a/app/assets/javascripts/discourse/app/components/modal/feature-topic.js b/app/assets/javascripts/discourse/app/components/modal/feature-topic.jsindex 726c03724fe..2a45c36987a 100644--- a/app/assets/javascripts/discourse/app/components/modal/feature-topic.js+++ b/app/assets/javascripts/discourse/app/components/modal/feature-topic.js@@ -4,7 +4,7 @@ import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";import { categoryLinkHTML } from "discourse/helpers/category-link";import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FeatureTopic extends Component {@service currentUser;@@ -37,7 +37,7 @@ export default class FeatureTopic extends Component {name += "_until";}const until = moment(this.args.model.topic.pinned_until).format("LL");- return I18n.t(name, { categoryLink: this.categoryLink, until });+ return i18n(name, { categoryLink: this.categoryLink, until });}get canPinGlobally() {@@ -48,7 +48,7 @@ export default class FeatureTopic extends Component {}get pinMessage() {- return I18n.t("topic.feature_topic.pin", {+ return i18n("topic.feature_topic.pin", {categoryLink: this.categoryLink,});}@@ -58,7 +58,7 @@ export default class FeatureTopic extends Component {this.pinnedInCategoryCount === 0? "topic.feature_topic.not_pinned": "topic.feature_topic.already_pinned";- return I18n.t(key, {+ return i18n(key, {categoryLink: this.categoryLink,count: this.pinnedInCategoryCount,});@@ -84,7 +84,7 @@ export default class FeatureTopic extends Component {if (this.pinDisabled) {return EmberObject.create({failed: true,- reason: I18n.t("topic.feature_topic.pin_validation"),+ reason: i18n("topic.feature_topic.pin_validation"),});}}@@ -93,7 +93,7 @@ export default class FeatureTopic extends Component {if (this.pinGloballyDisabled) {return EmberObject.create({failed: true,- reason: I18n.t("topic.feature_topic.pin_validation"),+ reason: i18n("topic.feature_topic.pin_validation"),});}}@@ -130,7 +130,7 @@ export default class FeatureTopic extends Component {this.args.closeModal();} else {this.dialog.yesNoConfirm({- message: I18n.t("topic.feature_topic.confirm_pin_globally", {+ message: i18n("topic.feature_topic.confirm_pin_globally", {count: this.pinnedGloballyCount,}),didConfirm: () => {diff --git a/app/assets/javascripts/discourse/app/components/modal/flag.js b/app/assets/javascripts/discourse/app/components/modal/flag.jsindex 7e4a93d1187..323defc188d 100644--- a/app/assets/javascripts/discourse/app/components/modal/flag.js+++ b/app/assets/javascripts/discourse/app/components/modal/flag.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { reload } from "discourse/helpers/page-reloader";import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";import User from "discourse/models/user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const NOTIFY_MODERATORS_KEY = "notify_moderators";@@ -34,26 +34,26 @@ export default class Flag extends Component {get flagActions() {return {icon: "gavel",- label: I18n.t("flagging.take_action"),+ label: i18n("flagging.take_action"),actions: [{id: "agree_and_hide",icon: "thumbs-up",- label: I18n.t("flagging.take_action_options.default.title"),- description: I18n.t("flagging.take_action_options.default.details"),+ label: i18n("flagging.take_action_options.default.title"),+ description: i18n("flagging.take_action_options.default.details"),},{id: "agree_and_suspend",icon: "ban",- label: I18n.t("flagging.take_action_options.suspend.title"),- description: I18n.t("flagging.take_action_options.suspend.details"),+ label: i18n("flagging.take_action_options.suspend.title"),+ description: i18n("flagging.take_action_options.suspend.details"),client_action: "suspend",},{id: "agree_and_silence",icon: "microphone-slash",- label: I18n.t("flagging.take_action_options.silence.title"),- description: I18n.t("flagging.take_action_options.silence.details"),+ label: i18n("flagging.take_action_options.silence.title"),+ description: i18n("flagging.take_action_options.silence.details"),client_action: "silence",},],diff --git a/app/assets/javascripts/discourse/app/components/modal/forgot-password.js b/app/assets/javascripts/discourse/app/components/modal/forgot-password.jsindex f616aef2874..c00cf258933 100644--- a/app/assets/javascripts/discourse/app/components/modal/forgot-password.js+++ b/app/assets/javascripts/discourse/app/components/modal/forgot-password.js@@ -9,7 +9,7 @@ import { extractError } from "discourse/lib/ajax-error";import cookie from "discourse/lib/cookie";import { escapeExpression } from "discourse/lib/utilities";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ForgotPassword extends Component {@service siteSettings;@@ -38,7 +38,7 @@ export default class ForgotPassword extends Component {@actionhelp() {- this.offerHelp = I18n.t("forgot_password.help", { basePath: getURL("") });+ this.offerHelp = i18n("forgot_password.help", { basePath: getURL("") });this.helpSeen = true;}@@ -66,7 +66,7 @@ export default class ForgotPassword extends Component {key += "_not_found";this.flash = htmlSafe(- I18n.t(key, {+ i18n(key, {email: emailOrUsername,username: emailOrUsername,})@@ -75,7 +75,7 @@ export default class ForgotPassword extends Component {key += data.user_found ? "_found" : "";this.emailOrUsername = "";- this.offerHelp = I18n.t(key, {+ this.offerHelp = i18n(key, {email: emailOrUsername,username: emailOrUsername,});diff --git a/app/assets/javascripts/discourse/app/components/modal/grant-badge.js b/app/assets/javascripts/discourse/app/components/modal/grant-badge.jsindex 776034dd73e..fca5bc76774 100644--- a/app/assets/javascripts/discourse/app/components/modal/grant-badge.js+++ b/app/assets/javascripts/discourse/app/components/modal/grant-badge.js@@ -9,7 +9,7 @@ import {import Badge from "discourse/models/badge";import UserBadge from "discourse/models/user-badge";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GrantBadgeModal extends Component {@tracked loading = true;@@ -67,7 +67,7 @@ export default class GrantBadgeModal extends Component {this.userBadges.pushObject(newBadge);this.#updateAvailableBadges();this.selectedBadgeId = null;- this.flash = I18n.t("badges.successfully_granted", {+ this.flash = i18n("badges.successfully_granted", {username,badge: newBadge.get("badge.name"),});diff --git a/app/assets/javascripts/discourse/app/components/modal/group-add-members.js b/app/assets/javascripts/discourse/app/components/modal/group-add-members.jsindex 21bb9734fa5..f49c5ff9416 100644--- a/app/assets/javascripts/discourse/app/components/modal/group-add-members.js+++ b/app/assets/javascripts/discourse/app/components/modal/group-add-members.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import { extractError } from "discourse/lib/ajax-error";import { emailValid } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupAddMembers extends Component {@service currentUser;@@ -18,7 +18,7 @@ export default class GroupAddMembers extends Component {@tracked flash;get title() {- return I18n.t("groups.add_members.title", {+ return i18n("groups.add_members.title", {group_name: this.args.model.fullName || this.args.model.name,});}diff --git a/app/assets/javascripts/discourse/app/components/modal/history.js b/app/assets/javascripts/discourse/app/components/modal/history.jsindex 5698b96cf39..a7aa1930094 100644--- a/app/assets/javascripts/discourse/app/components/modal/history.js+++ b/app/assets/javascripts/discourse/app/components/modal/history.js@@ -7,7 +7,7 @@ import { sanitizeAsync } from "discourse/lib/text";import Category from "discourse/models/category";import Post from "discourse/models/post";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function customTagArray(val) {if (!val) {@@ -85,7 +85,7 @@ export default class History extends Component {}get revisionsText() {- return I18n.t(+ return i18n("post.revisions.controls.comparing_previous_to_current_out_of_total",{previous: this.previousVersion,@@ -164,7 +164,7 @@ export default class History extends Component {get revertToRevisionText() {if (this.previousVersion) {- return I18n.t("post.revisions.controls.revert", {+ return i18n("post.revisions.controls.revert", {revision: this.previousVersion,});}@@ -330,7 +330,7 @@ export default class History extends Component {@actionpermanentlyDeleteVersions() {this.dialog.yesNoConfirm({- message: I18n.t("post.revisions.controls.destroy_confirm"),+ message: i18n("post.revisions.controls.destroy_confirm"),didConfirm: () => {Post.permanentlyDeleteRevisions(this.postRevision.post_id).then(() => {this.args.closeModal();diff --git a/app/assets/javascripts/discourse/app/components/modal/ignore-duration-with-username.js b/app/assets/javascripts/discourse/app/components/modal/ignore-duration-with-username.jsindex 27f6cbae0a2..68d96113a03 100644--- a/app/assets/javascripts/discourse/app/components/modal/ignore-duration-with-username.js+++ b/app/assets/javascripts/discourse/app/components/modal/ignore-duration-with-username.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import { timeShortcuts } from "discourse/lib/time-shortcut";import User from "discourse/models/user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class IgnoreDurationModal extends Component {@service currentUser;@@ -41,7 +41,7 @@ export default class IgnoreDurationModal extends Component {@actionignore() {if (!this.ignoredUntil || !this.ignoredUsername) {- this.flash = I18n.t(+ this.flash = i18n("user.user_notifications.ignore_duration_time_frame_required");return;diff --git a/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.js b/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.jsindex 51db4b6e4fc..776000c6ca9 100644--- a/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.js+++ b/app/assets/javascripts/discourse/app/components/modal/keyboard-shortcuts-help.js@@ -2,17 +2,17 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import { extraKeyboardShortcutsHelp } from "discourse/lib/keyboard-shortcuts";import { translateModKey } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const KEY = "keyboard_shortcuts_help";-const SHIFT = I18n.t("shortcut_modifier_key.shift");+const SHIFT = i18n("shortcut_modifier_key.shift");const ALT = translateModKey("Alt");const META = translateModKey("Meta");-const CTRL = I18n.t("shortcut_modifier_key.ctrl");-const ENTER = I18n.t("shortcut_modifier_key.enter");+const CTRL = i18n("shortcut_modifier_key.ctrl");+const ENTER = i18n("shortcut_modifier_key.enter");-const COMMA = I18n.t(`${KEY}.shortcut_key_delimiter_comma`);-const PLUS = I18n.t(`${KEY}.shortcut_key_delimiter_plus`);+const COMMA = i18n(`${KEY}.shortcut_key_delimiter_comma`);+const PLUS = i18n(`${KEY}.shortcut_key_delimiter_plus`);const translationForExtraShortcuts = {shift: SHIFT,@@ -39,17 +39,17 @@ function buildHTML(keys1, keys2, keysDelimiter, shortcutsDelimiter) {if (allKeys.length === 1) {return shortcut1;} else if (shortcutsDelimiter === "or") {- return I18n.t(`${KEY}.shortcut_delimiter_or`, { shortcut1, shortcut2 });+ return i18n(`${KEY}.shortcut_delimiter_or`, { shortcut1, shortcut2 });} else if (shortcutsDelimiter === "slash") {- return I18n.t(`${KEY}.shortcut_delimiter_slash`, { shortcut1, shortcut2 });+ return i18n(`${KEY}.shortcut_delimiter_slash`, { shortcut1, shortcut2 });} else if (shortcutsDelimiter === "space") {return wrapInSpan(- I18n.t(`${KEY}.shortcut_delimiter_space`, { shortcut1, shortcut2 }),+ i18n(`${KEY}.shortcut_delimiter_space`, { shortcut1, shortcut2 }),shortcutsDelimiter);} else if (shortcutsDelimiter === "newline") {return wrapInSpan(- I18n.t(`${KEY}.shortcut_delimiter_newline`, {+ i18n(`${KEY}.shortcut_delimiter_newline`, {shortcut1,shortcut2,}),@@ -69,7 +69,7 @@ function buildShortcut(const context = {shortcut: buildHTML(keys1, keys2, keysDelimiter, shortcutsDelimiter),};- return I18n.t(`${KEY}.${key}`, context);+ return i18n(`${KEY}.${key}`, context);}export default class KeyboardShortcutsHelp extends Component {diff --git a/app/assets/javascripts/discourse/app/components/modal/login.js b/app/assets/javascripts/discourse/app/components/modal/login.jsindex 870c2c7f033..bf8889b103f 100644--- a/app/assets/javascripts/discourse/app/components/modal/login.js+++ b/app/assets/javascripts/discourse/app/components/modal/login.js@@ -18,7 +18,7 @@ import { findAll } from "discourse/models/login-method";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import escape from "discourse-common/lib/escape";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ForgotPassword from "./forgot-password";export default class Login extends Component {@@ -191,7 +191,7 @@ export default class Login extends Component {}if (isEmpty(this.loginName) || isEmpty(this.loginPassword)) {- this.flash = I18n.t("login.blank_username_or_password");+ this.flash = i18n("login.blank_username_or_password");this.flashType = "error";return;}@@ -252,7 +252,7 @@ export default class Login extends Component {this.dialog.alert(result.error);} else if (result.reason === "expired") {this.flash = htmlSafe(- I18n.t("login.password_expired", {+ i18n("login.password_expired", {reset_url: getURL("/password-reset"),}));@@ -310,20 +310,20 @@ export default class Login extends Component {} catch (e) {// Failed to loginif (e.jqXHR && e.jqXHR.status === 429) {- this.flash = I18n.t("login.rate_limit");+ this.flash = i18n("login.rate_limit");this.flashType = "error";} else if (e.jqXHR &&e.jqXHR.status === 503 &&e.jqXHR.responseJSON.error_type === "read_only") {- this.flash = I18n.t("read_only_mode.login_disabled");+ this.flash = i18n("read_only_mode.login_disabled");this.flashType = "error";} else if (!areCookiesEnabled()) {- this.flash = I18n.t("login.cookies_error");+ this.flash = i18n("login.cookies_error");this.flashType = "error";} else {- this.flash = I18n.t("login.error");+ this.flash = i18n("login.error");this.flashType = "error";}this.loggingIn = false;diff --git a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.jsindex e8be2ca0637..419048cbf7c 100644--- a/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js+++ b/app/assets/javascripts/discourse/app/components/modal/move-to-topic.js@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import DiscourseURL from "discourse/lib/url";import { mergeTopic, movePosts } from "discourse/models/topic";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class MoveToTopic extends Component {@service currentUser;@@ -157,7 +157,7 @@ export default class MoveToTopic extends Component {this.args.model.toggleMultiSelect();DiscourseURL.routeTo(result.url);} catch {- this.flash = I18n.t("topic.move_to.error");+ this.flash = i18n("topic.move_to.error");} finally {this.saving = false;}diff --git a/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.js b/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.jsindex 12a5df92e0e..135b4e840cc 100644--- a/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.js+++ b/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.js@@ -4,14 +4,14 @@ import { action } from "@ember/object";import { isEmpty } from "@ember/utils";import { popupAjaxError } from "discourse/lib/ajax-error";import DiscourseURL from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class RequestGroupMembershipForm extends Component {@tracked loading = false;@tracked reason = this.args.model.group.membership_request_template;get title() {- return I18n.t("groups.membership_request.title", {+ return i18n("groups.membership_request.title", {group_name: this.args.model.group.name,});}diff --git a/app/assets/javascripts/discourse/app/components/modal/revise-and-reject-post-reviewable.js b/app/assets/javascripts/discourse/app/components/modal/revise-and-reject-post-reviewable.jsindex cb5c2389c03..809d305c3d6 100644--- a/app/assets/javascripts/discourse/app/components/modal/revise-and-reject-post-reviewable.js+++ b/app/assets/javascripts/discourse/app/components/modal/revise-and-reject-post-reviewable.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const OTHER_REASON = "other_reason";@@ -24,7 +24,7 @@ export default class ReviseAndRejectPostReviewable extends Component {.concat([{id: OTHER_REASON,- name: I18n.t("review.revise_and_reject_post.other_reason"),+ name: i18n("review.revise_and_reject_post.other_reason"),},]);return reasons;diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.js b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.jsindex 0b99b9317ac..0db28dd8db6 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.js+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.js@@ -8,7 +8,7 @@ import {stringToBuffer,} from "discourse/lib/webauthn";import { MAX_SECOND_FACTOR_NAME_LENGTH } from "discourse/models/user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorAddSecurityKey extends Component {@service capabilities;@@ -33,7 +33,7 @@ export default class SecondFactorAddSecurityKey extends Component {} else {key = "user.second_factor.security_key.default_name";}- this.securityKeyName = I18n.t(key);+ this.securityKeyName = i18n(key);this.loading = true;this.args.model.secondFactor@@ -46,7 +46,7 @@ export default class SecondFactorAddSecurityKey extends Component {this.errorMessage = isWebauthnSupported()? null- : I18n.t("login.security_key_support_missing_error");+ : i18n("login.security_key_support_missing_error");this.loading = false;this.challenge = response.challenge;this.relayingParty = {@@ -68,7 +68,7 @@ export default class SecondFactorAddSecurityKey extends Component {@actionregisterSecurityKey() {if (!this.securityKeyName) {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.second_factor.security_key.name_required_error");return;@@ -139,13 +139,13 @@ export default class SecondFactorAddSecurityKey extends Component {},(err) => {if (err.name === "InvalidStateError") {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.second_factor.security_key.already_added_error");return;}if (err.name === "NotAllowedError") {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.second_factor.security_key.not_allowed_error");return;diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.js b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.jsindex c1a3f196631..d46ed97be63 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.js+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.js@@ -5,7 +5,7 @@ import {MAX_SECOND_FACTOR_NAME_LENGTH,SECOND_FACTOR_METHODS,} from "discourse/models/user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorAddTotp extends Component {@tracked loading = false;@@ -49,7 +49,7 @@ export default class SecondFactorAddTotp extends Component {@actionenableSecondFactor() {if (!this.secondFactorToken || !this.secondFactorName) {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.second_factor.totp.name_and_code_required_error");return;diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.js b/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.jsindex a6137160890..bacfc491cf7 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.js+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.js@@ -3,7 +3,7 @@ import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorBackupEdit extends Component {@tracked loading = false;@@ -20,11 +20,11 @@ export default class SecondFactorBackupEdit extends Component {@actioncopyBackupCode(successful) {if (successful) {- this.successMessage = I18n.t(+ this.successMessage = i18n("user.second_factor_backup.copied_to_clipboard");} else {- this.errorMessage = I18n.t(+ this.errorMessage = i18n("user.second_factor_backup.copy_to_clipboard_error");}diff --git a/app/assets/javascripts/discourse/app/components/modal/share-topic.js b/app/assets/javascripts/discourse/app/components/modal/share-topic.jsindex 45cd627b9a0..9722d13eb59 100644--- a/app/assets/javascripts/discourse/app/components/modal/share-topic.js+++ b/app/assets/javascripts/discourse/app/components/modal/share-topic.js@@ -12,7 +12,7 @@ import { getAbsoluteURL } from "discourse-common/lib/get-url";import discourseComputed, {afterRender,} from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ShareTopicModal extends Component.extend(bufferedProperty("invite")@@ -39,7 +39,7 @@ export default class ShareTopicModal extends Component.extend(Category.fetchVisibleGroups(this.category.id).then((result) => {if (result.groups.length > 0) {this.setProperties({- flash: I18n.t("topic.share.restricted_groups", {+ flash: i18n("topic.share.restricted_groups", {count: result.groups.length,groupNames: result.groups.join(", "),}),diff --git a/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.js b/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.jsindex 9bdb22e6f75..69c4dad069c 100644--- a/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.js+++ b/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.js@@ -9,7 +9,7 @@ import { extractError } from "discourse/lib/ajax-error";import { SIDEBAR_SECTION, SIDEBAR_URL } from "discourse/lib/constants";import { sanitize } from "discourse/lib/text";import { afterRender, bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";class Section {@tracked title;@@ -52,10 +52,10 @@ class Section {return;}if (this.#blankTitle) {- return I18n.t("sidebar.sections.custom.title.validation.blank");+ return i18n("sidebar.sections.custom.title.validation.blank");}if (this.#tooLongTitle) {- return I18n.t("sidebar.sections.custom.title.validation.maximum", {+ return i18n("sidebar.sections.custom.title.validation.maximum", {count: SIDEBAR_SECTION.max_title_length,});}@@ -114,10 +114,10 @@ class SectionLink {get invalidIconMessage() {if (this.#blankIcon) {- return I18n.t("sidebar.sections.custom.links.icon.validation.blank");+ return i18n("sidebar.sections.custom.links.icon.validation.blank");}if (this.#tooLongIcon) {- return I18n.t("sidebar.sections.custom.links.icon.validation.maximum", {+ return i18n("sidebar.sections.custom.links.icon.validation.maximum", {count: SIDEBAR_URL.max_icon_length,});}@@ -128,10 +128,10 @@ class SectionLink {return;}if (this.#blankName) {- return I18n.t("sidebar.sections.custom.links.name.validation.blank");+ return i18n("sidebar.sections.custom.links.name.validation.blank");}if (this.#tooLongName) {- return I18n.t("sidebar.sections.custom.links.name.validation.maximum", {+ return i18n("sidebar.sections.custom.links.name.validation.maximum", {count: SIDEBAR_URL.max_name_length,});}@@ -142,15 +142,15 @@ class SectionLink {return;}if (this.#blankValue) {- return I18n.t("sidebar.sections.custom.links.value.validation.blank");+ return i18n("sidebar.sections.custom.links.value.validation.blank");}if (this.#tooLongValue) {- return I18n.t("sidebar.sections.custom.links.value.validation.maximum", {+ return i18n("sidebar.sections.custom.links.value.validation.maximum", {count: SIDEBAR_URL.max_value_length,});}if (this.#invalidValue) {- return I18n.t("sidebar.sections.custom.links.value.validation.invalid");+ return i18n("sidebar.sections.custom.links.value.validation.invalid");}}@@ -306,8 +306,8 @@ export default class SidebarSectionForm extends Component {#updateWithConfirm() {return this.dialog.yesNoConfirm({message: this.isPublic- ? I18n.t("sidebar.sections.custom.update_public_confirm")- : I18n.t("sidebar.sections.custom.mark_as_private_confirm"),+ ? i18n("sidebar.sections.custom.update_public_confirm")+ : i18n("sidebar.sections.custom.mark_as_private_confirm"),didConfirm: () => {return this.#updateCall();},@@ -468,7 +468,7 @@ export default class SidebarSectionForm extends Component {@actionresetToDefault() {return this.dialog.yesNoConfirm({- message: I18n.t("sidebar.sections.custom.reset_confirm"),+ message: i18n("sidebar.sections.custom.reset_confirm"),didConfirm: () => {return ajax(`/sidebar_sections/reset/${this.transformedModel.id}`, {type: "PUT",@@ -500,8 +500,8 @@ export default class SidebarSectionForm extends Component {delete() {return this.dialog.yesNoConfirm({message: this.model.section.public- ? I18n.t("sidebar.sections.custom.delete_public_confirm")- : I18n.t("sidebar.sections.custom.delete_confirm"),+ ? i18n("sidebar.sections.custom.delete_public_confirm")+ : i18n("sidebar.sections.custom.delete_confirm"),didConfirm: () => {return ajax(`/sidebar_sections/${this.transformedModel.id}`, {type: "DELETE",diff --git a/app/assets/javascripts/discourse/app/components/modal/spreadsheet-editor.gjs b/app/assets/javascripts/discourse/app/components/modal/spreadsheet-editor.gjsindex 0db20081c97..2c19e54241c 100644--- a/app/assets/javascripts/discourse/app/components/modal/spreadsheet-editor.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/spreadsheet-editor.gjs@@ -16,8 +16,7 @@ import {findTableRegex,tokenRange,} from "discourse/lib/utilities";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DTooltip from "float-kit/components/d-tooltip";export default class SpreadsheetEditor extends Component {@@ -80,7 +79,7 @@ export default class SpreadsheetEditor extends Component {interceptCloseModal() {if (this._hasChanges()) {this.dialog.yesNoConfirm({- message: I18n.t("table_builder.modal.confirm_close"),+ message: i18n("table_builder.modal.confirm_close"),didConfirm: () => this.args.closeModal(),});} else {@@ -149,20 +148,20 @@ export default class SpreadsheetEditor extends Component {const columns = [{- title: I18n.t("table_builder.default_header.col_1"),+ title: i18n("table_builder.default_header.col_1"),width: this.defaultColWidth,},{- title: I18n.t("table_builder.default_header.col_2"),+ title: i18n("table_builder.default_header.col_2"),width: this.defaultColWidth,},{- title: I18n.t("table_builder.default_header.col_3"),+ title: i18n("table_builder.default_header.col_3"),width: this.defaultColWidth,},{- title: I18n.t("table_builder.default_header.col_4"),+ title: i18n("table_builder.default_header.col_4"),width: this.defaultColWidth,},@@ -269,7 +268,7 @@ export default class SpreadsheetEditor extends Component {const newRaw = markdownTable;const editReason =- this.editReason || I18n.t("table_builder.edit.default_edit_reason");+ this.editReason || i18n("table_builder.edit.default_edit_reason");const raw = this.args.model.post.raw;const newPostRaw = this.buildUpdatedPost(tableIndex, raw, newRaw);@@ -424,5 +423,5 @@ export default class SpreadsheetEditor extends Component {}function prefixedLocale(localeString) {- return I18n.t(`table_builder.spreadsheet.${localeString}`);+ return i18n(`table_builder.spreadsheet.${localeString}`);}diff --git a/app/assets/javascripts/discourse/app/components/more-topics/browse-more.gjs b/app/assets/javascripts/discourse/app/components/more-topics/browse-more.gjsindex 45d744ade66..2a7d8f34b2b 100644--- a/app/assets/javascripts/discourse/app/components/more-topics/browse-more.gjs+++ b/app/assets/javascripts/discourse/app/components/more-topics/browse-more.gjs@@ -4,7 +4,7 @@ import { htmlSafe } from "@ember/template";import { categoryBadgeHTML } from "discourse/helpers/category-link";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";export default class BrowseMore extends Component {@service currentUser;@@ -55,11 +55,11 @@ export default class BrowseMore extends Component {});}} else if (suggestedGroupName) {- return I18n.t("user.messages.read_more_in_group", {+ return i18n("user.messages.read_more_in_group", {groupLink: this.groupLink(suggestedGroupName),});} else {- return I18n.t("user.messages.read_more", {+ return i18n("user.messages.read_more", {basePath: getURL(""),username: this.currentUser.username,});@@ -91,12 +91,12 @@ export default class BrowseMore extends Component {basePath: getURL(""),});} else if (category) {- return I18n.t("topic.read_more_in_category", {+ return i18n("topic.read_more_in_category", {categoryLink: categoryBadgeHTML(category),latestLink: getURL("/latest"),});} else {- return I18n.t("topic.read_more", {+ return i18n("topic.read_more", {categoryLink: getURL("/categories"),latestLink: getURL("/latest"),});diff --git a/app/assets/javascripts/discourse/app/components/nav-item.gjs b/app/assets/javascripts/discourse/app/components/nav-item.gjsindex 74bfad03c51..3fb10d7195f 100644--- a/app/assets/javascripts/discourse/app/components/nav-item.gjs+++ b/app/assets/javascripts/discourse/app/components/nav-item.gjs@@ -6,13 +6,13 @@ import { htmlSafe } from "@ember/template";import concatClass from "discourse/helpers/concat-class";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NavItem extends Component {@service router;get contents() {- const text = this.args.i18nLabel || I18n.t(this.args.label);+ const text = this.args.i18nLabel || i18n(this.args.label);if (this.args.icon) {return htmlSafe(`${iconHTML(this.args.icon)} ${text}`);}diff --git a/app/assets/javascripts/discourse/app/components/notification-consent-banner.gjs b/app/assets/javascripts/discourse/app/components/notification-consent-banner.gjsindex 6392f70f52e..62b6968a561 100644--- a/app/assets/javascripts/discourse/app/components/notification-consent-banner.gjs+++ b/app/assets/javascripts/discourse/app/components/notification-consent-banner.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import DButton from "discourse/components/d-button";import { keyValueStore as pushNotificationKeyValueStore } from "discourse/lib/push-notifications";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const userDismissedPromptKey = "dismissed-prompt";diff --git a/app/assets/javascripts/discourse/app/components/number-field.js b/app/assets/javascripts/discourse/app/components/number-field.jsindex 29f263034f9..d1145309a16 100644--- a/app/assets/javascripts/discourse/app/components/number-field.js+++ b/app/assets/javascripts/discourse/app/components/number-field.js@@ -4,7 +4,7 @@ import TextField from "discourse/components/text-field";import { allowOnlyNumericInput } from "discourse/lib/utilities";import deprecated from "discourse-common/lib/deprecated";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNameBindings("invalid")export default class NumberField extends TextField {@@ -59,6 +59,6 @@ export default class NumberField extends TextField {@discourseComputed("placeholderKey")placeholder(key) {- return key ? I18n.t(key) : "";+ return key ? i18n(key) : "";}}diff --git a/app/assets/javascripts/discourse/app/components/offline-indicator.gjs b/app/assets/javascripts/discourse/app/components/offline-indicator.gjsindex 8fa7724c3a6..4d158f36676 100644--- a/app/assets/javascripts/discourse/app/components/offline-indicator.gjs+++ b/app/assets/javascripts/discourse/app/components/offline-indicator.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class OfflineIndicator extends Component {@service networkConnectivity;diff --git a/app/assets/javascripts/discourse/app/components/pick-files-button.js b/app/assets/javascripts/discourse/app/components/pick-files-button.jsindex c717a9ad8e8..82875d425e2 100644--- a/app/assets/javascripts/discourse/app/components/pick-files-button.js+++ b/app/assets/javascripts/discourse/app/components/pick-files-button.js@@ -8,7 +8,7 @@ import {authorizesAllExtensions,} from "discourse/lib/uploads";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// This picker is intended to be used with UppyUploadMixin or with// ComposerUploadUppy, which is why there are no change events registered@@ -87,7 +87,7 @@ export default class PickFilesButton extends Component {}if (!this._haveAcceptedTypes(files)) {- const message = I18n.t("pick_files_button.unsupported_file_picked", {+ const message = i18n("pick_files_button.unsupported_file_picked", {types: this.acceptedFileTypesString,});this.dialog.alert(message);diff --git a/app/assets/javascripts/discourse/app/components/post-text-selection-toolbar.gjs b/app/assets/javascripts/discourse/app/components/post-text-selection-toolbar.gjsindex 2e3c680850c..85b9dd317d9 100644--- a/app/assets/javascripts/discourse/app/components/post-text-selection-toolbar.gjs+++ b/app/assets/javascripts/discourse/app/components/post-text-selection-toolbar.gjs@@ -18,7 +18,7 @@ import {setCaretPosition,} from "discourse/lib/utilities";import { getAbsoluteURL } from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function fixQuotes(str) {// u+201c, u+201d = “ ”@@ -108,7 +108,7 @@ export default class PostTextSelectionToolbar extends Component {clipboardCopy(text);this.toasts.success({duration: 3000,- data: { message: I18n.t("post.quote_copied_to_clibboard") },+ data: { message: i18n("post.quote_copied_to_clibboard") },});await this.args.data.hideToolbar();}diff --git a/app/assets/javascripts/discourse/app/components/post/menu.gjs b/app/assets/javascripts/discourse/app/components/post/menu.gjsindex 7c1f1fba125..41b49650405 100644--- a/app/assets/javascripts/discourse/app/components/post/menu.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu.gjs@@ -15,7 +15,7 @@ import concatClass from "discourse/helpers/concat-class";import DAG from "discourse/lib/dag";import { applyMutableValueTransformer } from "discourse/lib/transformer";import { userPath } from "discourse/lib/url";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import PostMenuButtonConfig from "./menu/button-config";import PostMenuButtonWrapper from "./menu/button-wrapper";import PostMenuAdminButton from "./menu/buttons/admin";diff --git a/app/assets/javascripts/discourse/app/components/post/menu/buttons/like.gjs b/app/assets/javascripts/discourse/app/components/post/menu/buttons/like.gjsindex d639a40d284..b85983bbfb8 100644--- a/app/assets/javascripts/discourse/app/components/post/menu/buttons/like.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu/buttons/like.gjs@@ -5,8 +5,8 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import discourseLater from "discourse-common/lib/later";+import { i18n } from "discourse-i18n";export default class PostMenuLikeButton extends Component {static shouldRender(args) {diff --git a/app/assets/javascripts/discourse/app/components/post/menu/buttons/read.gjs b/app/assets/javascripts/discourse/app/components/post/menu/buttons/read.gjsindex ee720246adb..f6db21b6c76 100644--- a/app/assets/javascripts/discourse/app/components/post/menu/buttons/read.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu/buttons/read.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class PostMenuReadButton extends Component {static shouldRender(args) {diff --git a/app/assets/javascripts/discourse/app/components/post/menu/buttons/replies.gjs b/app/assets/javascripts/discourse/app/components/post/menu/buttons/replies.gjsindex 1baf7411ae2..1b586993569 100644--- a/app/assets/javascripts/discourse/app/components/post/menu/buttons/replies.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu/buttons/replies.gjs@@ -4,7 +4,7 @@ import { service } from "@ember/service";import { and, not } from "truth-helpers";import DButton from "discourse/components/d-button";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class PostMenuRepliesButton extends Component {static extraControls = true;diff --git a/app/assets/javascripts/discourse/app/components/post/menu/buttons/reply.gjs b/app/assets/javascripts/discourse/app/components/post/menu/buttons/reply.gjsindex b682babfb38..7bc61612330 100644--- a/app/assets/javascripts/discourse/app/components/post/menu/buttons/reply.gjs+++ b/app/assets/javascripts/discourse/app/components/post/menu/buttons/reply.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class PostMenuReplyButton extends Component {static shouldRender(args) {diff --git a/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs b/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjsindex f67dd0fe08a..5919e0e4659 100644--- a/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs+++ b/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs@@ -1,5 +1,5 @@import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const PoweredByDiscourse = <template>{{! template-lint-disable link-rel-noopener }}diff --git a/app/assets/javascripts/discourse/app/components/preference-checkbox.gjs b/app/assets/javascripts/discourse/app/components/preference-checkbox.gjsindex ada2b66d7ae..147f7ba2723 100644--- a/app/assets/javascripts/discourse/app/components/preference-checkbox.gjs+++ b/app/assets/javascripts/discourse/app/components/preference-checkbox.gjs@@ -1,6 +1,6 @@import { Input } from "@ember/component";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const PreferenceCheckbox = <template><div class={{concatClass "controls" @class}} ...attributes>diff --git a/app/assets/javascripts/discourse/app/components/private-message-glyph.gjs b/app/assets/javascripts/discourse/app/components/private-message-glyph.gjsindex a065dc1dd1c..4108aa918be 100644--- a/app/assets/javascripts/discourse/app/components/private-message-glyph.gjs+++ b/app/assets/javascripts/discourse/app/components/private-message-glyph.gjs@@ -1,5 +1,5 @@import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const PrivateMessageGlyph = <template>{{#if @shouldShow}}diff --git a/app/assets/javascripts/discourse/app/components/related-messages.gjs b/app/assets/javascripts/discourse/app/components/related-messages.gjsindex 506cec6b512..169e67ccb82 100644--- a/app/assets/javascripts/discourse/app/components/related-messages.gjs+++ b/app/assets/javascripts/discourse/app/components/related-messages.gjs@@ -3,8 +3,8 @@ import { cached } from "@glimmer/tracking";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import BasicTopicList from "discourse/components/basic-topic-list";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";+import { i18n } from "discourse-i18n";export default class RelatedMessages extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs b/app/assets/javascripts/discourse/app/components/relative-time-picker.gjsindex 7be1e1d03aa..59e882b0e9c 100644--- a/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs+++ b/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs@@ -5,7 +5,7 @@ import { action } from "@ember/object";import didUpdate from "@ember/render-modifiers/modifiers/did-update";import { isBlank } from "@ember/utils";import { eq } from "truth-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ComboBox from "select-kit/components/combo-box";const HOUR = 60;@@ -67,23 +67,23 @@ export default class RelativeTimePicker extends Component {return [{id: "mins",- name: I18n.t("relative_time_picker.minutes", { count }),+ name: i18n("relative_time_picker.minutes", { count }),},{id: "hours",- name: I18n.t("relative_time_picker.hours", { count }),+ name: i18n("relative_time_picker.hours", { count }),},{id: "days",- name: I18n.t("relative_time_picker.days", { count }),+ name: i18n("relative_time_picker.days", { count }),},{id: "months",- name: I18n.t("relative_time_picker.months", { count }),+ name: i18n("relative_time_picker.months", { count }),},{id: "years",- name: I18n.t("relative_time_picker.years", { count }),+ name: i18n("relative_time_picker.years", { count }),},].filter((interval) => !this.args.hiddenIntervals?.includes(interval.id));}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-created-by-name.gjs b/app/assets/javascripts/discourse/app/components/reviewable-created-by-name.gjsindex acc7c0d0e8e..28fb1108a9e 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-created-by-name.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-created-by-name.gjs@@ -2,7 +2,7 @@ import { hash } from "@ember/helper";import PluginOutlet from "discourse/components/plugin-outlet";import UserLink from "discourse/components/user-link";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const ReviewableCreatedByName = <template><div class="names">diff --git a/app/assets/javascripts/discourse/app/components/reviewable-item.js b/app/assets/javascripts/discourse/app/components/reviewable-item.jsindex cf7ee8e5776..36ccba1b014 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-item.js+++ b/app/assets/javascripts/discourse/app/components/reviewable-item.js@@ -14,7 +14,7 @@ import Category from "discourse/models/category";import Composer from "discourse/models/composer";import Topic from "discourse/models/topic";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _components = {};@@ -144,15 +144,15 @@ export default class ReviewableItem extends Component {claimHelp(claimMode, claimedBy) {if (claimedBy) {return claimedBy.id === this.currentUser.id- ? I18n.t("review.claim_help.claimed_by_you")- : I18n.t("review.claim_help.claimed_by_other", {+ ? i18n("review.claim_help.claimed_by_you")+ : i18n("review.claim_help.claimed_by_other", {username: claimedBy.username,});}return claimMode === "optional"- ? I18n.t("review.claim_help.optional")- : I18n.t("review.claim_help.required");+ ? i18n("review.claim_help.optional")+ : i18n("review.claim_help.required");}// Find a component to render, if one exists. For example:@@ -259,7 +259,7 @@ export default class ReviewableItem extends Component {async clientEdit(reviewable, performAction) {if (!this.currentUser) {- return this.dialog.alert(I18n.t("post.controls.edit_anonymous"));+ return this.dialog.alert(i18n("post.controls.edit_anonymous"));}const post = await this.store.find("post", reviewable.post_id);const topic_json = await Topic.find(post.topic_id, {});diff --git a/app/assets/javascripts/discourse/app/components/score-value.gjs b/app/assets/javascripts/discourse/app/components/score-value.gjsindex 139151ee9a2..1fd6eccf90d 100644--- a/app/assets/javascripts/discourse/app/components/score-value.gjs+++ b/app/assets/javascripts/discourse/app/components/score-value.gjs@@ -1,5 +1,5 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ScoreValue extends Component {get numericValue() {@@ -11,11 +11,11 @@ export default class ScoreValue extends Component {}get explanationTitle() {- return I18n.t(`review.explain.${this.args.label}.title`);+ return i18n(`review.explain.${this.args.label}.title`);}get explanationContent() {- return I18n.t(`review.explain.${this.args.label}.name`);+ return i18n(`review.explain.${this.args.label}.name`);}<template>diff --git a/app/assets/javascripts/discourse/app/components/search-advanced-options.js b/app/assets/javascripts/discourse/app/components/search-advanced-options.jsindex f97d935d2d4..5e1c69e5c5f 100644--- a/app/assets/javascripts/discourse/app/components/search-advanced-options.js+++ b/app/assets/javascripts/discourse/app/components/search-advanced-options.js@@ -7,7 +7,7 @@ import {} from "@ember-decorators/component";import { escapeExpression } from "discourse/lib/utilities";import Category from "discourse/models/category";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const REGEXP_BLOCKS = /(([^" \t\n\x0B\f\r]+)?(("[^"]+")?))/g;@@ -38,36 +38,36 @@ let _extraOptions = [];function inOptionsForUsers() {return [- { name: I18n.t("search.advanced.filters.unseen"), value: "unseen" },- { name: I18n.t("search.advanced.filters.posted"), value: "posted" },- { name: I18n.t("search.advanced.filters.created"), value: "created" },- { name: I18n.t("search.advanced.filters.watching"), value: "watching" },- { name: I18n.t("search.advanced.filters.tracking"), value: "tracking" },- { name: I18n.t("search.advanced.filters.bookmarks"), value: "bookmarks" },+ { name: i18n("search.advanced.filters.unseen"), value: "unseen" },+ { name: i18n("search.advanced.filters.posted"), value: "posted" },+ { name: i18n("search.advanced.filters.created"), value: "created" },+ { name: i18n("search.advanced.filters.watching"), value: "watching" },+ { name: i18n("search.advanced.filters.tracking"), value: "tracking" },+ { name: i18n("search.advanced.filters.bookmarks"), value: "bookmarks" },].concat(..._extraOptions.map((eo) => eo.inOptionsForUsers).filter(Boolean));}function inOptionsForAll() {return [- { name: I18n.t("search.advanced.filters.first"), value: "first" },- { name: I18n.t("search.advanced.filters.pinned"), value: "pinned" },- { name: I18n.t("search.advanced.filters.wiki"), value: "wiki" },- { name: I18n.t("search.advanced.filters.images"), value: "images" },+ { name: i18n("search.advanced.filters.first"), value: "first" },+ { name: i18n("search.advanced.filters.pinned"), value: "pinned" },+ { name: i18n("search.advanced.filters.wiki"), value: "wiki" },+ { name: i18n("search.advanced.filters.images"), value: "images" },].concat(..._extraOptions.map((eo) => eo.inOptionsForAll).filter(Boolean));}function statusOptions() {return [- { name: I18n.t("search.advanced.statuses.open"), value: "open" },- { name: I18n.t("search.advanced.statuses.closed"), value: "closed" },- { name: I18n.t("search.advanced.statuses.public"), value: "public" },- { name: I18n.t("search.advanced.statuses.archived"), value: "archived" },+ { name: i18n("search.advanced.statuses.open"), value: "open" },+ { name: i18n("search.advanced.statuses.closed"), value: "closed" },+ { name: i18n("search.advanced.statuses.public"), value: "public" },+ { name: i18n("search.advanced.statuses.archived"), value: "archived" },{- name: I18n.t("search.advanced.statuses.noreplies"),+ name: i18n("search.advanced.statuses.noreplies"),value: "noreplies",},{- name: I18n.t("search.advanced.statuses.single_user"),+ name: i18n("search.advanced.statuses.single_user"),value: "single_user",},].concat(..._extraOptions.map((eo) => eo.statusOptions).filter(Boolean));@@ -75,8 +75,8 @@ function statusOptions() {function postTimeOptions() {return [- { name: I18n.t("search.advanced.post.time.before"), value: "before" },- { name: I18n.t("search.advanced.post.time.after"), value: "after" },+ { name: i18n("search.advanced.post.time.before"), value: "before" },+ { name: i18n("search.advanced.post.time.after"), value: "after" },].concat(..._extraOptions.map((eo) => eo.postTimeOptions).filter(Boolean));}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.js b/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.jsindex 9b8df0f28bc..36fffa34ad4 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.js+++ b/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.js@@ -1,9 +1,9 @@import Component from "@glimmer/component";import { translateModKey } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BrowserSearchTip extends Component {get translatedLabel() {- return I18n.t("search.browser_tip", { modifier: translateModKey("Meta+") });+ return i18n("search.browser_tip", { modifier: translateModKey("Meta+") });}}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.js b/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.jsindex c06f1ede36d..5fa4c315634 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.js+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.js@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { service } from "@ember/service";import { MODIFIER_REGEXP } from "discourse/components/search-menu";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Assistant from "./assistant";import AssistantItem from "./assistant-item";@@ -78,7 +78,7 @@ export default class InitialOptions extends Component {}topicContextType() {- this.suffix = I18n.t("search.in_this_topic");+ this.suffix = i18n("search.in_this_topic");}privateMessageContextType() {@@ -137,7 +137,7 @@ export default class InitialOptions extends Component {userContextType() {this.contextTypeKeyword = "@";this.slug = `@${this.search.searchContext.user.username}`;- this.suffix = I18n.t("search.in_posts_by", {+ this.suffix = i18n("search.in_posts_by", {username: this.search.searchContext.user.username,});}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.js b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.jsindex d130858c4f0..f72cd95343f 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.js+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.js@@ -2,36 +2,36 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";import { focusSearchInput } from "discourse/components/search-menu";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DEFAULT_QUICK_TIPS = [{label: "#",- description: I18n.t("search.tips.category_tag"),+ description: i18n("search.tips.category_tag"),clickable: true,},{label: "@",- description: I18n.t("search.tips.author"),+ description: i18n("search.tips.author"),clickable: true,},{label: "in:",- description: I18n.t("search.tips.in"),+ description: i18n("search.tips.in"),clickable: true,},{label: "status:",- description: I18n.t("search.tips.status"),+ description: i18n("search.tips.status"),clickable: true,},{- label: I18n.t("search.tips.full_search_key", { modifier: "Ctrl" }),- description: I18n.t("search.tips.full_search"),+ label: i18n("search.tips.full_search_key", { modifier: "Ctrl" }),+ description: i18n("search.tips.full_search"),},{label: "@me",- description: I18n.t("search.tips.me"),+ description: i18n("search.tips.me"),},];diff --git a/app/assets/javascripts/discourse/app/components/search-text-field.js b/app/assets/javascripts/discourse/app/components/search-text-field.jsindex 772bf2a1001..5695141e171 100644--- a/app/assets/javascripts/discourse/app/components/search-text-field.js+++ b/app/assets/javascripts/discourse/app/components/search-text-field.js@@ -3,14 +3,14 @@ import $ from "jquery";import TextField from "discourse/components/text-field";import { applySearchAutocomplete } from "discourse/lib/search";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SearchTextField extends TextField {autocomplete = "off";@discourseComputed("searchService.searchContextEnabled")placeholder(searchContextEnabled) {- return searchContextEnabled ? "" : I18n.t("search.full_page_title");+ return searchContextEnabled ? "" : i18n("search.full_page_title");}@on("didInsertElement")diff --git a/app/assets/javascripts/discourse/app/components/second-factor-form.js b/app/assets/javascripts/discourse/app/components/second-factor-form.jsindex 2d7418d56f2..a1015780bce 100644--- a/app/assets/javascripts/discourse/app/components/second-factor-form.js+++ b/app/assets/javascripts/discourse/app/components/second-factor-form.js@@ -2,18 +2,18 @@ import Component from "@ember/component";import { action } from "@ember/object";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorForm extends Component {@discourseComputed("secondFactorMethod")secondFactorTitle(secondFactorMethod) {switch (secondFactorMethod) {case SECOND_FACTOR_METHODS.TOTP:- return I18n.t("login.second_factor_title");+ return i18n("login.second_factor_title");case SECOND_FACTOR_METHODS.SECURITY_KEY:- return I18n.t("login.second_factor_title");+ return i18n("login.second_factor_title");case SECOND_FACTOR_METHODS.BACKUP_CODE:- return I18n.t("login.second_factor_backup_title");+ return i18n("login.second_factor_backup_title");}}@@ -21,11 +21,11 @@ export default class SecondFactorForm extends Component {secondFactorDescription(secondFactorMethod) {switch (secondFactorMethod) {case SECOND_FACTOR_METHODS.TOTP:- return I18n.t("login.second_factor_description");+ return i18n("login.second_factor_description");case SECOND_FACTOR_METHODS.SECURITY_KEY:- return I18n.t("login.security_key_description");+ return i18n("login.security_key_description");case SECOND_FACTOR_METHODS.BACKUP_CODE:- return I18n.t("login.second_factor_backup_description");+ return i18n("login.second_factor_backup_description");}}diff --git a/app/assets/javascripts/discourse/app/components/security-key-dropdown.js b/app/assets/javascripts/discourse/app/components/security-key-dropdown.jsindex ce9069d3d0c..5c8a1f5521c 100644--- a/app/assets/javascripts/discourse/app/components/security-key-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/security-key-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -17,13 +17,13 @@ export default class SecurityKeyDropdown extends DropdownSelectBoxComponent {content.push({id: "edit",icon: "pencil",- name: I18n.t("user.second_factor.edit"),+ name: i18n("user.second_factor.edit"),});content.push({id: "disable",icon: "trash-can",- name: I18n.t("user.second_factor.disable"),+ name: i18n("user.second_factor.disable"),});return content;diff --git a/app/assets/javascripts/discourse/app/components/security-key-form.gjs b/app/assets/javascripts/discourse/app/components/security-key-form.gjsindex 9d62eda91fb..7a2ad345e6c 100644--- a/app/assets/javascripts/discourse/app/components/security-key-form.gjs+++ b/app/assets/javascripts/discourse/app/components/security-key-form.gjs@@ -3,7 +3,7 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import DButton from "discourse/components/d-button";import { SECOND_FACTOR_METHODS } from "discourse/models/user";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class SecurityKeyForm extends Component {@actiondiff --git a/app/assets/javascripts/discourse/app/components/share-panel.js b/app/assets/javascripts/discourse/app/components/share-panel.jsindex 29c0057d148..d2df83684ac 100644--- a/app/assets/javascripts/discourse/app/components/share-panel.js+++ b/app/assets/javascripts/discourse/app/components/share-panel.js@@ -6,7 +6,7 @@ import Sharing from "discourse/lib/sharing";import { escapeExpression } from "discourse/lib/utilities";import discourseLater from "discourse-common/lib/later";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SharePanel extends Component {tagName = null;@@ -28,7 +28,7 @@ export default class SharePanel extends Component {@discourseComputed("type", "topic.title")shareTitle(type, topicTitle) {topicTitle = escapeExpression(topicTitle);- return I18n.t("share.topic_html", { topicTitle });+ return i18n("share.topic_html", { topicTitle });}@discourseComputed("panel.model.shareUrl", "topic.shareUrl")diff --git a/app/assets/javascripts/discourse/app/components/shared-draft-controls.js b/app/assets/javascripts/discourse/app/components/shared-draft-controls.jsindex a87676b84b5..12bae3f6727 100644--- a/app/assets/javascripts/discourse/app/components/shared-draft-controls.js+++ b/app/assets/javascripts/discourse/app/components/shared-draft-controls.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class SharedDraftControls extends Component {@@ -24,7 +24,7 @@ export default class SharedDraftControls extends Component {@actionpublish() {this.dialog.yesNoConfirm({- message: I18n.t("shared_drafts.confirm_publish"),+ message: i18n("shared_drafts.confirm_publish"),didConfirm: () => {this.set("publishing", true);const destinationCategoryId = this.topic.destination_category_id;diff --git a/app/assets/javascripts/discourse/app/components/sidebar/anonymous/categories-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/anonymous/categories-section.gjsindex f73e4208e44..5244c35627e 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/anonymous/categories-section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/anonymous/categories-section.gjs@@ -1,5 +1,5 @@import Category from "discourse/models/category";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AllCategoriesSectionLink from "../common/all-categories-section-link";import SidebarCommonCategoriesSection from "../common/categories-section";import Section from "../section";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/anonymous/tags-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/anonymous/tags-section.gjsindex f4cbaf70691..7c3cf74f97a 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/anonymous/tags-section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/anonymous/tags-section.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { cached } from "@glimmer/tracking";import { service } from "@ember/service";import TagSectionLink from "discourse/lib/sidebar/user/tags-section/tag-section-link";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AllTagsSectionLink from "../common/all-tags-section-link";import Section from "../section";import SectionLink from "../section-link";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/back-to-forum.gjs b/app/assets/javascripts/discourse/app/components/sidebar/back-to-forum.gjsindex b77868f7007..4bb86b4aaec 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/back-to-forum.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/back-to-forum.gjs@@ -1,6 +1,6 @@import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";+import { i18n } from "discourse-i18n";const BackToForum = <template><a href={{getURL "/"}} class="sidebar-sections__back-to-forum">diff --git a/app/assets/javascripts/discourse/app/components/sidebar/common/all-categories-section-link.gjs b/app/assets/javascripts/discourse/app/components/sidebar/common/all-categories-section-link.gjsindex 143fc35a94d..cb30fc09d88 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/common/all-categories-section-link.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/common/all-categories-section-link.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import SectionLink from "../section-link";const SidebarCommonAllCategoriesSectionLink = <template>diff --git a/app/assets/javascripts/discourse/app/components/sidebar/common/all-tags-section-link.gjs b/app/assets/javascripts/discourse/app/components/sidebar/common/all-tags-section-link.gjsindex c7bb4810bce..b8510aba607 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/common/all-tags-section-link.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/common/all-tags-section-link.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import SectionLink from "../section-link";const SidebarCommonAllTagsSectionLink = <template>diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjsindex b924e889a05..eee50cfb2ad 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs@@ -16,8 +16,8 @@ import loadingSpinner from "discourse/helpers/loading-spinner";import { popupAjaxError } from "discourse/lib/ajax-error";import Category from "discourse/models/category";import { INPUT_DELAY } from "discourse-common/config/environment";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";+import { i18n } from "discourse-i18n";class ActionSerializer {constructor(perform) {diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjsindex 57992408f80..70246328f0a 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs@@ -7,8 +7,7 @@ import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import withEventValue from "discourse/helpers/with-event-value";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBox from "select-kit/components/dropdown-select-box";export default class SidebarEditNavigationMenuModal extends Component {@@ -17,17 +16,15 @@ export default class SidebarEditNavigationMenuModal extends Component {filterDropdownContent = [{id: "all",- name: I18n.t("sidebar.edit_navigation_modal_form.filter_dropdown.all"),+ name: i18n("sidebar.edit_navigation_modal_form.filter_dropdown.all"),},{id: "selected",- name: I18n.t(- "sidebar.edit_navigation_modal_form.filter_dropdown.selected"- ),+ name: i18n("sidebar.edit_navigation_modal_form.filter_dropdown.selected"),},{id: "unselected",- name: I18n.t(+ name: i18n("sidebar.edit_navigation_modal_form.filter_dropdown.unselected"),},diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjsindex 09a7c04f791..7402fa2266c 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/tags-modal.gjs@@ -11,8 +11,8 @@ import ConditionalLoadingSpinner from "discourse/components/conditional-loading-import loadingSpinner from "discourse/helpers/loading-spinner";import { popupAjaxError } from "discourse/lib/ajax-error";import { INPUT_DELAY } from "discourse-common/config/environment";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";+import { i18n } from "discourse-i18n";import EditNavigationMenuModal from "./modal";export default class SidebarEditNavigationMenuTagsModal extends Component {diff --git a/app/assets/javascripts/discourse/app/components/sidebar/filter-no-results.gjs b/app/assets/javascripts/discourse/app/components/sidebar/filter-no-results.gjsindex 8c9330e8e7d..d46c208e41e 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/filter-no-results.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/filter-no-results.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class FilterNoResults extends Component {@service sidebarState;diff --git a/app/assets/javascripts/discourse/app/components/sidebar/filter.gjs b/app/assets/javascripts/discourse/app/components/sidebar/filter.gjsindex ed3027d124b..c0acacf852f 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/filter.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/filter.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import DButton from "discourse/components/d-button";import { translateModKey } from "discourse/lib/utilities";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class Filter extends Component {@service sidebarState;diff --git a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.gjs b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.gjsindex 9de86f9e318..1b36e6ef803 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.gjs@@ -7,8 +7,8 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import MoreSectionLink from "./more-section-link";import SectionLinkButton from "./section-link-button";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/section-form-link.gjs b/app/assets/javascripts/discourse/app/components/sidebar/section-form-link.gjsindex 48cf1e72f7f..f258a0ab318 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/section-form-link.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/section-form-link.gjs@@ -9,8 +9,8 @@ import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import withEventValue from "discourse/helpers/with-event-value";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import discourseLater from "discourse-common/lib/later";+import { i18n } from "discourse-i18n";import IconPicker from "select-kit/components/icon-picker";export default class SectionFormLink extends Component {diff --git a/app/assets/javascripts/discourse/app/components/sidebar/section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/section.gjsindex 8cab30d165b..79d30d98749 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/section.gjs@@ -11,8 +11,8 @@ import {getSidebarSectionContentId,} from "discourse/lib/sidebar/helpers";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import DropdownSelectBox from "select-kit/components/dropdown-select-box";import DTooltip from "float-kit/components/d-tooltip";import SectionHeader from "./section-header";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/categories-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/user/categories-section.gjsindex b26a388aeed..db7da97186e 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/user/categories-section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/user/categories-section.gjs@@ -4,8 +4,8 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { hasDefaultSidebarCategories } from "discourse/lib/sidebar/helpers";import Category from "discourse/models/category";-import i18n from "discourse-common/helpers/i18n";import { debounce } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import AllCategoriesSectionLink from "../common/all-categories-section-link";import CommonCategoriesSection from "../common/categories-section";import EditNavigationMenuCategoriesModal from "../edit-navigation-menu/categories-modal";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.gjsindex 5e506cb928a..98f7bf1de5c 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.gjs@@ -6,8 +6,8 @@ import { service } from "@ember/service";import routeAction from "discourse/helpers/route-action";import GroupMessageSectionLink from "discourse/lib/sidebar/user/messages-section/group-message-section-link";import PersonalMessageSectionLink from "discourse/lib/sidebar/user/messages-section/personal-message-section-link";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import Section from "../section";import SectionLink from "../section-link";diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.gjs b/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.gjsindex 9c2a6d5e2f8..d881c4fbb83 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.gjs@@ -7,7 +7,7 @@ import SidebarEditNavigationMenuTagsModal from "discourse/components/sidebar/ediimport { hasDefaultSidebarTags } from "discourse/lib/sidebar/helpers";import PMTagSectionLink from "discourse/lib/sidebar/user/tags-section/pm-tag-section-link";import TagSectionLink from "discourse/lib/sidebar/user/tags-section/tag-section-link";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AllTagsSectionLink from "../common/all-tags-section-link";import Section from "../section";import SectionLink from "../section-link";diff --git a/app/assets/javascripts/discourse/app/components/signup-page-cta.gjs b/app/assets/javascripts/discourse/app/components/signup-page-cta.gjsindex 111005ef562..705b7e83f2b 100644--- a/app/assets/javascripts/discourse/app/components/signup-page-cta.gjs+++ b/app/assets/javascripts/discourse/app/components/signup-page-cta.gjs@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import DButton from "discourse/components/d-button";import PluginOutlet from "discourse/components/plugin-outlet";import routeAction from "discourse/helpers/route-action";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const SignupPageCta = <template><div class="signup-page-cta">diff --git a/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs b/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjsindex 4cb116db637..40d63dbaf4d 100644--- a/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs+++ b/app/assets/javascripts/discourse/app/components/signup-progress-bar.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import { eq } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";import dIcon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SignupProgressBar extends Component {@service siteSettings;@@ -23,7 +23,7 @@ export default class SignupProgressBar extends Component {}stepText(step) {- return I18n.t(`create_account.progress_bar.${step}`);+ return i18n(`create_account.progress_bar.${step}`);}get currentStepIndex() {diff --git a/app/assets/javascripts/discourse/app/components/small-user-list.gjs b/app/assets/javascripts/discourse/app/components/small-user-list.gjsindex b58a6ea8fbd..92528bf3056 100644--- a/app/assets/javascripts/discourse/app/components/small-user-list.gjs+++ b/app/assets/javascripts/discourse/app/components/small-user-list.gjs@@ -2,8 +2,8 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import avatar from "discourse/helpers/bound-avatar-template";import { userPath } from "discourse/lib/url";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";+import { i18n } from "discourse-i18n";export default class SmallUserList extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs b/app/assets/javascripts/discourse/app/components/software-update-prompt.gjsindex a264ed783cc..b2c3a2738b3 100644--- a/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs+++ b/app/assets/javascripts/discourse/app/components/software-update-prompt.gjs@@ -6,9 +6,9 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import { isTesting } from "discourse-common/config/environment";-import i18n from "discourse-common/helpers/i18n";import discourseLater from "discourse-common/lib/later";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";export default class SoftwareUpdatePrompt extends Component {@service messageBus;diff --git a/app/assets/javascripts/discourse/app/components/suggested-topics.gjs b/app/assets/javascripts/discourse/app/components/suggested-topics.gjsindex 45035e27395..4d0fdc8b84b 100644--- a/app/assets/javascripts/discourse/app/components/suggested-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/suggested-topics.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import BasicTopicList from "discourse/components/basic-topic-list";import UserTip from "discourse/components/user-tip";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class SuggestedTopics extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/table-header-toggle.gjs b/app/assets/javascripts/discourse/app/components/table-header-toggle.gjsindex c88bd0784a7..3e8422f9b54 100644--- a/app/assets/javascripts/discourse/app/components/table-header-toggle.gjs+++ b/app/assets/javascripts/discourse/app/components/table-header-toggle.gjs@@ -3,7 +3,7 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import { schedule } from "@ember/runloop";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TableHeaderToggle extends Component {get id() {@@ -44,19 +44,19 @@ export default class TableHeaderToggle extends Component {let criteria = "";if (this.args.icon === "heart") {- criteria += `${I18n.t("likes_lowercase", { count: 2 })} `;+ criteria += `${i18n("likes_lowercase", { count: 2 })} `;}if (this.args.translated) {criteria += this.args.field;} else {const labelKey = this.labelKey || `directory.${this.args.field}`;- criteria += I18n.t(`${labelKey}_long`, {- defaultValue: I18n.t(labelKey),+ criteria += i18n(`${labelKey}_long`, {+ defaultValue: i18n(labelKey),});}- return I18n.t("directory.sort.label", { criteria });+ return i18n("directory.sort.label", { criteria });}get iconName() {@@ -68,7 +68,7 @@ export default class TableHeaderToggle extends Component {return this.args.translated? this.args.field- : I18n.t(labelKey + "_long", { defaultValue: I18n.t(labelKey) });+ : i18n(labelKey + "_long", { defaultValue: i18n(labelKey) });}@actiondiff --git a/app/assets/javascripts/discourse/app/components/tag-groups-form.js b/app/assets/javascripts/discourse/app/components/tag-groups-form.jsindex 28da5b5f904..635bfd3ab46 100644--- a/app/assets/javascripts/discourse/app/components/tag-groups-form.js+++ b/app/assets/javascripts/discourse/app/components/tag-groups-form.js@@ -7,7 +7,7 @@ import { bufferedProperty } from "discourse/mixins/buffered-content";import Group from "discourse/models/group";import PermissionType from "discourse/models/permission-type";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class TagGroupsForm extends Component.extend(@@ -115,7 +115,7 @@ export default class TagGroupsForm extends Component.extend(@actionsave() {if (this.cannotSave) {- this.dialog.alert(I18n.t("tagging.groups.cannot_save"));+ this.dialog.alert(i18n("tagging.groups.cannot_save"));return false;}@@ -149,7 +149,7 @@ export default class TagGroupsForm extends Component.extend(@actiondestroyTagGroup() {return this.dialog.yesNoConfirm({- message: I18n.t("tagging.groups.confirm_delete"),+ message: i18n("tagging.groups.confirm_delete"),didConfirm: () => {this.model.destroyRecord().then(() => {if (this.onDestroy) {diff --git a/app/assets/javascripts/discourse/app/components/tag-info.js b/app/assets/javascripts/discourse/app/components/tag-info.jsindex 72514aee729..09ebbbfa725 100644--- a/app/assets/javascripts/discourse/app/components/tag-info.js+++ b/app/assets/javascripts/discourse/app/components/tag-info.js@@ -8,7 +8,7 @@ import { tagName } from "@ember-decorators/component";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class TagInfo extends Component {@@ -28,7 +28,7 @@ export default class TagInfo extends Component {@discourseComputed("tagInfo.tag_group_names")tagGroupsInfo(tagGroupNames) {- return I18n.t("tagging.tag_groups_info", {+ return i18n("tagging.tag_groups_info", {count: tagGroupNames.length,tag_groups: tagGroupNames.join(", "),});@@ -36,7 +36,7 @@ export default class TagInfo extends Component {@discourseComputed("tagInfo.categories")categoriesInfo(categories) {- return I18n.t("tagging.category_restrictions", {+ return i18n("tagging.category_restrictions", {count: categories.length,});}@@ -115,7 +115,7 @@ export default class TagInfo extends Component {event?.preventDefault();this.dialog.yesNoConfirm({- message: I18n.t("tagging.delete_synonym_confirm", {+ message: i18n("tagging.delete_synonym_confirm", {tag_name: tag.text,}),didConfirm: () => {@@ -163,13 +163,13 @@ export default class TagInfo extends Component {let confirmText =numTopics === 0- ? I18n.t("tagging.delete_confirm_no_topics")- : I18n.t("tagging.delete_confirm", { count: numTopics });+ ? i18n("tagging.delete_confirm_no_topics")+ : i18n("tagging.delete_confirm", { count: numTopics });if (this.tagInfo.synonyms.length > 0) {confirmText +=" " +- I18n.t("tagging.delete_confirm_synonyms", {+ i18n("tagging.delete_confirm_synonyms", {count: this.tagInfo.synonyms.length,});}@@ -181,7 +181,7 @@ export default class TagInfo extends Component {await this.tag.destroyRecord();this.router.transitionTo("tags.index");} catch {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}},});@@ -191,7 +191,7 @@ export default class TagInfo extends Component {addSynonyms() {this.dialog.confirm({message: htmlSafe(- I18n.t("tagging.add_synonyms_explanation", {+ i18n("tagging.add_synonyms_explanation", {count: this.newSynonyms.length,tag_name: this.tagInfo.name,})@@ -209,12 +209,12 @@ export default class TagInfo extends Component {this.loadTagInfo();} else if (response.failed_tags) {this.dialog.alert(- I18n.t("tagging.add_synonyms_failed", {+ i18n("tagging.add_synonyms_failed", {tag_names: Object.keys(response.failed_tags).join(", "),}));} else {- this.dialog.alert(I18n.t("generic_error"));+ this.dialog.alert(i18n("generic_error"));}}).catch(popupAjaxError);diff --git a/app/assets/javascripts/discourse/app/components/tag-list.js b/app/assets/javascripts/discourse/app/components/tag-list.jsindex a3f2d125fd5..60aaf0a1ac4 100644--- a/app/assets/javascripts/discourse/app/components/tag-list.js+++ b/app/assets/javascripts/discourse/app/components/tag-list.js@@ -3,7 +3,7 @@ import { sort } from "@ember/object/computed";import { classNameBindings } from "@ember-decorators/component";import Category from "discourse/models/category";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNameBindings(":tags-list",@@ -18,7 +18,7 @@ export default class TagList extends Component {@discourseComputed("titleKey")title(titleKey) {- return titleKey && I18n.t(titleKey);+ return titleKey && i18n(titleKey);}@discourseComputed("categoryId")diff --git a/app/assets/javascripts/discourse/app/components/tags-admin-dropdown.js b/app/assets/javascripts/discourse/app/components/tags-admin-dropdown.jsindex f97ef36d860..a5a63559b5f 100644--- a/app/assets/javascripts/discourse/app/components/tags-admin-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/tags-admin-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -21,20 +21,20 @@ export default class TagsAdminDropdown extends DropdownSelectBoxComponent {return [{id: "manageGroups",- name: I18n.t("tagging.manage_groups"),- description: I18n.t("tagging.manage_groups_description"),+ name: i18n("tagging.manage_groups"),+ description: i18n("tagging.manage_groups_description"),icon: "tags",},{id: "uploadTags",- name: I18n.t("tagging.upload"),- description: I18n.t("tagging.upload_description"),+ name: i18n("tagging.upload"),+ description: i18n("tagging.upload_description"),icon: "upload",},{id: "deleteUnusedTags",- name: I18n.t("tagging.delete_unused"),- description: I18n.t("tagging.delete_unused_description"),+ name: i18n("tagging.delete_unused"),+ description: i18n("tagging.delete_unused_description"),icon: "trash-can",},];diff --git a/app/assets/javascripts/discourse/app/components/text-field.js b/app/assets/javascripts/discourse/app/components/text-field.jsindex 5f84c541890..86b9a0e14e1 100644--- a/app/assets/javascripts/discourse/app/components/text-field.js+++ b/app/assets/javascripts/discourse/app/components/text-field.js@@ -3,7 +3,7 @@ import { computed } from "@ember/object";import { cancel, next } from "@ember/runloop";import { attributeBindings } from "@ember-decorators/component";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DEBOUNCE_MS = 500;@@ -64,7 +64,7 @@ export default class DiscourseTextField extends TextField {if (this._placeholder) {return this._placeholder;}- return this.placeholderKey ? I18n.t(this.placeholderKey) : "";+ return this.placeholderKey ? i18n(this.placeholderKey) : "";}set placeholder(value) {diff --git a/app/assets/javascripts/discourse/app/components/time-gap.gjs b/app/assets/javascripts/discourse/app/components/time-gap.gjsindex 65a9d8b1f68..5d0231696e4 100644--- a/app/assets/javascripts/discourse/app/components/time-gap.gjs+++ b/app/assets/javascripts/discourse/app/components/time-gap.gjs@@ -1,18 +1,18 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TimeGap extends Component {get description() {const daysSince = this.args.daysSince;if (daysSince < 30) {- return I18n.t("dates.later.x_days", { count: daysSince });+ return i18n("dates.later.x_days", { count: daysSince });} else if (daysSince < 365) {const gapMonths = Math.round(daysSince / 30);- return I18n.t("dates.later.x_months", { count: gapMonths });+ return i18n("dates.later.x_months", { count: gapMonths });} else {const gapYears = Math.round(daysSince / 365);- return I18n.t("dates.later.x_years", { count: gapYears });+ return i18n("dates.later.x_years", { count: gapYears });}}diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.jsindex f782f47f4ef..194870a1326 100644--- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js+++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js@@ -12,7 +12,7 @@ import {} from "discourse/lib/time-shortcut";import { laterToday, now, parseCustomDatetime } from "discourse/lib/time-utils";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const BINDINGS = {"l t": {@@ -271,7 +271,7 @@ export default class TimeShortcutPicker extends Component {_formatTime(options) {options.forEach((option) => {if (option.time && option.timeFormatKey) {- option.timeFormatted = option.time.format(I18n.t(option.timeFormatKey));+ option.timeFormatted = option.time.format(i18n(option.timeFormatKey));}});}diff --git a/app/assets/javascripts/discourse/app/components/token-based-auth-dropdown.js b/app/assets/javascripts/discourse/app/components/token-based-auth-dropdown.jsindex fe440ae4945..7a04db77e64 100644--- a/app/assets/javascripts/discourse/app/components/token-based-auth-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/token-based-auth-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -16,12 +16,12 @@ export default class TokenBasedAuthDropdown extends DropdownSelectBoxComponent {{id: "edit",icon: "pencil",- name: I18n.t("user.second_factor.edit"),+ name: i18n("user.second_factor.edit"),},{id: "disable",icon: "trash-can",- name: I18n.t("user.second_factor.disable"),+ name: i18n("user.second_factor.disable"),},];}diff --git a/app/assets/javascripts/discourse/app/components/topic-dismiss-buttons.gjs b/app/assets/javascripts/discourse/app/components/topic-dismiss-buttons.gjsindex b496b7e40d0..ccf647536cb 100644--- a/app/assets/javascripts/discourse/app/components/topic-dismiss-buttons.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-dismiss-buttons.gjs@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import DButton from "discourse/components/d-button";import DismissReadModal from "discourse/components/modal/dismiss-read";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TopicDismissButtons extends Component {@service currentUser;@@ -15,24 +15,24 @@ export default class TopicDismissButtons extends Component {get dismissLabel() {if (this.args.selectedTopics.length === 0) {- return I18n.t("topics.bulk.dismiss_button");+ return i18n("topics.bulk.dismiss_button");}- return I18n.t("topics.bulk.dismiss_button_with_selected", {+ return i18n("topics.bulk.dismiss_button_with_selected", {count: this.args.selectedTopics.length,});}get dismissNewLabel() {if (this.currentUser?.new_new_view_enabled) {- return I18n.t("topics.bulk.dismiss_button");+ return i18n("topics.bulk.dismiss_button");}if (this.args.selectedTopics.length === 0) {- return I18n.t("topics.bulk.dismiss_new");+ return i18n("topics.bulk.dismiss_new");}- return I18n.t("topics.bulk.dismiss_new_with_selected", {+ return i18n("topics.bulk.dismiss_new_with_selected", {count: this.args.selectedTopics.length,});}diff --git a/app/assets/javascripts/discourse/app/components/topic-entrance.js b/app/assets/javascripts/discourse/app/components/topic-entrance.jsindex 7d982f81387..d1ff0bd4f63 100644--- a/app/assets/javascripts/discourse/app/components/topic-entrance.js+++ b/app/assets/javascripts/discourse/app/components/topic-entrance.js@@ -7,28 +7,28 @@ import $ from "jquery";import DiscourseURL from "discourse/lib/url";import CleansUp from "discourse/mixins/cleans-up";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function entranceDate(dt, showTime) {const today = new Date();if (dt.toDateString() === today.toDateString()) {- return moment(dt).format(I18n.t("dates.time"));+ return moment(dt).format(i18n("dates.time"));}if (dt.getYear() === today.getYear()) {// No yearreturn moment(dt).format(showTime- ? I18n.t("dates.long_date_without_year_with_linebreak")- : I18n.t("dates.long_no_year_no_time")+ ? i18n("dates.long_date_without_year_with_linebreak")+ : i18n("dates.long_no_year_no_time"));}return moment(dt).format(showTime- ? I18n.t("dates.long_date_with_year_with_linebreak")- : I18n.t("dates.long_date_with_year_without_time")+ ? i18n("dates.long_date_with_year_with_linebreak")+ : i18n("dates.long_date_with_year_without_time"));}diff --git a/app/assets/javascripts/discourse/app/components/topic-list-item.js b/app/assets/javascripts/discourse/app/components/topic-list-item.jsindex 14abf256af9..7f80a44333c 100644--- a/app/assets/javascripts/discourse/app/components/topic-list-item.js+++ b/app/assets/javascripts/discourse/app/components/topic-list-item.js@@ -17,7 +17,7 @@ import DiscourseURL, { groupPath } from "discourse/lib/url";import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers";import { findRawTemplate } from "discourse-common/lib/raw-templates";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function showEntrance(e) {let target = $(e.target);@@ -168,7 +168,7 @@ export default class TopicListItem extends Component {newDotText() {return this.currentUser && this.currentUser.trust_level > 0? ""- : I18n.t("filters.new.lower_title");+ : i18n("filters.new.lower_title");}@discourseComputed("topic", "lastVisitedTopic")diff --git a/app/assets/javascripts/discourse/app/components/topic-list/list.gjs b/app/assets/javascripts/discourse/app/components/topic-list/list.gjsindex 1700577f82a..7354aaea173 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/list.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/list.gjs@@ -7,7 +7,7 @@ import PluginOutlet from "discourse/components/plugin-outlet";import TopicListHeader from "discourse/components/topic-list/topic-list-header";import TopicListItem from "discourse/components/topic-list/topic-list-item";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicList extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/topic-list/new-list-header-controls.gjs b/app/assets/javascripts/discourse/app/components/topic-list/new-list-header-controls.gjsindex a60e6907b89..97eae6fad22 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/new-list-header-controls.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/new-list-header-controls.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { fn } from "@ember/helper";import { on } from "@ember/modifier";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class NewListHeaderControls extends Component {get topicsActive() {diff --git a/app/assets/javascripts/discourse/app/components/topic-list/participant-groups.gjs b/app/assets/javascripts/discourse/app/components/topic-list/participant-groups.gjsindex 1d25593a868..2c07cad1dca 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/participant-groups.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/participant-groups.gjs@@ -1,5 +1,5 @@import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const ParticipantGroups = <template><divdiff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-bulk-select-dropdown.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-bulk-select-dropdown.gjsindex 4ebc00a76db..478ad15f53b 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-bulk-select-dropdown.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-bulk-select-dropdown.gjs@@ -1,5 +1,5 @@import BulkSelectTopicsDropdown from "discourse/components/bulk-select-topics-dropdown";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const TopicBulkSelectDropdown = <template><div class="bulk-select-topics-dropdown">diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-cell.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-cell.gjsindex f0f8b067a58..3881ba0e494 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-cell.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-cell.gjs@@ -15,7 +15,7 @@ import categoryLink from "discourse/helpers/category-link";import discourseTags from "discourse/helpers/discourse-tags";import topicFeaturedLink from "discourse/helpers/topic-featured-link";import { groupPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TopicCell extends Component {@service currentUser;@@ -24,7 +24,7 @@ export default class TopicCell extends Component {get newDotText() {return this.currentUser?.trust_level > 0? ""- : I18n.t("filters.new.lower_title");+ : i18n("filters.new.lower_title");}get participantGroups() {diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-excerpt.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-excerpt.gjsindex e293822bd91..2ad29aacd5d 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-excerpt.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-excerpt.gjs@@ -1,5 +1,5 @@import dirSpan from "discourse/helpers/dir-span";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const TopicExcerpt = <template>{{#if @topic.hasExcerpt}}diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjsindex 833e1ce71f4..0eee21115ef 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs@@ -8,7 +8,7 @@ import NewListHeaderControls from "discourse/components/topic-list/new-list-headimport TopicBulkSelectDropdown from "discourse/components/topic-list/topic-bulk-select-dropdown";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicListHeaderColumn extends Component {@service router;diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjsindex 3d8b373badc..c455afdaa50 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header.gjs@@ -2,7 +2,7 @@ import { on } from "@ember/modifier";import PluginOutlet from "discourse/components/plugin-outlet";import TopicListHeaderColumn from "discourse/components/topic-list/topic-list-header-column";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const TopicListHeader = <template><tr>diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjsindex ffad6d1a35a..9ed104e5f9b 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-item.gjs@@ -27,7 +27,7 @@ import topicFeaturedLink from "discourse/helpers/topic-featured-link";import { wantsNewWindow } from "discourse/lib/intercept-click";import DiscourseURL from "discourse/lib/url";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicListItem extends Component {@service historyStore;diff --git a/app/assets/javascripts/discourse/app/components/topic-list/unread-indicator.gjs b/app/assets/javascripts/discourse/app/components/topic-list/unread-indicator.gjsindex 624d0610170..adacb8611ab 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/unread-indicator.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/unread-indicator.gjs@@ -1,8 +1,8 @@import Component from "@glimmer/component";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";export default class UnreadIndicator extends Component {@service messageBus;diff --git a/app/assets/javascripts/discourse/app/components/topic-map/private-message-map.gjs b/app/assets/javascripts/discourse/app/components/topic-map/private-message-map.gjsindex 93186779e19..1564c8b4c8e 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/private-message-map.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/private-message-map.gjs@@ -8,7 +8,7 @@ import DButton from "discourse/components/d-button";import avatar from "discourse/helpers/bound-avatar-template";import { groupPath } from "discourse/lib/url";import dIcon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PrivateMessageMap extends Component {@service site;@@ -128,7 +128,7 @@ class PmRemoveGroupLink extends Component {@actionshowConfirmDialog() {this.dialog.deleteConfirm({- message: I18n.t("private_message_info.remove_allowed_group", {+ message: i18n("private_message_info.remove_allowed_group", {name: this.args.model.name,}),confirmButtonLabel: "private_message_info.remove_group",@@ -196,7 +196,7 @@ class PmRemoveLink extends Component {: "private_message_info.remove_allowed_user";this.dialog.deleteConfirm({- message: I18n.t(messageKey, {+ message: i18n(messageKey, {name: this.args.model.username,}),confirmButtonLabel: this.args.isCurrentUserdiff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjsindex d8f64ec4672..bccb7ed2d62 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import replaceEmoji from "discourse/helpers/replace-emoji";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import and from "truth-helpers/helpers/and";const TRUNCATE_LENGTH_LIMIT = 85;diff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjsindex 37ceb898887..019ce60de98 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs@@ -17,8 +17,7 @@ import number from "discourse/helpers/number";import { ajax } from "discourse/lib/ajax";import { emojiUnescape } from "discourse/lib/text";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";const TRUNCATED_LINKS_LIMIT = 5;@@ -74,7 +73,7 @@ export default class TopicMapSummary extends Component {return;}- return I18n.t("summary.short_title");+ return i18n("summary.short_title");}get topRepliesIcon() {@@ -83,8 +82,8 @@ export default class TopicMapSummary extends Component {get topRepliesLabel() {return this.topRepliesSummaryEnabled- ? I18n.t("summary.show_all_label")- : I18n.t("summary.short_label");+ ? i18n("summary.show_all_label")+ : i18n("summary.short_label");}get loneStat() {@@ -186,7 +185,7 @@ export default class TopicMapSummary extends Component {}).catch((error) => {this.dialog.alert(- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: `http: ${error.status} - ${error.body}`,}));@@ -223,7 +222,7 @@ export default class TopicMapSummary extends Component {}).catch((error) => {this.dialog.alert(- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: `http: ${error.status} - ${error.body}`,}));diff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-views-chart.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-views-chart.gjsindex e8f188438dd..0698d9cea63 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/topic-views-chart.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-views-chart.gjs@@ -2,8 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import loadScript from "discourse/lib/load-script";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";const oneDay = 86400000; // day in milliseconds@@ -198,8 +197,8 @@ export default class TopicViewsChart extends Component {label: function (tooltipItem) {const label =tooltipItem?.parsed?.x === startOfDay- ? I18n.t("topic_map.predicted_views")- : I18n.t("topic_map.views");+ ? i18n("topic_map.predicted_views")+ : i18n("topic_map.views");return `${label}: ${tooltipItem?.parsed?.y}`;},diff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-views.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-views.gjsindex 93e6118d178..3fcc9624667 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/topic-views.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-views.gjs@@ -1,5 +1,5 @@import Component from "@glimmer/component";-import I18n from "I18n";+import I18n from "discourse-i18n";export default class TopicViews extends Component {adjustAggregatedData(stats) {diff --git a/app/assets/javascripts/discourse/app/components/topic-post-badges.gjs b/app/assets/javascripts/discourse/app/components/topic-post-badges.gjsindex 16a5b3ddacc..d8bb203093d 100644--- a/app/assets/javascripts/discourse/app/components/topic-post-badges.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-post-badges.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicPostBadges extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/topic-status.gjs b/app/assets/javascripts/discourse/app/components/topic-status.gjsindex 87cbac7da25..68171b5ad9f 100644--- a/app/assets/javascripts/discourse/app/components/topic-status.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-status.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import { and } from "truth-helpers";import PluginOutlet from "discourse/components/plugin-outlet";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicStatus extends Component {@service currentUser;diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjsindex d181dc0e2ba..e9e241810a0 100644--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs@@ -18,9 +18,9 @@ import topicFeaturedLink from "discourse/helpers/topic-featured-link";import { headerOffset } from "discourse/lib/offset-calculator";import { actionDescriptionHtml } from "discourse/widgets/post-small-action";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind, debounce } from "discourse-common/utils/decorators";import domUtils from "discourse-common/utils/dom-utils";+import { i18n } from "discourse-i18n";import TopicNotificationsButton from "select-kit/components/topic-notifications-button";import BackButton from "./back-button";import Scroller from "./scroller";diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.gjs b/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.gjsindex c3ea3d1275d..be4b9597bb3 100644--- a/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.gjs@@ -6,14 +6,14 @@ import {timelineDate,} from "discourse/components/topic-timeline/container";import draggable from "discourse/modifiers/draggable";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import BackButton from "./back-button";export default class TopicTimelineScroller extends Component {style = htmlSafe(`height: ${SCROLLER_HEIGHT}px`);get repliesShort() {- return I18n.t(`topic.timeline.replies_short`, {+ return i18n(`topic.timeline.replies_short`, {current: this.args.current,total: this.args.total,});diff --git a/app/assets/javascripts/discourse/app/components/topic-timer-info.js b/app/assets/javascripts/discourse/app/components/topic-timer-info.jsindex b386a6130a8..d9217a5faed 100644--- a/app/assets/javascripts/discourse/app/components/topic-timer-info.js+++ b/app/assets/javascripts/discourse/app/components/topic-timer-info.js@@ -9,12 +9,12 @@ import { isTesting } from "discourse-common/config/environment";import { iconHTML } from "discourse-common/lib/icon-library";import discourseLater from "discourse-common/lib/later";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("topic-timer-info")export default class TopicTimerInfo extends Component {clockIcon = htmlSafe(`${iconHTML("far-clock")}`);- trashLabel = I18n.t("post.controls.remove_timer");+ trashLabel = i18n("post.controls.remove_timer");title = null;notice = null;@@ -120,7 +120,7 @@ export default class TopicTimerInfo extends Component {options = Object.assign(options, this.additionalOpts());this.setProperties({title: htmlSafe(`${moment(this.executeAt).format("LLLL")}`),- notice: htmlSafe(`${I18n.t(this._noticeKey(), options)}`),+ notice: htmlSafe(`${i18n(this._noticeKey(), options)}`),showTopicTimer: true,});diff --git a/app/assets/javascripts/discourse/app/components/two-factor-backup-dropdown.js b/app/assets/javascripts/discourse/app/components/two-factor-backup-dropdown.jsindex 4032df92364..2bcdd2d716d 100644--- a/app/assets/javascripts/discourse/app/components/two-factor-backup-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/two-factor-backup-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -17,14 +17,14 @@ export default class TwoFactorBackupDropdown extends DropdownSelectBoxComponentcontent.push({id: "edit",icon: "pencil",- name: I18n.t("user.second_factor.edit"),+ name: i18n("user.second_factor.edit"),});if (this.secondFactorBackupEnabled) {content.push({id: "disable",icon: "trash-can",- name: I18n.t("user.second_factor.disable"),+ name: i18n("user.second_factor.disable"),});}diff --git a/app/assets/javascripts/discourse/app/components/uppy-image-uploader.js b/app/assets/javascripts/discourse/app/components/uppy-image-uploader.jsindex fe9ef9e3b0b..ef505eb7450 100644--- a/app/assets/javascripts/discourse/app/components/uppy-image-uploader.js+++ b/app/assets/javascripts/discourse/app/components/uppy-image-uploader.js@@ -17,7 +17,7 @@ import { authorizesOneOrMoreExtensions } from "discourse/lib/uploads";import UppyUpload from "discourse/lib/uppy/uppy-upload";import { getURLWithCDN } from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("image-uploader")export default class UppyImageUploader extends Component {@@ -73,7 +73,7 @@ export default class UppyImageUploader extends Component {@discourseComputed("disabled", "notAllowed")disabledReason(disabled, notAllowed) {if (disabled && notAllowed) {- return I18n.t("post.errors.no_uploads_authorized");+ return i18n("post.errors.no_uploads_authorized");}}diff --git a/app/assets/javascripts/discourse/app/components/user-card-contents.js b/app/assets/javascripts/discourse/app/components/user-card-contents.jsindex 80c9fa78e9a..b1b5316f3e2 100644--- a/app/assets/javascripts/discourse/app/components/user-card-contents.js+++ b/app/assets/javascripts/discourse/app/components/user-card-contents.js@@ -20,7 +20,7 @@ import CleansUp from "discourse/mixins/cleans-up";import User from "discourse/models/user";import { getURLWithCDN } from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@classNames("user-card")@classNameBindings(@@ -40,7 +40,7 @@ export default class UserCardContents extends CardContentsBase.extend(avatarSelector = "[data-user-card]";avatarDataAttrKey = "userCard";mentionSelector = "a.mention";- ariaLabel = I18n.t("user.card");+ ariaLabel = i18n("user.card");@setting("allow_profile_backgrounds") allowBackgrounds;@setting("enable_badges") showBadges;@@ -116,7 +116,7 @@ export default class UserCardContents extends CardContentsBase.extend(@discourseComputed("userTimezone")formattedUserLocalTime(timezone) {- return moment.tz(timezone).format(I18n.t("dates.time"));+ return moment.tz(timezone).format(i18n("dates.time"));}@discourseComputed("username")@@ -126,7 +126,7 @@ export default class UserCardContents extends CardContentsBase.extend(@discourseComputed("username", "topicPostCount")filterPostsLabel(username, count) {- return I18n.t("topic.filter_to", { username, count });+ return i18n("topic.filter_to", { username, count });}@discourseComputed("[email protected]")@@ -169,12 +169,12 @@ export default class UserCardContents extends CardContentsBase.extend(@discourseComputed("showRecentTimeRead", "user.time_read", "recentTimeRead")timeReadTooltip(showRecent, timeRead, recentTimeRead) {if (showRecent) {- return I18n.t("time_read_recently_tooltip", {+ return i18n("time_read_recently_tooltip", {time_read: durationTiny(timeRead),recent_time_read: recentTimeRead,});} else {- return I18n.t("time_read_tooltip", {+ return i18n("time_read_tooltip", {time_read: durationTiny(timeRead),});}diff --git a/app/assets/javascripts/discourse/app/components/user-flag-percentage.js b/app/assets/javascripts/discourse/app/components/user-flag-percentage.jsindex efe37f1c5fa..93f8c2ec3a0 100644--- a/app/assets/javascripts/discourse/app/components/user-flag-percentage.js+++ b/app/assets/javascripts/discourse/app/components/user-flag-percentage.js@@ -1,7 +1,7 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("")export default class UserFlagPercentage extends Component {@@ -37,14 +37,14 @@ export default class UserFlagPercentage extends Component {result.label = `${result.ignored}%`;}- result.title = I18n.t("review.user_percentage.summary", {- agreed: I18n.t("review.user_percentage.agreed", {+ result.title = i18n("review.user_percentage.summary", {+ agreed: i18n("review.user_percentage.agreed", {count: result.agreed,}),- disagreed: I18n.t("review.user_percentage.disagreed", {+ disagreed: i18n("review.user_percentage.disagreed", {count: result.disagreed,}),- ignored: I18n.t("review.user_percentage.ignored", {+ ignored: i18n("review.user_percentage.ignored", {count: result.ignored,}),count: total,diff --git a/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list.js b/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list.jsindex 50878aa5fcf..ea221d26fbf 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list.js+++ b/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list.js@@ -4,7 +4,7 @@ import UserMenuBookmarkItem from "discourse/lib/user-menu/bookmark-item";import UserMenuNotificationItem from "discourse/lib/user-menu/notification-item";import Bookmark from "discourse/models/bookmark";import Notification from "discourse/models/notification";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserMenuBookmarksList extends UserMenuNotificationsList {get dismissTypes() {@@ -16,7 +16,7 @@ export default class UserMenuBookmarksList extends UserMenuNotificationsList {}get showAllTitle() {- return I18n.t("user_menu.view_all_bookmarks");+ return i18n("user_menu.view_all_bookmarks");}get showDismiss() {@@ -24,7 +24,7 @@ export default class UserMenuBookmarksList extends UserMenuNotificationsList {}get dismissTitle() {- return I18n.t("user.dismiss_bookmarks_tooltip");+ return i18n("user.dismiss_bookmarks_tooltip");}get itemsCacheKey() {@@ -45,7 +45,7 @@ export default class UserMenuBookmarksList extends UserMenuNotificationsList {}get dismissConfirmationText() {- return I18n.t("notifications.dismiss_confirmation.body.bookmarks", {+ return i18n("notifications.dismiss_confirmation.body.bookmarks", {count: this.#unreadBookmarkRemindersCount,});}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/messages-list.js b/app/assets/javascripts/discourse/app/components/user-menu/messages-list.jsindex 9d3c34d0e02..dd62b95cdea 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/messages-list.js+++ b/app/assets/javascripts/discourse/app/components/user-menu/messages-list.js@@ -6,7 +6,7 @@ import UserMenuNotificationItem from "discourse/lib/user-menu/notification-item"import { mergeSortedLists } from "discourse/lib/utilities";import Notification from "discourse/models/notification";import Topic from "discourse/models/topic";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserMenuMessagesList extends UserMenuNotificationsList {@service store;@@ -20,7 +20,7 @@ export default class UserMenuMessagesList extends UserMenuNotificationsList {}get showAllTitle() {- return I18n.t("user_menu.view_all_messages");+ return i18n("user_menu.view_all_messages");}get showDismiss() {@@ -28,7 +28,7 @@ export default class UserMenuMessagesList extends UserMenuNotificationsList {}get dismissTitle() {- return I18n.t("user.dismiss_messages_tooltip");+ return i18n("user.dismiss_messages_tooltip");}get itemsCacheKey() {@@ -49,7 +49,7 @@ export default class UserMenuMessagesList extends UserMenuNotificationsList {}get dismissConfirmationText() {- return I18n.t("notifications.dismiss_confirmation.body.messages", {+ return i18n("notifications.dismiss_confirmation.body.messages", {count: this.#unreadMessagesNotifications,});}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/notifications-list.js b/app/assets/javascripts/discourse/app/components/user-menu/notifications-list.jsindex f351c4e2422..c6ea5767edb 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/notifications-list.js+++ b/app/assets/javascripts/discourse/app/components/user-menu/notifications-list.js@@ -12,7 +12,7 @@ import {} from "discourse/lib/utilities";import Notification from "discourse/models/notification";import UserMenuReviewable from "discourse/models/user-menu-reviewable";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const MAX_LIMIT = MAX_NOTIFICATIONS_LIMIT_PARAMS;const DEFAULT_LIMIT = 30;@@ -51,7 +51,7 @@ export default class UserMenuNotificationsList extends UserMenuItemsList {}get showAllTitle() {- return I18n.t("user_menu.view_all_notifications");+ return i18n("user_menu.view_all_notifications");}get showDismiss() {@@ -63,7 +63,7 @@ export default class UserMenuNotificationsList extends UserMenuItemsList {}get dismissTitle() {- return I18n.t("user.dismiss_notifications_tooltip");+ return i18n("user.dismiss_notifications_tooltip");}get itemsCacheKey() {@@ -88,7 +88,7 @@ export default class UserMenuNotificationsList extends UserMenuItemsList {}get dismissConfirmationText() {- return I18n.t("notifications.dismiss_confirmation.body.default", {+ return i18n("notifications.dismiss_confirmation.body.default", {count: this.currentUser.unread_high_priority_notifications,});}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/reviewables-list.js b/app/assets/javascripts/discourse/app/components/user-menu/reviewables-list.jsindex bc7bef1db0f..e44d9b7a041 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/reviewables-list.js+++ b/app/assets/javascripts/discourse/app/components/user-menu/reviewables-list.js@@ -4,7 +4,7 @@ import { ajax } from "discourse/lib/ajax";import UserMenuReviewableItem from "discourse/lib/user-menu/reviewable-item";import UserMenuReviewable from "discourse/models/user-menu-reviewable";import getUrl from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserMenuReviewablesList extends UserMenuItemsList {@service currentUser;@@ -16,7 +16,7 @@ export default class UserMenuReviewablesList extends UserMenuItemsList {}get showAllTitle() {- return I18n.t("user_menu.reviewable.view_all");+ return i18n("user_menu.reviewable.view_all");}get itemsCacheKey() {diff --git a/app/assets/javascripts/discourse/app/components/user-notification-schedule.js b/app/assets/javascripts/discourse/app/components/user-notification-schedule.jsindex 3fd9c01ffec..651716527f1 100644--- a/app/assets/javascripts/discourse/app/components/user-notification-schedule.js+++ b/app/assets/javascripts/discourse/app/components/user-notification-schedule.js@@ -1,7 +1,7 @@import Component from "@ember/component";import EmberObject, { action } from "@ember/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DAYS = ["monday",@@ -108,7 +108,7 @@ export default class UserNotificationSchedule extends Component {if (opts.includeNone) {timeOptions.push({- name: I18n.t("user.notification_schedule.none"),+ name: i18n("user.notification_schedule.none"),value: -1,});}@@ -123,7 +123,7 @@ export default class UserNotificationSchedule extends Component {if (hours === 24) {if (opts.showMidnight) {timeOptions.push({- name: I18n.t("user.notification_schedule.midnight"),+ name: i18n("user.notification_schedule.midnight"),value: 1440,});}diff --git a/app/assets/javascripts/discourse/app/components/user-preferences/passkey-options-dropdown.js b/app/assets/javascripts/discourse/app/components/user-preferences/passkey-options-dropdown.jsindex 784063bd419..07539f00aa2 100644--- a/app/assets/javascripts/discourse/app/components/user-preferences/passkey-options-dropdown.js+++ b/app/assets/javascripts/discourse/app/components/user-preferences/passkey-options-dropdown.js@@ -1,6 +1,6 @@import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -16,12 +16,12 @@ export default class PasskeyOptionsDropdown extends DropdownSelectBoxComponent {{id: "edit",icon: "pencil",- name: I18n.t("user.second_factor.edit"),+ name: i18n("user.second_factor.edit"),},{id: "delete",icon: "trash-can",- name: I18n.t("user.second_factor.delete"),+ name: i18n("user.second_factor.delete"),},];}diff --git a/app/assets/javascripts/discourse/app/components/user-preferences/rename-passkey.gjs b/app/assets/javascripts/discourse/app/components/user-preferences/rename-passkey.gjsindex ac8b739152f..6b0787be9bc 100644--- a/app/assets/javascripts/discourse/app/components/user-preferences/rename-passkey.gjs+++ b/app/assets/javascripts/discourse/app/components/user-preferences/rename-passkey.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class RenamePasskey extends Component {@service router;@@ -15,7 +15,7 @@ export default class RenamePasskey extends Component {@tracked passkeyName;@tracked errorMessage;- instructions = I18n.t("user.passkeys.rename_passkey_instructions");+ instructions = i18n("user.passkeys.rename_passkey_instructions");constructor() {super(...arguments);diff --git a/app/assets/javascripts/discourse/app/components/user-preferences/user-passkeys.gjs b/app/assets/javascripts/discourse/app/components/user-preferences/user-passkeys.gjsindex 810ff0c2037..6c4cdad5cb6 100644--- a/app/assets/javascripts/discourse/app/components/user-preferences/user-passkeys.gjs+++ b/app/assets/javascripts/discourse/app/components/user-preferences/user-passkeys.gjs@@ -15,8 +15,7 @@ import {stringToBuffer,WebauthnAbortHandler,} from "discourse/lib/webauthn";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserPasskeys extends Component {@service dialog;@@ -80,7 +79,7 @@ export default class UserPasskeys extends Component {type: credential.type,attestation: bufferToBase64(credential.response.attestationObject),clientData: bufferToBase64(credential.response.clientDataJSON),- name: I18n.t("user.passkeys.name.default"),+ name: i18n("user.passkeys.name.default"),};const registrationResponse = await this.args.model.registerPasskey(@@ -96,7 +95,7 @@ export default class UserPasskeys extends Component {// Prompt to rename key after creatingthis.dialog.dialog({- title: I18n.t("user.passkeys.passkey_successfully_created"),+ title: i18n("user.passkeys.passkey_successfully_created"),type: "notice",bodyComponent: RenamePasskey,bodyComponentModel: registrationResponse,@@ -106,8 +105,8 @@ export default class UserPasskeys extends Component {console.error(error);this.errorMessage =error.name === "InvalidStateError"- ? I18n.t("user.passkeys.already_added_error")- : I18n.t("user.passkeys.not_allowed_error");+ ? i18n("user.passkeys.already_added_error")+ : i18n("user.passkeys.not_allowed_error");this.dialog.alert(this.errorMessage);}}@@ -115,7 +114,7 @@ export default class UserPasskeys extends Component {confirmDelete(id) {schedule("afterRender", () => {this.dialog.deleteConfirm({- title: I18n.t("user.passkeys.confirm_delete_passkey"),+ title: i18n("user.passkeys.confirm_delete_passkey"),didConfirm: () => {this.args.model.deletePasskey(id).then(() => {this.router.refresh();@@ -132,7 +131,7 @@ export default class UserPasskeys extends Component {if (!trustedSession.success) {this.dialog.dialog({- title: I18n.t("user.confirm_access.title"),+ title: i18n("user.confirm_access.title"),type: "notice",bodyComponent: ConfirmSession,didConfirm: () => this.createPasskey(),@@ -152,7 +151,7 @@ export default class UserPasskeys extends Component {if (!trustedSession.success) {this.dialog.dialog({- title: I18n.t("user.confirm_access.title"),+ title: i18n("user.confirm_access.title"),type: "notice",bodyComponent: ConfirmSession,didConfirm: () => this.confirmDelete(id),@@ -168,7 +167,7 @@ export default class UserPasskeys extends Component {@actionrenamePasskey(id, name) {this.dialog.dialog({- title: I18n.t("user.passkeys.rename_passkey"),+ title: i18n("user.passkeys.rename_passkey"),type: "notice",bodyComponent: RenamePasskey,bodyComponentModel: { id, name },diff --git a/app/assets/javascripts/discourse/app/components/user-stat.gjs b/app/assets/javascripts/discourse/app/components/user-stat.gjsindex 290e7a61a88..59ef1cdf320 100644--- a/app/assets/javascripts/discourse/app/components/user-stat.gjs+++ b/app/assets/javascripts/discourse/app/components/user-stat.gjs@@ -3,7 +3,7 @@ import { htmlSafe } from "@ember/template";import formatDuration from "discourse/helpers/format-duration";import number from "discourse/helpers/number";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class UserStat extends Component {get type() {diff --git a/app/assets/javascripts/discourse/app/components/user-status-picker.gjs b/app/assets/javascripts/discourse/app/components/user-status-picker.gjsindex 589d2cfd2b0..848b551c605 100644--- a/app/assets/javascripts/discourse/app/components/user-status-picker.gjs+++ b/app/assets/javascripts/discourse/app/components/user-status-picker.gjs@@ -10,7 +10,7 @@ import concatClass from "discourse/helpers/concat-class";import { emojiUnescape } from "discourse/lib/text";import { escapeExpression } from "discourse/lib/utilities";import autoFocus from "discourse/modifiers/auto-focus";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class UserStatusPicker extends Component {@tracked isFocused = false;diff --git a/app/assets/javascripts/discourse/app/components/user-stream.js b/app/assets/javascripts/discourse/app/components/user-stream.jsindex 5b6e7f416c2..478c882faf7 100644--- a/app/assets/javascripts/discourse/app/components/user-stream.js+++ b/app/assets/javascripts/discourse/app/components/user-stream.js@@ -13,7 +13,7 @@ import LoadMore from "discourse/mixins/load-more";import { NEW_TOPIC_KEY } from "discourse/models/composer";import Draft from "discourse/models/draft";import Post from "discourse/models/post";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@tagName("ul")@classNames("user-stream")@@ -113,7 +113,7 @@ export default class UserStream extends Component.extend(LoadMore) {const stream = this.stream;this.dialog.yesNoConfirm({- message: I18n.t("drafts.remove_confirmation"),+ message: i18n("drafts.remove_confirmation"),didConfirm: () => {Draft.clear(draft.draft_key, draft.sequence).then(() => {diff --git a/app/assets/javascripts/discourse/app/components/user-summary-section.gjs b/app/assets/javascripts/discourse/app/components/user-summary-section.gjsindex 6f9c903eac3..9a1e4ea0d8c 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-section.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-section.gjs@@ -1,5 +1,5 @@import { concat } from "@ember/helper";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const UserSummarySection = <template><div class="top-sub-section" ...attributes>diff --git a/app/assets/javascripts/discourse/app/components/user-tip.gjs b/app/assets/javascripts/discourse/app/components/user-tip.gjsindex 847028ebfda..c221743585c 100644--- a/app/assets/javascripts/discourse/app/components/user-tip.gjs+++ b/app/assets/javascripts/discourse/app/components/user-tip.gjs@@ -7,7 +7,7 @@ import UserTipContainer from "discourse/components/user-tip-container";import helperFn from "discourse/helpers/helper-fn";import escape from "discourse-common/lib/escape";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DTooltipInstance from "float-kit/lib/d-tooltip-instance";export default class UserTip extends Component {@@ -36,7 +36,7 @@ export default class UserTip extends Component {document.querySelector(this.args.triggerSelector);let buttonText = escape(- I18n.t(this.args.buttonLabel || "user_tips.button")+ i18n(this.args.buttonLabel || "user_tips.button"));if (this.args.buttonIcon) {buttonText = `${iconHTML(this.args.buttonIcon)} ${buttonText}`;@@ -57,7 +57,7 @@ export default class UserTip extends Component {? escape(this.args.contentText): null,buttonText,- buttonSkipText: I18n.t("user_tips.skip"),+ buttonSkipText: i18n("user_tips.skip"),showSkipButton: this.args.showSkipButton,},});diff --git a/app/assets/javascripts/discourse/app/components/username-preference.gjs b/app/assets/javascripts/discourse/app/components/username-preference.gjsindex 8a5a00e8dec..ad4337450f8 100644--- a/app/assets/javascripts/discourse/app/components/username-preference.gjs+++ b/app/assets/javascripts/discourse/app/components/username-preference.gjs@@ -13,8 +13,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import { setting } from "discourse/lib/computed";import DiscourseURL, { userPath } from "discourse/lib/url";import User from "discourse/models/user";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UsernamePreference extends Component {@service siteSettings;@@ -38,7 +37,7 @@ export default class UsernamePreference extends Component {}get saveButtonText() {- return this.saving ? I18n.t("saving") : I18n.t("user.change");+ return this.saving ? i18n("saving") : i18n("user.change");}@action@@ -66,7 +65,7 @@ export default class UsernamePreference extends Component {}if (this.newUsername.length < this.minLength) {- this.errorMessage = I18n.t("user.name.too_short");+ this.errorMessage = i18n("user.name.too_short");return;}@@ -86,7 +85,7 @@ export default class UsernamePreference extends Component {@actionchangeUsername() {return this.dialog.yesNoConfirm({- title: I18n.t("user.change_username.confirm"),+ title: i18n("user.change_username.confirm"),didConfirm: async () => {this.saving = true;diff --git a/app/assets/javascripts/discourse/app/controllers/account-created-index.js b/app/assets/javascripts/discourse/app/controllers/account-created-index.jsindex aa9192fdc6d..060c47e3460 100644--- a/app/assets/javascripts/discourse/app/controllers/account-created-index.js+++ b/app/assets/javascripts/discourse/app/controllers/account-created-index.js@@ -3,14 +3,14 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { resendActivationEmail } from "discourse/lib/user-activation";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AccountCreatedIndexController extends Controller {@service router;@discourseComputedwelcomeTitle() {- return I18n.t("invites.welcome_to", {+ return i18n("invites.welcome_to", {site_name: this.siteSettings.title,});}diff --git a/app/assets/javascripts/discourse/app/controllers/badges/show.js b/app/assets/javascripts/discourse/app/controllers/badges/show.jsindex 2742ddd4033..7730b2fa780 100644--- a/app/assets/javascripts/discourse/app/controllers/badges/show.js+++ b/app/assets/javascripts/discourse/app/controllers/badges/show.js@@ -3,7 +3,7 @@ import EmberObject, { action } from "@ember/object";import Badge from "discourse/models/badge";import UserBadge from "discourse/models/user-badge";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ShowController extends Controller {@controller application;@@ -23,7 +23,7 @@ export default class ShowController extends Controller {return [EmberObject.create({id: 0,- badge: Badge.create({ name: I18n.t("badges.none") }),+ badge: Badge.create({ name: i18n("badges.none") }),}),...filteredList.uniqBy("badge.name"),];diff --git a/app/assets/javascripts/discourse/app/controllers/confirm-new-email.js b/app/assets/javascripts/discourse/app/controllers/confirm-new-email.jsindex da6378d4ffa..a6a1ff94863 100644--- a/app/assets/javascripts/discourse/app/controllers/confirm-new-email.js+++ b/app/assets/javascripts/discourse/app/controllers/confirm-new-email.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ConfirmNewEmailController extends Controller {@service dialog;@@ -35,7 +35,7 @@ export default class ConfirmNewEmailController extends Controller {await new Promise((resolve) =>this.dialog.dialog({- message: I18n.t("user.change_email.confirm_success"),+ message: i18n("user.change_email.confirm_success"),type: "alert",didConfirm: resolve,})diff --git a/app/assets/javascripts/discourse/app/controllers/confirm-old-email.js b/app/assets/javascripts/discourse/app/controllers/confirm-old-email.jsindex 0d018a069c6..da6ab16bbe9 100644--- a/app/assets/javascripts/discourse/app/controllers/confirm-old-email.js+++ b/app/assets/javascripts/discourse/app/controllers/confirm-old-email.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ConfirmOldEmailController extends Controller {@service dialog;@@ -28,7 +28,7 @@ export default class ConfirmOldEmailController extends Controller {await new Promise((resolve) =>this.dialog.dialog({- message: I18n.t("user.change_email.authorizing_old.confirm_success"),+ message: i18n("user.change_email.authorizing_old.confirm_success"),type: "alert",didConfirm: resolve,})diff --git a/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js b/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.jsindex baf020282bd..21b423053e6 100644--- a/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js+++ b/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js@@ -9,7 +9,7 @@ import DiscourseURL from "discourse/lib/url";import Category from "discourse/models/category";import PermissionType from "discourse/models/permission-type";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EditCategoryTabsController extends Controller {@service dialog;@@ -50,7 +50,7 @@ export default class EditCategoryTabsController extends Controller {@discourseComputed("name")categoryName(name) {name = name || "";- return name.trim().length > 0 ? name : I18n.t("preview");+ return name.trim().length > 0 ? name : i18n("preview");}@discourseComputed("saving", "model.id")@@ -64,15 +64,15 @@ export default class EditCategoryTabsController extends Controller {@discourseComputed("model.id", "model.name")title(id, name) {return id- ? I18n.t("category.edit_dialog_title", {+ ? i18n("category.edit_dialog_title", {categoryName: name,})- : I18n.t("category.create");+ : i18n("category.create");}@discourseComputed("selectedTab")selectedTabTitle(tab) {- return I18n.t(`category.${underscore(tab)}`);+ return i18n(`category.${underscore(tab)}`);}@action@@ -119,7 +119,7 @@ export default class EditCategoryTabsController extends Controller {deleteCategory() {this.set("deleting", true);this.dialog.yesNoConfirm({- message: I18n.t("category.delete_confirm"),+ message: i18n("category.delete_confirm"),didConfirm: () => {this.model.destroy()@@ -127,7 +127,7 @@ export default class EditCategoryTabsController extends Controller {this.router.transitionTo("discovery.categories");}).catch(() => {- this.displayErrors([I18n.t("category.delete_error")]);+ this.displayErrors([i18n("category.delete_error")]);}).finally(() => {this.set("deleting", false);diff --git a/app/assets/javascripts/discourse/app/controllers/exception.js b/app/assets/javascripts/discourse/app/controllers/exception.jsindex 1f361e15ca4..b23ee4f07ae 100644--- a/app/assets/javascripts/discourse/app/controllers/exception.js+++ b/app/assets/javascripts/discourse/app/controllers/exception.js@@ -5,7 +5,7 @@ import { alias, equal, gte, none } from "@ember/object/computed";import { schedule } from "@ember/runloop";import DiscourseURL from "discourse/lib/url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";/*** You can throw an instance of this error during a route's beforeModel/model/afterModel hooks.@@ -65,18 +65,18 @@ export default class ExceptionController extends Controller {if (thrown.reason) {return thrown.reason;} else if (isNetwork) {- return I18n.t("errors.reasons.network");+ return i18n("errors.reasons.network");} else if (thrownStatus >= 500) {- return I18n.t("errors.reasons.server");+ return i18n("errors.reasons.server");} else if (thrownStatus === 404) {- return I18n.t("errors.reasons.not_found");+ return i18n("errors.reasons.not_found");} else if (thrownStatus === 403) {- return I18n.t("errors.reasons.forbidden");+ return i18n("errors.reasons.forbidden");} else if (thrown === null) {- return I18n.t("errors.reasons.unknown");+ return i18n("errors.reasons.unknown");} else {// TODO- return I18n.t("errors.reasons.unknown");+ return i18n("errors.reasons.unknown");}}@@ -91,22 +91,22 @@ export default class ExceptionController extends Controller {if (thrown.desc) {return thrown.desc;} else if (networkFixed) {- return I18n.t("errors.desc.network_fixed");+ return i18n("errors.desc.network_fixed");} else if (isNetwork) {- return I18n.t("errors.desc.network");+ return i18n("errors.desc.network");} else if (thrownStatus === 404) {- return I18n.t("errors.desc.not_found");+ return i18n("errors.desc.not_found");} else if (thrownStatus === 403) {- return I18n.t("errors.desc.forbidden");+ return i18n("errors.desc.forbidden");} else if (thrownStatus >= 500) {- return I18n.t("errors.desc.server", {+ return i18n("errors.desc.server", {status: thrownStatus + " " + thrownStatusText,});} else if (thrown === null) {- return I18n.t("errors.desc.unknown");+ return i18n("errors.desc.unknown");} else {// TODO- return I18n.t("errors.desc.unknown");+ return i18n("errors.desc.unknown");}}diff --git a/app/assets/javascripts/discourse/app/controllers/full-page-search.js b/app/assets/javascripts/discourse/app/controllers/full-page-search.jsindex a7328707875..40f104c6a4b 100644--- a/app/assets/javascripts/discourse/app/controllers/full-page-search.js+++ b/app/assets/javascripts/discourse/app/controllers/full-page-search.js@@ -24,7 +24,7 @@ import { scrollTop } from "discourse/mixins/scroll-top";import Category from "discourse/models/category";import Composer from "discourse/models/composer";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const SEARCH_TYPE_DEFAULT = "topics_posts";export const SEARCH_TYPE_CATS_TAGS = "categories_tags";@@ -90,19 +90,19 @@ export default class FullPageSearchController extends Controller {);const searchTypes = [- { name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },+ { name: i18n("search.type.default"), id: SEARCH_TYPE_DEFAULT },{name: this.siteSettings.tagging_enabled- ? I18n.t("search.type.categories_and_tags")- : I18n.t("search.type.categories"),+ ? i18n("search.type.categories_and_tags")+ : i18n("search.type.categories"),id: SEARCH_TYPE_CATS_TAGS,},- { name: I18n.t("search.type.users"), id: SEARCH_TYPE_USERS },+ { name: i18n("search.type.users"), id: SEARCH_TYPE_USERS },];customSearchTypes.forEach((type) => {searchTypes.push({- name: I18n.t(type.translationKey),+ name: i18n(type.translationKey),id: type.searchTypeId,});});@@ -110,12 +110,12 @@ export default class FullPageSearchController extends Controller {this.set("searchTypes", searchTypes);this.sortOrders = [- { name: I18n.t("search.relevance"), id: 0 },- { name: I18n.t("search.latest_post"), id: 1, term: "order:latest" },- { name: I18n.t("search.most_liked"), id: 2, term: "order:likes" },- { name: I18n.t("search.most_viewed"), id: 3, term: "order:views" },+ { name: i18n("search.relevance"), id: 0 },+ { name: i18n("search.latest_post"), id: 1, term: "order:latest" },+ { name: i18n("search.most_liked"), id: 2, term: "order:likes" },+ { name: i18n("search.most_viewed"), id: 3, term: "order:views" },{- name: I18n.t("search.latest_topic"),+ name: i18n("search.latest_topic"),id: 4,term: "order:latest_topic",},@@ -267,7 +267,7 @@ export default class FullPageSearchController extends Controller {@discourseComputed("resultCount", "noSortQ")resultCountLabel(count, term) {const plus = count % 50 === 0 ? "+" : "";- return I18n.t("search.result_count", { count, plus, term });+ return i18n("search.result_count", { count, plus, term });}@observes("model.{posts,categories,tags,users}.length", "searchResultPosts")diff --git a/app/assets/javascripts/discourse/app/controllers/group.js b/app/assets/javascripts/discourse/app/controllers/group.jsindex 9ba81fd4e20..798ec853758 100644--- a/app/assets/javascripts/discourse/app/controllers/group.js+++ b/app/assets/javascripts/discourse/app/controllers/group.js@@ -3,7 +3,7 @@ import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";import GroupDeleteDialog from "discourse/components/dialog-messages/group-delete";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";class Tab extends EmberObject {init() {@@ -11,7 +11,7 @@ class Tab extends EmberObject {this.setProperties({route: this.route || `group.${this.name}`,- message: I18n.t(`groups.${this.i18nKey || this.name}`),+ message: i18n(`groups.${this.i18nKey || this.name}`),});}}@@ -138,7 +138,7 @@ export default class GroupController extends Controller {const model = this.model;this.dialog.deleteConfirm({- title: I18n.t("admin.groups.delete_confirm", { group: model.name }),+ title: i18n("admin.groups.delete_confirm", { group: model.name }),bodyComponent: GroupDeleteDialog,bodyComponentModel: model,didConfirm: () => {@@ -147,7 +147,7 @@ export default class GroupController extends Controller {.catch((error) => {// eslint-disable-next-line no-consoleconsole.error(error);- this.dialog.alert(I18n.t("admin.groups.delete_failed"));+ this.dialog.alert(i18n("admin.groups.delete_failed"));}).then(() => {this.router.transitionTo("groups.index");diff --git a/app/assets/javascripts/discourse/app/controllers/groups-index.js b/app/assets/javascripts/discourse/app/controllers/groups-index.jsindex 33ce6fae518..76318082cf4 100644--- a/app/assets/javascripts/discourse/app/controllers/groups-index.js+++ b/app/assets/javascripts/discourse/app/controllers/groups-index.js@@ -4,7 +4,7 @@ import { service } from "@ember/service";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 { i18n } from "discourse-i18n";export default class GroupsIndexController extends Controller {@service router;@@ -23,7 +23,7 @@ export default class GroupsIndexController extends Controller {if (typeFilters) {typeFilters.forEach((type) =>- types.push({ id: type, name: I18n.t(`groups.index.${type}_groups`) })+ types.push({ id: type, name: i18n(`groups.index.${type}_groups`) }));}diff --git a/app/assets/javascripts/discourse/app/controllers/groups-new.js b/app/assets/javascripts/discourse/app/controllers/groups-new.jsindex 006022900c5..e60b0166158 100644--- a/app/assets/javascripts/discourse/app/controllers/groups-new.js+++ b/app/assets/javascripts/discourse/app/controllers/groups-new.js@@ -4,7 +4,7 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function popupAutomaticMembershipAlert(group_id, email_domains) {if (!email_domains) {@@ -26,10 +26,9 @@ export function popupAutomaticMembershipAlert(group_id, email_domains) {if (count > 0) {this.dialog.alert(- I18n.t(- "admin.groups.manage.membership.automatic_membership_user_count",- { count }- )+ i18n("admin.groups.manage.membership.automatic_membership_user_count", {+ count,+ }));}});diff --git a/app/assets/javascripts/discourse/app/controllers/invites-show.js b/app/assets/javascripts/discourse/app/controllers/invites-show.jsindex 58e4144c03b..f88d513be7b 100644--- a/app/assets/javascripts/discourse/app/controllers/invites-show.js+++ b/app/assets/javascripts/discourse/app/controllers/invites-show.js@@ -13,7 +13,7 @@ import UsernameValidation from "discourse/mixins/username-validation";import { findAll as findLoginMethods } from "discourse/models/login-method";import getUrl from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class InvitesShowController extends Controller.extend(PasswordValidation,@@ -65,14 +65,14 @@ export default class InvitesShowController extends Controller.extend(@discourseComputedwelcomeTitle() {- return I18n.t("invites.welcome_to", {+ return i18n("invites.welcome_to", {site_name: this.siteSettings.title,});}@discourseComputed("email")yourEmailMessage(email) {- return I18n.t("invites.your_email", { email });+ return i18n("invites.your_email", { email });}@discourseComputed@@ -186,7 +186,7 @@ export default class InvitesShowController extends Controller.extend(if (hiddenEmail && !differentExternalEmail) {return EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),});}@@ -200,7 +200,7 @@ export default class InvitesShowController extends Controller.extend(if (rejectedEmails.includes(email)) {return EmberObject.create({failed: true,- reason: I18n.t("user.email.invalid"),+ reason: i18n("user.email.invalid"),});}@@ -212,14 +212,14 @@ export default class InvitesShowController extends Controller.extend(if (externalAuthEmail === email) {return EmberObject.create({ok: true,- reason: I18n.t("user.email.authenticated", {+ reason: i18n("user.email.authenticated", {provider,}),});} else {return EmberObject.create({failed: true,- reason: I18n.t("user.email.invite_auth_email_invalid", {+ reason: i18n("user.email.invite_auth_email_invalid", {provider,}),});@@ -229,20 +229,20 @@ export default class InvitesShowController extends Controller.extend(if (emailVerifiedByLink) {return EmberObject.create({ok: true,- reason: I18n.t("user.email.authenticated_by_invite"),+ reason: i18n("user.email.authenticated_by_invite"),});}if (emailValid(email)) {return EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),});}return EmberObject.create({failed: true,- reason: I18n.t("user.email.invalid"),+ reason: i18n("user.email.invalid"),});}@@ -261,7 +261,7 @@ export default class InvitesShowController extends Controller.extend(@discourseComputeddisclaimerHtml() {if (this.site.tos_url && this.site.privacy_policy_url) {- return I18n.t("create_account.disclaimer", {+ return i18n("create_account.disclaimer", {tos_link: this.site.tos_url,privacy_link: this.site.privacy_policy_url,});@@ -273,9 +273,9 @@ export default class InvitesShowController extends Controller.extend(if (!url) {return;}- return I18n.t("create_account.associate", {+ return i18n("create_account.associate", {associate_link: url,- provider: I18n.t(`login.${provider}.name`),+ provider: i18n(`login.${provider}.name`),});}@@ -323,10 +323,7 @@ export default class InvitesShowController extends Controller.extend(}).then((result) => {if (result.success) {- this.set(- "successMessage",- result.message || I18n.t("invites.success")- );+ this.set("successMessage", result.message || i18n("invites.success"));if (result.redirect_to) {DiscourseURL.redirectTo(result.redirect_to);}diff --git a/app/assets/javascripts/discourse/app/controllers/login.js b/app/assets/javascripts/discourse/app/controllers/login.jsindex 670c201b8e5..25ac5b110ef 100644--- a/app/assets/javascripts/discourse/app/controllers/login.js+++ b/app/assets/javascripts/discourse/app/controllers/login.js@@ -19,7 +19,7 @@ import { findAll } from "discourse/models/login-method";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import escape from "discourse-common/lib/escape";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class LoginPageController extends Controller {@service siteSettings;@@ -202,7 +202,7 @@ export default class LoginPageController extends Controller {@actionshowCreateAccount(createAccountProps = {}) {if (this.site.isReadOnly) {- this.dialog.alert(I18n.t("read_only_mode.login_disabled"));+ this.dialog.alert(i18n("read_only_mode.login_disabled"));} else {this.handleShowCreateAccount(createAccountProps);}@@ -240,7 +240,7 @@ export default class LoginPageController extends Controller {}if (isEmpty(this.loginName) || isEmpty(this.loginPassword)) {- this.flash = I18n.t("login.blank_username_or_password");+ this.flash = i18n("login.blank_username_or_password");this.flashType = "error";return;}@@ -290,7 +290,7 @@ export default class LoginPageController extends Controller {this.dialog.alert(result.error);} else if (result.reason === "expired") {this.flash = htmlSafe(- I18n.t("login.password_expired", {+ i18n("login.password_expired", {reset_url: getURL("/password-reset"),}));@@ -348,20 +348,20 @@ export default class LoginPageController extends Controller {} catch (e) {// Failed to loginif (e.jqXHR && e.jqXHR.status === 429) {- this.flash = I18n.t("login.rate_limit");+ this.flash = i18n("login.rate_limit");this.flashType = "error";} else if (e.jqXHR &&e.jqXHR.status === 503 &&e.jqXHR.responseJSON.error_type === "read_only") {- this.flash = I18n.t("read_only_mode.login_disabled");+ this.flash = i18n("read_only_mode.login_disabled");this.flashType = "error";} else if (!areCookiesEnabled()) {- this.flash = I18n.t("login.cookies_error");+ this.flash = i18n("login.cookies_error");this.flashType = "error";} else {- this.flash = I18n.t("login.error");+ this.flash = i18n("login.error");this.flashType = "error";}this.loggingIn = false;diff --git a/app/assets/javascripts/discourse/app/controllers/password-reset.js b/app/assets/javascripts/discourse/app/controllers/password-reset.jsindex d8116ec76ef..6de634dc621 100644--- a/app/assets/javascripts/discourse/app/controllers/password-reset.js+++ b/app/assets/javascripts/discourse/app/controllers/password-reset.js@@ -9,7 +9,7 @@ import PasswordValidation from "discourse/mixins/password-validation";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PasswordResetController extends Controller.extend(PasswordValidation@@ -55,7 +55,7 @@ export default class PasswordResetController extends Controller.extend(@discourseComputed()continueButtonText() {- return I18n.t("password_reset.continue", {+ return i18n("password_reset.continue", {site_name: this.siteSettings.title,});}@@ -134,7 +134,7 @@ export default class PasswordResetController extends Controller.extend(}} catch (e) {if (e.jqXHR?.status === 429) {- this.set("errorMessage", I18n.t("user.second_factor.rate_limit"));+ this.set("errorMessage", i18n("user.second_factor.rate_limit"));} else {throw new Error(e);}diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/account.js b/app/assets/javascripts/discourse/app/controllers/preferences/account.jsindex e0ca2c3f321..5efbaf9f83e 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/account.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/account.js@@ -12,7 +12,7 @@ import CanCheckEmails from "discourse/mixins/can-check-emails";import { findAll } from "discourse/models/login-method";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AccountController extends Controller.extend(CanCheckEmails@@ -58,7 +58,7 @@ export default class AccountController extends Controller.extend(@discourseComputed()nameInstructions() {- return I18n.t(+ return i18n(this.siteSettings.full_name_required? "user.name.instructions_required": "user.name.instructions"@@ -206,18 +206,18 @@ export default class AccountController extends Controller.extend(@actiondelete() {this.dialog.alert({- message: I18n.t("user.delete_account_confirm"),+ message: i18n("user.delete_account_confirm"),buttons: [{icon: "triangle-exclamation",- label: I18n.t("user.delete_account"),+ label: i18n("user.delete_account"),class: "btn-danger",action: () => {return this.model.delete().then(() => {next(() => {this.dialog.alert({- message: I18n.t("user.deleted_yourself"),+ message: i18n("user.deleted_yourself"),didConfirm: () =>DiscourseURL.redirectAbsolute(getURL("/")),didCancel: () => DiscourseURL.redirectAbsolute(getURL("/")),@@ -226,7 +226,7 @@ export default class AccountController extends Controller.extend(},() => {next(() =>- this.dialog.alert(I18n.t("user.delete_yourself_not_allowed"))+ this.dialog.alert(i18n("user.delete_yourself_not_allowed")));this.set("deleting", false);}@@ -234,7 +234,7 @@ export default class AccountController extends Controller.extend(},},{- label: I18n.t("composer.cancel"),+ label: i18n("composer.cancel"),},],});@@ -265,7 +265,7 @@ export default class AccountController extends Controller.extend(@actionexportUserArchive() {this.dialog.yesNoConfirm({- message: I18n.t("user.download_archive.confirm"),+ message: i18n("user.download_archive.confirm"),didConfirm: () => exportUserArchive(),});}diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/email.js b/app/assets/javascripts/discourse/app/controllers/preferences/email.jsindex 31baf1b4e07..0a128f393f6 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/email.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/email.js@@ -4,7 +4,7 @@ import { empty, or } from "@ember/object/computed";import { propertyEqual } from "discourse/lib/computed";import { emailValid } from "discourse/lib/utilities";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EmailController extends Controller {queryParams = ["new"];@@ -31,12 +31,12 @@ export default class EmailController extends Controller {@discourseComputed("saving", "new")saveButtonText(saving, isNew) {if (saving) {- return I18n.t("saving");+ return i18n("saving");}if (isNew) {- return I18n.t("user.add_email.add");+ return i18n("user.add_email.add");}- return I18n.t("user.change");+ return i18n("user.change");}@discourseComputed("newEmail")@@ -49,7 +49,7 @@ export default class EmailController extends Controller {if (invalidEmail && (oldEmail || newEmail)) {return EmberObject.create({failed: true,- reason: I18n.t("user.email.invalid"),+ reason: i18n("user.email.invalid"),});}}@@ -77,15 +77,15 @@ export default class EmailController extends Controller {this.set("success", true);if (this.model.staff) {- this.set("successMessage", I18n.t("user.change_email.success_staff"));+ this.set("successMessage", i18n("user.change_email.success_staff"));} else {if (this.currentUser.admin) {this.set("successMessage",- I18n.t("user.change_email.success_via_admin")+ i18n("user.change_email.success_via_admin"));} else {- this.set("successMessage", I18n.t("user.change_email.success"));+ this.set("successMessage", i18n("user.change_email.success"));}}},@@ -98,7 +98,7 @@ export default class EmailController extends Controller {) {this.set("errorMessage", e.jqXHR.responseJSON.errors[0]);} else {- this.set("errorMessage", I18n.t("user.change_email.error"));+ this.set("errorMessage", i18n("user.change_email.error"));}});diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/emails.js b/app/assets/javascripts/discourse/app/controllers/preferences/emails.jsindex e2d99137019..e95b96164c1 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/emails.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/emails.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { equal } from "@ember/object/computed";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const EMAIL_LEVELS = {ALWAYS: 0,@@ -12,7 +12,7 @@ const EMAIL_LEVELS = {};export default class EmailsController extends Controller {- subpageTitle = I18n.t("user.preferences_nav.emails");+ subpageTitle = i18n("user.preferences_nav.emails");@equal("model.user_option.email_messages_level", EMAIL_LEVELS.ONLY_WHEN_AWAY)emailMessagesLevelAway;@@ -33,36 +33,36 @@ export default class EmailsController extends Controller {];previousRepliesOptions = [- { name: I18n.t("user.email_previous_replies.always"), value: 0 },- { name: I18n.t("user.email_previous_replies.unless_emailed"), value: 1 },- { name: I18n.t("user.email_previous_replies.never"), value: 2 },+ { name: i18n("user.email_previous_replies.always"), value: 0 },+ { name: i18n("user.email_previous_replies.unless_emailed"), value: 1 },+ { name: i18n("user.email_previous_replies.never"), value: 2 },];emailLevelOptions = [- { name: I18n.t("user.email_level.always"), value: EMAIL_LEVELS.ALWAYS },+ { name: i18n("user.email_level.always"), value: EMAIL_LEVELS.ALWAYS },{- name: I18n.t("user.email_level.only_when_away"),+ name: i18n("user.email_level.only_when_away"),value: EMAIL_LEVELS.ONLY_WHEN_AWAY,},- { name: I18n.t("user.email_level.never"), value: EMAIL_LEVELS.NEVER },+ { name: i18n("user.email_level.never"), value: EMAIL_LEVELS.NEVER },];digestFrequencies = [- { name: I18n.t("user.email_digests.every_30_minutes"), value: 30 },- { name: I18n.t("user.email_digests.every_hour"), value: 60 },- { name: I18n.t("user.email_digests.daily"), value: 1440 },- { name: I18n.t("user.email_digests.weekly"), value: 10080 },- { name: I18n.t("user.email_digests.every_month"), value: 43200 },- { name: I18n.t("user.email_digests.every_six_months"), value: 259200 },+ { name: i18n("user.email_digests.every_30_minutes"), value: 30 },+ { name: i18n("user.email_digests.every_hour"), value: 60 },+ { name: i18n("user.email_digests.daily"), value: 1440 },+ { name: i18n("user.email_digests.weekly"), value: 10080 },+ { name: i18n("user.email_digests.every_month"), value: 43200 },+ { name: i18n("user.email_digests.every_six_months"), value: 259200 },];@discourseComputed()frequencyEstimate() {let estimate = this.get("model.mailing_list_posts_per_day");if (!estimate || estimate < 2) {- return I18n.t("user.mailing_list_mode.few_per_day");+ return i18n("user.mailing_list_mode.few_per_day");} else {- return I18n.t("user.mailing_list_mode.many_per_day", {+ return i18n("user.mailing_list_mode.many_per_day", {dailyEmailEstimate: estimate,});}@@ -72,14 +72,14 @@ export default class EmailsController extends Controller {mailingListModeOptions() {return [{ name: this.frequencyEstimate, value: 1 },- { name: I18n.t("user.mailing_list_mode.individual_no_echo"), value: 2 },+ { name: i18n("user.mailing_list_mode.individual_no_echo"), value: 2 },];}@discourseComputed()emailFrequencyInstructions() {return this.siteSettings.email_time_window_mins- ? I18n.t("user.email.frequency", {+ ? i18n("user.email.frequency", {count: this.siteSettings.email_time_window_mins,}): null;diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js b/app/assets/javascripts/discourse/app/controllers/preferences/interface.jsindex cc364421037..7c21198ad95 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js@@ -14,7 +14,7 @@ import { listThemes, setLocalTheme } from "discourse/lib/theme-selector";import { setDefaultHomepage } from "discourse/lib/utilities";import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// same as UserOption::HOMEPAGESconst USER_HOMES = {@@ -41,15 +41,13 @@ export default class InterfaceController extends Controller {makeColorSchemeDefault = true;@propertyEqual("model.id", "currentUser.id") canPreviewColorScheme;- subpageTitle = I18n.t("user.preferences_nav.interface");+ subpageTitle = i18n("user.preferences_nav.interface");@reads("userSelectableColorSchemes.length") showColorSchemeSelector;@not("currentSchemeCanBeSelected") showColorSchemeNoneItem;- selectedColorSchemeNoneLabel = I18n.t(- "user.color_schemes.default_description"- );+ selectedColorSchemeNoneLabel = i18n("user.color_schemes.default_description");init() {super.init(...arguments);@@ -105,7 +103,7 @@ export default class InterfaceController extends Controller {@discourseComputedtextSizes() {return TEXT_SIZES.map((value) => {- return { name: I18n.t(`user.text_size.${value}`), value };+ return { name: i18n(`user.text_size.${value}`), value };});}@@ -120,7 +118,7 @@ export default class InterfaceController extends Controller {@discourseComputedtitleCountModes() {return TITLE_COUNT_MODES.map((value) => {- return { name: I18n.t(`user.title_count_mode.${value}`), value };+ return { name: i18n(`user.title_count_mode.${value}`), value };});}@@ -129,7 +127,7 @@ export default class InterfaceController extends Controller {return Object.keys(AUTO_DELETE_PREFERENCES).map((key) => {return {value: AUTO_DELETE_PREFERENCES[key],- name: I18n.t(`bookmarks.auto_delete_preference.${key.toLowerCase()}`),+ name: i18n(`bookmarks.auto_delete_preference.${key.toLowerCase()}`),};});}@@ -211,7 +209,7 @@ export default class InterfaceController extends Controller {if (this.model.canPickThemeWithCustomHomepage) {result.push({- name: I18n.t("user.homepage.default"),+ name: i18n("user.homepage.default"),value: -1,});}@@ -226,7 +224,7 @@ export default class InterfaceController extends Controller {availableIds.forEach((m) => {let id = homeValues[m];if (id) {- result.push({ name: I18n.t(`filters.${m}.title`), value: Number(id) });+ result.push({ name: i18n(`filters.${m}.title`), value: Number(id) });}});diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/navigation-menu.js b/app/assets/javascripts/discourse/app/controllers/preferences/navigation-menu.jsindex 793b1f0f63a..2faf4aa953a 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/navigation-menu.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/navigation-menu.js@@ -2,12 +2,12 @@ import { tracked } from "@glimmer/tracking";import Controller from "@ember/controller";import { action } from "@ember/object";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends Controller {@tracked saved = false;- subpageTitle = I18n.t("user.preferences_nav.navigation_menu");+ subpageTitle = i18n("user.preferences_nav.navigation_menu");saveAttrNames = ["sidebar_link_to_filtered_list",diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/notifications.js b/app/assets/javascripts/discourse/app/controllers/preferences/notifications.jsindex 0035f70ea38..17b9ac64c86 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/notifications.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/notifications.js@@ -1,10 +1,10 @@import Controller from "@ember/controller";import { action } from "@ember/object";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NotificationsController extends Controller {- subpageTitle = I18n.t("user.preferences_nav.notifications");+ subpageTitle = i18n("user.preferences_nav.notifications");init() {super.init(...arguments);@@ -21,13 +21,13 @@ export default class NotificationsController extends Controller {];this.likeNotificationFrequencies = [- { name: I18n.t("user.like_notification_frequency.always"), value: 0 },+ { name: i18n("user.like_notification_frequency.always"), value: 0 },{- name: I18n.t("user.like_notification_frequency.first_time_and_daily"),+ name: i18n("user.like_notification_frequency.first_time_and_daily"),value: 1,},- { name: I18n.t("user.like_notification_frequency.first_time"), value: 2 },- { name: I18n.t("user.like_notification_frequency.never"), value: 3 },+ { name: i18n("user.like_notification_frequency.first_time"), value: 2 },+ { name: i18n("user.like_notification_frequency.never"), value: 3 },];}diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/profile.js b/app/assets/javascripts/discourse/app/controllers/preferences/profile.jsindex d9e5fa71018..a1b06cb9ac4 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/profile.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/profile.js@@ -7,13 +7,13 @@ import FeatureTopicOnProfileModal from "discourse/components/modal/feature-topicimport { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ProfileController extends Controller {@service dialog;@service modal;- subpageTitle = I18n.t("user.preferences_nav.profile");+ subpageTitle = i18n("user.preferences_nav.profile");@readOnly("model.can_change_bio") canChangeBio;@readOnly("model.can_change_location") canChangeLocation;@@ -36,8 +36,8 @@ export default class ProfileController extends Controller {];calendarOptions = [- { name: I18n.t("download_calendar.google"), value: "google" },- { name: I18n.t("download_calendar.ics"), value: "ics" },+ { name: i18n("download_calendar.google"), value: "google" },+ { name: i18n("download_calendar.ics"), value: "ics" },];@discourseComputed("[email protected]")@@ -99,7 +99,7 @@ export default class ProfileController extends Controller {@actionclearFeaturedTopicFromProfile() {this.dialog.yesNoConfirm({- message: I18n.t("user.feature_topic_on_profile.clear.warning"),+ message: i18n("user.feature_topic_on_profile.clear.warning"),didConfirm: () => {return ajax(`/u/${this.model.username}/clear-featured-topic`, {type: "PUT",diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.jsindex 87096303fac..498d8171792 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/second-factor.js@@ -15,7 +15,7 @@ import CanCheckEmails from "discourse/mixins/can-check-emails";import { findAll } from "discourse/models/login-method";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SecondFactorController extends Controller.extend(CanCheckEmails@@ -167,7 +167,7 @@ export default class SecondFactorController extends Controller.extend(if (!trustedSession.success) {this.dialog.dialog({- title: I18n.t("user.confirm_access.title"),+ title: i18n("user.confirm_access.title"),type: "notice",bodyComponent: ConfirmSession,didConfirm: () => this.createToTpModal(),@@ -187,7 +187,7 @@ export default class SecondFactorController extends Controller.extend(if (!trustedSession.success) {this.dialog.dialog({- title: I18n.t("user.confirm_access.title"),+ title: i18n("user.confirm_access.title"),type: "notice",bodyComponent: ConfirmSession,didConfirm: () => this.createSecurityKeyModal(),@@ -207,7 +207,7 @@ export default class SecondFactorController extends Controller.extend(}this.dialog.deleteConfirm({- title: I18n.t("user.second_factor.disable_confirm"),+ title: i18n("user.second_factor.disable_confirm"),bodyComponent: SecondFactorConfirmPhrase,bodyComponentModel: {totps: this.totps,@@ -237,8 +237,8 @@ export default class SecondFactorController extends Controller.extend(return;}this.dialog.deleteConfirm({- title: I18n.t("user.second_factor.delete_single_confirm_title"),- message: I18n.t("user.second_factor.delete_single_confirm_message", {+ title: i18n("user.second_factor.delete_single_confirm_title"),+ message: i18n("user.second_factor.delete_single_confirm_message", {name: secondFactorMethod.name,}),confirmButtonLabel: "user.second_factor.delete",@@ -304,8 +304,8 @@ export default class SecondFactorController extends Controller.extend(@actiondisableSecondFactorBackup() {this.dialog.deleteConfirm({- title: I18n.t("user.second_factor.delete_backup_codes_confirm_title"),- message: I18n.t("user.second_factor.delete_backup_codes_confirm_message"),+ title: i18n("user.second_factor.delete_backup_codes_confirm_title"),+ message: i18n("user.second_factor.delete_backup_codes_confirm_message"),confirmButtonLabel: "user.second_factor.delete",confirmButtonIcon: "ban",cancelButtonClass: "btn-flat",diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/security.js b/app/assets/javascripts/discourse/app/controllers/preferences/security.jsindex e7bca40e345..ff5567d44ed 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/security.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/security.js@@ -11,7 +11,7 @@ import { userPath } from "discourse/lib/url";import { isWebauthnSupported } from "discourse/lib/webauthn";import CanCheckEmails from "discourse/mixins/can-check-emails";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Number of tokens shown by default.const DEFAULT_AUTH_TOKENS_COUNT = 2;@@ -24,7 +24,7 @@ export default class SecurityController extends Controller.extend(@service router;passwordProgress = null;- subpageTitle = I18n.t("user.preferences_nav.security");+ subpageTitle = i18n("user.preferences_nav.security");showAllAuthTokens = false;@gt("model.user_auth_tokens.length", DEFAULT_AUTH_TOKENS_COUNT)@@ -72,21 +72,21 @@ export default class SecurityController extends Controller.extend(changePassword(event) {event?.preventDefault();if (!this.passwordProgress) {- this.set("passwordProgress", I18n.t("user.change_password.in_progress"));+ this.set("passwordProgress", i18n("user.change_password.in_progress"));return this.model.changePassword().then(() => {// password changedthis.setProperties({changePasswordProgress: false,- passwordProgress: I18n.t("user.change_password.success"),+ passwordProgress: i18n("user.change_password.success"),});}).catch(() => {// password failed to changethis.setProperties({changePasswordProgress: false,- passwordProgress: I18n.t("user.change_password.error"),+ passwordProgress: i18n("user.change_password.error"),});});}@@ -125,7 +125,7 @@ export default class SecurityController extends Controller.extend(if (!trustedSession.success) {this.dialog.dialog({- title: I18n.t("user.confirm_access.title"),+ title: i18n("user.confirm_access.title"),type: "notice",bodyComponent: ConfirmSession,didConfirm: () =>diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/tracking.js b/app/assets/javascripts/discourse/app/controllers/preferences/tracking.jsindex 80ec9b54599..76f261094da 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/tracking.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/tracking.js@@ -4,7 +4,7 @@ import { action, computed } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import { NotificationLevels } from "discourse/lib/notification-levels";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends Controller {@service currentUser;@@ -12,73 +12,73 @@ export default class extends Controller {@tracked saved = false;likeNotificationFrequencies = [- { name: I18n.t("user.like_notification_frequency.always"), value: 0 },+ { name: i18n("user.like_notification_frequency.always"), value: 0 },{- name: I18n.t("user.like_notification_frequency.first_time_and_daily"),+ name: i18n("user.like_notification_frequency.first_time_and_daily"),value: 1,},- { name: I18n.t("user.like_notification_frequency.first_time"), value: 2 },- { name: I18n.t("user.like_notification_frequency.never"), value: 3 },+ { name: i18n("user.like_notification_frequency.first_time"), value: 2 },+ { name: i18n("user.like_notification_frequency.never"), value: 3 },];autoTrackDurations = [- { name: I18n.t("user.auto_track_options.never"), value: -1 },- { name: I18n.t("user.auto_track_options.immediately"), value: 0 },+ { name: i18n("user.auto_track_options.never"), value: -1 },+ { name: i18n("user.auto_track_options.immediately"), value: 0 },{- name: I18n.t("user.auto_track_options.after_30_seconds"),+ name: i18n("user.auto_track_options.after_30_seconds"),value: 30000,},- { name: I18n.t("user.auto_track_options.after_1_minute"), value: 60000 },+ { name: i18n("user.auto_track_options.after_1_minute"), value: 60000 },{- name: I18n.t("user.auto_track_options.after_2_minutes"),+ name: i18n("user.auto_track_options.after_2_minutes"),value: 120000,},{- name: I18n.t("user.auto_track_options.after_3_minutes"),+ name: i18n("user.auto_track_options.after_3_minutes"),value: 180000,},{- name: I18n.t("user.auto_track_options.after_4_minutes"),+ name: i18n("user.auto_track_options.after_4_minutes"),value: 240000,},{- name: I18n.t("user.auto_track_options.after_5_minutes"),+ name: i18n("user.auto_track_options.after_5_minutes"),value: 300000,},{- name: I18n.t("user.auto_track_options.after_10_minutes"),+ name: i18n("user.auto_track_options.after_10_minutes"),value: 600000,},];notificationLevelsForReplying = [{- name: I18n.t("topic.notifications.watching.title"),+ name: i18n("topic.notifications.watching.title"),value: NotificationLevels.WATCHING,},{- name: I18n.t("topic.notifications.tracking.title"),+ name: i18n("topic.notifications.tracking.title"),value: NotificationLevels.TRACKING,},{- name: I18n.t("topic.notifications.regular.title"),+ name: i18n("topic.notifications.regular.title"),value: NotificationLevels.REGULAR,},];considerNewTopicOptions = [- { name: I18n.t("user.new_topic_duration.not_viewed"), value: -1 },- { name: I18n.t("user.new_topic_duration.after_1_day"), value: 60 * 24 },- { name: I18n.t("user.new_topic_duration.after_2_days"), value: 60 * 48 },+ { name: i18n("user.new_topic_duration.not_viewed"), value: -1 },+ { name: i18n("user.new_topic_duration.after_1_day"), value: 60 * 24 },+ { name: i18n("user.new_topic_duration.after_2_days"), value: 60 * 48 },{- name: I18n.t("user.new_topic_duration.after_1_week"),+ name: i18n("user.new_topic_duration.after_1_week"),value: 7 * 60 * 24,},{- name: I18n.t("user.new_topic_duration.after_2_weeks"),+ name: i18n("user.new_topic_duration.after_2_weeks"),value: 2 * 7 * 60 * 24,},- { name: I18n.t("user.new_topic_duration.last_here"), value: -2 },+ { name: i18n("user.new_topic_duration.last_here"), value: -2 },];get canSee() {diff --git a/app/assets/javascripts/discourse/app/controllers/review-index.js b/app/assets/javascripts/discourse/app/controllers/review-index.jsindex a3bfc340079..a910f5aa33e 100644--- a/app/assets/javascripts/discourse/app/controllers/review-index.js+++ b/app/assets/javascripts/discourse/app/controllers/review-index.js@@ -4,7 +4,7 @@ import { next } from "@ember/runloop";import { underscore } from "@ember/string";import { isPresent } from "@ember/utils";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ReviewIndexController extends Controller {queryParams = [@@ -42,7 +42,7 @@ export default class ReviewIndexController extends Controller {return {id: type,- name: I18n.t(`review.types.${translationKey}.title`),+ name: i18n(`review.types.${translationKey}.title`),};});}@@ -52,7 +52,7 @@ export default class ReviewIndexController extends Controller {return ["any", "low", "medium", "high"].map((priority) => {return {id: priority,- name: I18n.t(`review.filters.priority.${priority}`),+ name: i18n(`review.filters.priority.${priority}`),};});}@@ -63,7 +63,7 @@ export default class ReviewIndexController extends Controller {(order) => {return {id: order,- name: I18n.t(`review.filters.orders.${order}`),+ name: i18n(`review.filters.orders.${order}`),};});@@ -80,7 +80,7 @@ export default class ReviewIndexController extends Controller {"reviewed","all",].map((id) => {- return { id, name: I18n.t(`review.statuses.${id}.title`) };+ return { id, name: i18n(`review.statuses.${id}.title`) };});}diff --git a/app/assets/javascripts/discourse/app/controllers/review-settings.js b/app/assets/javascripts/discourse/app/controllers/review-settings.jsindex 6e3a9c61fae..72a23fe005b 100644--- a/app/assets/javascripts/discourse/app/controllers/review-settings.js+++ b/app/assets/javascripts/discourse/app/controllers/review-settings.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ReviewSettingsController extends Controller {saving = false;@@ -30,7 +30,7 @@ export default class ReviewSettingsController extends Controller {@discourseComputed("settings.reviewable_score_types")scoreTypes(types) {- const username = I18n.t("review.example_username");+ const username = i18n("review.example_username");return types.map((type) => ({...type,diff --git a/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js b/app/assets/javascripts/discourse/app/controllers/second-factor-auth.jsindex e7f3f5f7098..02aed343ffe 100644--- a/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js+++ b/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js@@ -7,7 +7,7 @@ import DiscourseURL from "discourse/lib/url";import { getWebauthnCredential } from "discourse/lib/webauthn";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const { TOTP, BACKUP_CODE, SECURITY_KEY } = SECOND_FACTOR_METHODS;export default class SecondFactorAuthController extends Controller {@@ -118,11 +118,11 @@ export default class SecondFactorAuthController extends Controller {secondFactorTitle(shownSecondFactorMethod) {switch (shownSecondFactorMethod) {case TOTP:- return I18n.t("login.second_factor_title");+ return i18n("login.second_factor_title");case SECURITY_KEY:- return I18n.t("login.second_factor_title");+ return i18n("login.second_factor_title");case BACKUP_CODE:- return I18n.t("login.second_factor_backup_title");+ return i18n("login.second_factor_backup_title");}}@@ -130,11 +130,11 @@ export default class SecondFactorAuthController extends Controller {secondFactorDescription(shownSecondFactorMethod) {switch (shownSecondFactorMethod) {case TOTP:- return I18n.t("login.second_factor_description");+ return i18n("login.second_factor_description");case SECURITY_KEY:- return I18n.t("login.security_key_description");+ return i18n("login.security_key_description");case BACKUP_CODE:- return I18n.t("login.second_factor_backup_description");+ return i18n("login.second_factor_backup_description");}}@@ -184,9 +184,7 @@ export default class SecondFactorAuthController extends Controller {},}).then((response) => {- this.displaySuccess(- I18n.t("second_factor_auth.redirect_after_success")- );+ this.displaySuccess(i18n("second_factor_auth.redirect_after_success"));ajax(response.callback_path, {type: response.callback_method,data: {diff --git a/app/assets/javascripts/discourse/app/controllers/signup.js b/app/assets/javascripts/discourse/app/controllers/signup.jsindex ff3a453b3e4..f6c20c7a877 100644--- a/app/assets/javascripts/discourse/app/controllers/signup.js+++ b/app/assets/javascripts/discourse/app/controllers/signup.js@@ -19,7 +19,7 @@ import { findAll } from "discourse/models/login-method";import User from "discourse/models/user";import discourseDebounce from "discourse-common/lib/debounce";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SignupPageController extends Controller.extend(PasswordValidation,@@ -139,7 +139,7 @@ export default class SignupPageController extends Controller.extend(@discourseComputeddisclaimerHtml() {if (this.site.tos_url && this.site.privacy_policy_url) {- return I18n.t("create_account.disclaimer", {+ return i18n("create_account.disclaimer", {tos_link: this.site.tos_url,privacy_link: this.site.privacy_policy_url,});@@ -175,8 +175,8 @@ export default class SignupPageController extends Controller.extend(if (isEmpty(email)) {return EmberObject.create(Object.assign(failedAttrs, {- message: I18n.t("user.email.required"),- reason: forceValidationReason ? I18n.t("user.email.required") : null,+ message: i18n("user.email.required"),+ reason: forceValidationReason ? i18n("user.email.required") : null,}));}@@ -184,7 +184,7 @@ export default class SignupPageController extends Controller.extend(if (rejectedEmails.includes(email) || !emailValid(email)) {return EmberObject.create(Object.assign(failedAttrs, {- reason: I18n.t("user.email.invalid"),+ reason: i18n("user.email.invalid"),}));}@@ -195,7 +195,7 @@ export default class SignupPageController extends Controller.extend() {return EmberObject.create({ok: true,- reason: I18n.t("user.email.authenticated", {+ reason: i18n("user.email.authenticated", {provider: this.authProviderDisplayName(this.get("authOptions.auth_provider")),@@ -205,7 +205,7 @@ export default class SignupPageController extends Controller.extend(return EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),});}@@ -253,7 +253,7 @@ export default class SignupPageController extends Controller.extend(serverAccountEmail: this.accountEmail,serverEmailValidation: EmberObject.create({ok: true,- reason: I18n.t("user.email.ok"),+ reason: i18n("user.email.ok"),}),});}@@ -401,7 +401,7 @@ export default class SignupPageController extends Controller.extend(}return new Promise(() => {}); // This will never resolve, the page will reload instead} else {- this.set("flash", result.message || I18n.t("create_account.failed"));+ this.set("flash", result.message || i18n("create_account.failed"));if (result.is_developer) {this.set("isDeveloper", true);}@@ -427,7 +427,7 @@ export default class SignupPageController extends Controller.extend(() => {this.set("formSubmitted", false);removeCookie("destination_url");- return this.set("flash", I18n.t("create_account.failed"));+ return this.set("flash", i18n("create_account.failed"));});}@@ -437,9 +437,9 @@ export default class SignupPageController extends Controller.extend(if (!url) {return;}- return I18n.t("create_account.associate", {+ return i18n("create_account.associate", {associate_link: url,- provider: I18n.t(`login.${provider}.name`),+ provider: i18n(`login.${provider}.name`),});}diff --git a/app/assets/javascripts/discourse/app/controllers/tags-index.js b/app/assets/javascripts/discourse/app/controllers/tags-index.jsindex 370c8f131c2..dd242545735 100644--- a/app/assets/javascripts/discourse/app/controllers/tags-index.js+++ b/app/assets/javascripts/discourse/app/controllers/tags-index.js@@ -6,7 +6,7 @@ import TagUpload from "discourse/components/modal/tag-upload";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TagsIndexController extends Controller {@service dialog;@@ -83,24 +83,24 @@ export default class TagsIndexController extends Controller {const tags = result["tags"];if (tags.length === 0) {- this.dialog.alert(I18n.t("tagging.delete_no_unused_tags"));+ this.dialog.alert(i18n("tagging.delete_no_unused_tags"));return;}const joinedTags = tags.slice(0, displayN)- .join(I18n.t("tagging.tag_list_joiner"));+ .join(i18n("tagging.tag_list_joiner"));const more = Math.max(0, tags.length - displayN);const tagsString =more === 0? joinedTags- : I18n.t("tagging.delete_unused_confirmation_more_tags", {+ : i18n("tagging.delete_unused_confirmation_more_tags", {count: more,tags: joinedTags,});- const message = I18n.t("tagging.delete_unused_confirmation", {+ const message = i18n("tagging.delete_unused_confirmation", {count: tags.length,tags: tagsString,});diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.jsindex 4a3aa79198a..5f748a4babc 100644--- a/app/assets/javascripts/discourse/app/controllers/topic.js+++ b/app/assets/javascripts/discourse/app/controllers/topic.js@@ -38,7 +38,7 @@ import { isTesting } from "discourse-common/config/environment";import discourseLater from "discourse-common/lib/later";import { deepMerge } from "discourse-common/lib/object";import discourseComputed, { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let customPostMessageCallbacks = {};const RETRIES_ON_RATE_LIMIT = 4;@@ -754,7 +754,7 @@ export default class TopicController extends Controller.extend(.map((r) => r.id);buttons.push({- label: I18n.t("post.controls.delete_replies.direct_replies", {+ label: i18n("post.controls.delete_replies.direct_replies", {count: directReplyIds.length,}),class: "btn-primary",@@ -772,7 +772,7 @@ export default class TopicController extends Controller.extend(if (replies.some((r) => r.level > 1)) {buttons.push({- label: I18n.t("post.controls.delete_replies.all_replies", {+ label: i18n("post.controls.delete_replies.all_replies", {count: replies.length,}),action: () => {@@ -789,7 +789,7 @@ export default class TopicController extends Controller.extend(}buttons.push({- label: I18n.t("post.controls.delete_replies.just_the_post"),+ label: i18n("post.controls.delete_replies.just_the_post"),action: () => {post.destroy(user, opts)@@ -802,12 +802,12 @@ export default class TopicController extends Controller.extend(});buttons.push({- label: I18n.t("cancel"),+ label: i18n("cancel"),class: "btn-flat",});this.dialog.alert({- title: I18n.t("post.controls.delete_replies.confirm"),+ title: i18n("post.controls.delete_replies.confirm"),buttons,});});@@ -825,7 +825,7 @@ export default class TopicController extends Controller.extend(@actiondeletePostWithConfirmation(post, opts) {this.dialog.yesNoConfirm({- message: I18n.t("post.confirm_delete"),+ message: i18n("post.confirm_delete"),didConfirm: () => this.send("deletePost", post, opts),});}@@ -833,7 +833,7 @@ export default class TopicController extends Controller.extend(@actionpermanentlyDeletePost(post) {return this.dialog.yesNoConfirm({- message: I18n.t("post.controls.permanently_delete_confirmation"),+ message: i18n("post.controls.permanently_delete_confirmation"),didConfirm: () => {this.send("deletePost", post, { force_destroy: true });},@@ -843,7 +843,7 @@ export default class TopicController extends Controller.extend(@actioneditPost(post) {if (!this.currentUser) {- return this.dialog.alert(I18n.t("post.controls.edit_anonymous"));+ return this.dialog.alert(i18n("post.controls.edit_anonymous"));} else if (!post.can_edit) {return false;}@@ -893,7 +893,7 @@ export default class TopicController extends Controller.extend(@actiontoggleBookmark(post) {if (!this.currentUser) {- return this.dialog.alert(I18n.t("bookmarks.not_bookmarked"));+ return this.dialog.alert(i18n("bookmarks.not_bookmarked"));} else if (post) {const bookmarkForPost = this.model.bookmarks.find((bookmark) =>@@ -1015,7 +1015,7 @@ export default class TopicController extends Controller.extend(deleteSelected() {const user = this.currentUser;this.dialog.yesNoConfirm({- message: I18n.t("post.delete.confirm", {+ message: i18n("post.delete.confirm", {count: this.selectedPostsCount,}),didConfirm: () => {@@ -1036,7 +1036,7 @@ export default class TopicController extends Controller.extend(@actionmergePosts() {this.dialog.yesNoConfirm({- message: I18n.t("post.merge.confirm", {+ message: i18n("post.merge.confirm", {count: this.selectedPostsCount,}),didConfirm: () => {@@ -1223,7 +1223,7 @@ export default class TopicController extends Controller.extend(const title = escapeExpression(this.model.title);const postUrl = `${location.protocol}//${location.host}${post.url}`;const postLink = `[${title}](${postUrl})`;- const text = `${I18n.t("post.continue_discussion", {+ const text = `${i18n("post.continue_discussion", {postLink,})}\n\n${quotedText}`;@@ -1469,7 +1469,7 @@ export default class TopicController extends Controller.extend(_maybeClearAllBookmarks() {return new Promise((resolve) => {this.dialog.yesNoConfirm({- message: I18n.t("bookmarks.confirm_clear"),+ message: i18n("bookmarks.confirm_clear"),didConfirm: () => {return this.model.deleteBookmarks()diff --git a/app/assets/javascripts/discourse/app/controllers/user-activity-bookmarks.js b/app/assets/javascripts/discourse/app/controllers/user-activity-bookmarks.jsindex 47a94c4b6b1..3566aa1cfb2 100644--- a/app/assets/javascripts/discourse/app/controllers/user-activity-bookmarks.js+++ b/app/assets/javascripts/discourse/app/controllers/user-activity-bookmarks.js@@ -9,7 +9,7 @@ import BulkSelectHelper from "discourse/lib/bulk-select-helper";import Bookmark from "discourse/models/bookmark";import { iconHTML } from "discourse-common/lib/icon-library";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityBookmarksController extends Controller {@service router;@@ -40,7 +40,7 @@ export default class UserActivityBookmarksController extends Controller {@discourseComputed()emptyStateBody() {return htmlSafe(- I18n.t("user.no_bookmarks_body", {+ i18n("user.no_bookmarks_body", {icon: iconHTML("bookmark"),}));diff --git a/app/assets/javascripts/discourse/app/controllers/user-activity.js b/app/assets/javascripts/discourse/app/controllers/user-activity.jsindex 2eac73b26a6..0a0f54decb4 100644--- a/app/assets/javascripts/discourse/app/controllers/user-activity.js+++ b/app/assets/javascripts/discourse/app/controllers/user-activity.js@@ -1,7 +1,7 @@import Controller, { inject as controller } from "@ember/controller";import { service } from "@ember/service";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityController extends Controller {@service currentUser;@@ -12,14 +12,14 @@ export default class UserActivityController extends Controller {@discourseComputed("currentUser.draft_count")draftLabel(count) {return count > 0- ? I18n.t("drafts.label_with_count", { count })- : I18n.t("drafts.label");+ ? i18n("drafts.label_with_count", { count })+ : i18n("drafts.label");}@discourseComputed("model.pending_posts_count")pendingLabel(count) {return count > 0- ? I18n.t("pending_posts.label_with_count", { count })- : I18n.t("pending_posts.label");+ ? i18n("pending_posts.label_with_count", { count })+ : i18n("pending_posts.label");}}diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js b/app/assets/javascripts/discourse/app/controllers/user-invited-show.jsindex ce50acb0e9a..d77e7842cee 100644--- a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js+++ b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js@@ -9,7 +9,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import Invite from "discourse/models/invite";import { INPUT_DELAY } from "discourse-common/config/environment";import discourseComputed, { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserInvitedShowController extends Controller {@service dialog;@@ -88,7 +88,7 @@ export default class UserInvitedShowController extends Controller {@actiondestroyAllExpired() {this.dialog.deleteConfirm({- message: I18n.t("user.invited.remove_all_confirm"),+ message: i18n("user.invited.remove_all_confirm"),didConfirm: () => {return Invite.destroyAllExpired().then(() => {@@ -109,7 +109,7 @@ export default class UserInvitedShowController extends Controller {@actionreinviteAll() {this.dialog.yesNoConfirm({- message: I18n.t("user.invited.reinvite_all_confirm"),+ message: i18n("user.invited.reinvite_all_confirm"),didConfirm: () => {return Invite.reinviteAll().then(() => this.set("reinvitedAll", true))diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited.js b/app/assets/javascripts/discourse/app/controllers/user-invited.jsindex f0905403ade..41af31dfac1 100644--- a/app/assets/javascripts/discourse/app/controllers/user-invited.js+++ b/app/assets/javascripts/discourse/app/controllers/user-invited.js@@ -1,38 +1,38 @@import Controller from "@ember/controller";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserInvitedController extends Controller {@discourseComputed("invitesCount.total", "invitesCount.pending")pendingLabel(invitesCountTotal, invitesCountPending) {if (invitesCountTotal > 0) {- return I18n.t("user.invited.pending_tab_with_count", {+ return i18n("user.invited.pending_tab_with_count", {count: invitesCountPending,});} else {- return I18n.t("user.invited.pending_tab");+ return i18n("user.invited.pending_tab");}}@discourseComputed("invitesCount.total", "invitesCount.expired")expiredLabel(invitesCountTotal, invitesCountExpired) {if (invitesCountTotal > 0) {- return I18n.t("user.invited.expired_tab_with_count", {+ return i18n("user.invited.expired_tab_with_count", {count: invitesCountExpired,});} else {- return I18n.t("user.invited.expired_tab");+ return i18n("user.invited.expired_tab");}}@discourseComputed("invitesCount.total", "invitesCount.redeemed")redeemedLabel(invitesCountTotal, invitesCountRedeemed) {if (invitesCountTotal > 0) {- return I18n.t("user.invited.redeemed_tab_with_count", {+ return i18n("user.invited.redeemed_tab_with_count", {count: invitesCountRedeemed,});} else {- return I18n.t("user.invited.redeemed_tab");+ return i18n("user.invited.redeemed_tab");}}}diff --git a/app/assets/javascripts/discourse/app/controllers/user-notifications.gjs b/app/assets/javascripts/discourse/app/controllers/user-notifications.gjsindex 7ad50db8517..a37c2493af3 100644--- a/app/assets/javascripts/discourse/app/controllers/user-notifications.gjs+++ b/app/assets/javascripts/discourse/app/controllers/user-notifications.gjs@@ -10,7 +10,7 @@ import UserMenuNotificationItem from "discourse/lib/user-menu/notification-item"import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const _beforeLoadMoreCallbacks = [];export function addBeforeLoadMoreCallback(fn) {@@ -76,7 +76,7 @@ export default class UserNotificationsController extends Controller {@discourseComputed()emptyStateBody() {return htmlSafe(- I18n.t("user.no_notifications_page_body", {+ i18n("user.no_notifications_page_body", {preferencesUrl: getURL("/my/preferences/notifications"),icon: iconHTML("bell"),})@@ -99,7 +99,7 @@ export default class UserNotificationsController extends Controller {if (this.currentUser.unread_high_priority_notifications > 0) {this.modal.show(DismissNotificationConfirmationModal, {model: {- confirmationMessage: I18n.t(+ confirmationMessage: i18n("notifications.dismiss_confirmation.body.default",{count: this.currentUser.unread_high_priority_notifications,diff --git a/app/assets/javascripts/discourse/app/controllers/user-private-messages-group.js b/app/assets/javascripts/discourse/app/controllers/user-private-messages-group.jsindex 382f7a90b2b..9d220e6ba84 100644--- a/app/assets/javascripts/discourse/app/controllers/user-private-messages-group.js+++ b/app/assets/javascripts/discourse/app/controllers/user-private-messages-group.js@@ -1,7 +1,7 @@import Controller, { inject as controller } from "@ember/controller";import { action } from "@ember/object";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends Controller {@service pmTopicTrackingState;@@ -30,9 +30,9 @@ export default class extends Controller {});if (count === 0) {- return I18n.t(`user.messages.${type}`);+ return i18n(`user.messages.${type}`);} else {- return I18n.t(`user.messages.${type}_with_count`, { count });+ return i18n(`user.messages.${type}_with_count`, { count });}}diff --git a/app/assets/javascripts/discourse/app/controllers/user-private-messages-user.js b/app/assets/javascripts/discourse/app/controllers/user-private-messages-user.jsindex 7a7b69933a8..005c36fbe79 100644--- a/app/assets/javascripts/discourse/app/controllers/user-private-messages-user.js+++ b/app/assets/javascripts/discourse/app/controllers/user-private-messages-user.js@@ -1,6 +1,6 @@import Controller, { inject as controller } from "@ember/controller";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends Controller {@service currentUser;@@ -33,9 +33,9 @@ export default class extends Controller {});if (count === 0) {- return I18n.t(`user.messages.${type}`);+ return i18n(`user.messages.${type}`);} else {- return I18n.t(`user.messages.${type}_with_count`, { count });+ return i18n(`user.messages.${type}_with_count`, { count });}}}diff --git a/app/assets/javascripts/discourse/app/controllers/user-private-messages.js b/app/assets/javascripts/discourse/app/controllers/user-private-messages.jsindex 7707cb654a8..152496bd479 100644--- a/app/assets/javascripts/discourse/app/controllers/user-private-messages.js+++ b/app/assets/javascripts/discourse/app/controllers/user-private-messages.js@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { alias, and, equal, readOnly } from "@ember/object/computed";import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const customUserNavMessagesDropdownRows = [];@@ -71,7 +71,7 @@ export default class extends Controller {const content = [{id: this.router.urlFor("userPrivateMessages.user", usernameLower),- name: I18n.t("user.messages.inbox"),+ name: i18n("user.messages.inbox"),},];@@ -90,7 +90,7 @@ export default class extends Controller {if (this.pmTaggingEnabled) {content.push({id: this.router.urlFor("userPrivateMessages.tags", usernameLower),- name: I18n.t("user.messages.tags"),+ name: i18n("user.messages.tags"),icon: "tags",});}diff --git a/app/assets/javascripts/discourse/app/controllers/user.js b/app/assets/javascripts/discourse/app/controllers/user.jsindex 5ef8d775f22..eed95755ed9 100644--- a/app/assets/javascripts/discourse/app/controllers/user.js+++ b/app/assets/javascripts/discourse/app/controllers/user.js@@ -9,7 +9,7 @@ import { prioritizeNameInUx } from "discourse/lib/settings";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 { i18n } from "discourse-i18n";export default class UserController extends Controller.extend(CanCheckEmails) {@service currentUser;@@ -223,7 +223,7 @@ export default class UserController extends Controller.extend(CanCheckEmails) {const location = document.location.pathname;const performDestroy = (block) => {- this.dialog.notice(I18n.t("admin.user.deleting_user"));+ this.dialog.notice(i18n("admin.user.deleting_user"));let formData = { context: location };if (block) {formData["block_email"] = true;@@ -238,19 +238,19 @@ export default class UserController extends Controller.extend(CanCheckEmails) {if (data.deleted) {document.location = getURL("/admin/users/list/active");} else {- this.dialog.alert(I18n.t("admin.user.delete_failed"));+ this.dialog.alert(i18n("admin.user.delete_failed"));}})- .catch(() => this.dialog.alert(I18n.t("admin.user.delete_failed")));+ .catch(() => this.dialog.alert(i18n("admin.user.delete_failed")));};this.dialog.alert({- title: I18n.t("admin.user.delete_confirm_title"),- message: I18n.t("admin.user.delete_confirm"),+ title: i18n("admin.user.delete_confirm_title"),+ message: i18n("admin.user.delete_confirm"),class: "delete-user-modal",buttons: [{- label: I18n.t("admin.user.delete_dont_block"),+ label: i18n("admin.user.delete_dont_block"),class: "btn-primary",action: () => {return performDestroy(false);@@ -258,14 +258,14 @@ export default class UserController extends Controller.extend(CanCheckEmails) {},{icon: "triangle-exclamation",- label: I18n.t("admin.user.delete_and_block"),+ label: i18n("admin.user.delete_and_block"),class: "btn-danger",action: () => {return performDestroy(true);},},{- label: I18n.t("composer.cancel"),+ label: i18n("composer.cancel"),},],});diff --git a/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs b/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjsindex 4af4afe4943..9adcaf6abbd 100644--- a/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs+++ b/app/assets/javascripts/discourse/app/form-kit/components/fk/control-wrapper.gjs@@ -6,7 +6,7 @@ import FKLabel from "discourse/form-kit/components/fk/label";import FKMeta from "discourse/form-kit/components/fk/meta";import FKText from "discourse/form-kit/components/fk/text";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class FKControlWrapper extends Component {constructor() {diff --git a/app/assets/javascripts/discourse/app/form-kit/components/fk/control/question.gjs b/app/assets/javascripts/discourse/app/form-kit/components/fk/control/question.gjsindex af446e16542..a5ab1f5526b 100644--- a/app/assets/javascripts/discourse/app/form-kit/components/fk/control/question.gjs+++ b/app/assets/javascripts/discourse/app/form-kit/components/fk/control/question.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import { eq } from "truth-helpers";import FKLabel from "discourse/form-kit/components/fk/label";import uniqueId from "discourse/helpers/unique-id";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class FKControlQuestion extends Component {static controlType = "question";diff --git a/app/assets/javascripts/discourse/app/form-kit/components/fk/errors-summary.gjs b/app/assets/javascripts/discourse/app/form-kit/components/fk/errors-summary.gjsindex 4df9fb8a546..b655c5504df 100644--- a/app/assets/javascripts/discourse/app/form-kit/components/fk/errors-summary.gjs+++ b/app/assets/javascripts/discourse/app/form-kit/components/fk/errors-summary.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { concat } from "@ember/helper";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class FKErrorsSummary extends Component {concatErrors(errors) {diff --git a/app/assets/javascripts/discourse/app/form-kit/components/fk/form.gjs b/app/assets/javascripts/discourse/app/form-kit/components/fk/form.gjsindex 600877e50e5..4820c270a40 100644--- a/app/assets/javascripts/discourse/app/form-kit/components/fk/form.gjs+++ b/app/assets/javascripts/discourse/app/form-kit/components/fk/form.gjs@@ -20,7 +20,7 @@ import FKSubmit from "discourse/form-kit/components/fk/submit";import { VALIDATION_TYPES } from "discourse/form-kit/lib/constants";import FKFieldData from "discourse/form-kit/lib/fk-field-data";import FKFormData from "discourse/form-kit/lib/fk-form-data";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";class FKForm extends Component {@service dialog;@@ -65,7 +65,7 @@ class FKForm extends Component {transition.abort();this.dialog.yesNoConfirm({- message: I18n.t("form_kit.dirty_form"),+ message: i18n("form_kit.dirty_form"),didConfirm: async () => {await this.onReset();transition.retry();diff --git a/app/assets/javascripts/discourse/app/form-kit/lib/validator.js b/app/assets/javascripts/discourse/app/form-kit/lib/validator.jsindex 762d46e2fd5..22325995318 100644--- a/app/assets/javascripts/discourse/app/form-kit/lib/validator.js+++ b/app/assets/javascripts/discourse/app/form-kit/lib/validator.js@@ -1,5 +1,5 @@import { isBlank } from "@ember/utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Validator {constructor(value, rules = {}) {@@ -30,14 +30,14 @@ export default class Validator {integerValidator(value) {if (!Number.isInteger(Number(value))) {- return I18n.t("form_kit.errors.not_an_integer");+ return i18n("form_kit.errors.not_an_integer");}}lengthValidator(value, rule) {if (rule.max) {if (value?.length > rule.max) {- return I18n.t("form_kit.errors.too_long", {+ return i18n("form_kit.errors.too_long", {count: rule.max,});}@@ -45,7 +45,7 @@ export default class Validator {if (rule.min) {if (value?.length < rule.min) {- return I18n.t("form_kit.errors.too_short", {+ return i18n("form_kit.errors.too_short", {count: rule.min,});}@@ -55,7 +55,7 @@ export default class Validator {betweenValidator(value, rule) {if (rule.max) {if (value > rule.max) {- return I18n.t("form_kit.errors.too_high", {+ return i18n("form_kit.errors.too_high", {count: rule.max,});}@@ -63,7 +63,7 @@ export default class Validator {if (rule.min) {if (value < rule.min) {- return I18n.t("form_kit.errors.too_low", {+ return i18n("form_kit.errors.too_low", {count: rule.min,});}@@ -72,14 +72,14 @@ export default class Validator {numberValidator(value) {if (isNaN(Number(value))) {- return I18n.t("form_kit.errors.not_a_number");+ return i18n("form_kit.errors.not_a_number");}}acceptedValidator(value) {const acceptedValues = ["yes", "on", true, 1, "true"];if (!acceptedValues.includes(value)) {- return I18n.t("form_kit.errors.not_accepted");+ return i18n("form_kit.errors.not_accepted");}}@@ -88,7 +88,7 @@ export default class Validator {// eslint-disable-next-line no-newnew URL(value);} catch {- return I18n.t("form_kit.errors.invalid_url");+ return i18n("form_kit.errors.invalid_url");}}@@ -121,7 +121,7 @@ export default class Validator {}if (error) {- return I18n.t("form_kit.errors.required");+ return i18n("form_kit.errors.required");}}}diff --git a/app/assets/javascripts/discourse/app/helpers/avatar.js b/app/assets/javascripts/discourse/app/helpers/avatar.jsindex d87e51f4f7f..d3cd5819ed9 100644--- a/app/assets/javascripts/discourse/app/helpers/avatar.js+++ b/app/assets/javascripts/discourse/app/helpers/avatar.js@@ -4,7 +4,7 @@ import { prioritizeNameInUx } from "discourse/lib/settings";import { formatUsername } from "discourse/lib/utilities";import { avatarImg } from "discourse-common/lib/avatar-utils";import { registerRawHelper } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _customAvatarHelpers;@@ -61,7 +61,7 @@ export function renderAvatar(user, options) {// if a description has been providedif (description && description.length > 0) {// prepend the username before the description- title = I18n.t("user.avatar.name_and_description", {+ title = i18n("user.avatar.name_and_description", {name: displayName,description,});diff --git a/app/assets/javascripts/discourse/app/helpers/category-link.js b/app/assets/javascripts/discourse/app/helpers/category-link.jsindex 4181f9ee938..6e771de23d8 100644--- a/app/assets/javascripts/discourse/app/helpers/category-link.js+++ b/app/assets/javascripts/discourse/app/helpers/category-link.js@@ -7,7 +7,7 @@ import Category from "discourse/models/category";import getURL from "discourse-common/lib/get-url";import { helperContext, registerRawHelper } from "discourse-common/lib/helpers";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _renderer = defaultCategoryLinkRenderer;@@ -106,7 +106,7 @@ export default categoryLinkHTML;registerRawHelper("category-link", categoryLinkHTML);function buildTopicCount(count) {- return `<span class="topic-count" aria-label="${I18n.t(+ return `<span class="topic-count" aria-label="${i18n("category_row.topic_count",{ count })}">× ${count}</span>`;@@ -192,7 +192,7 @@ export function defaultCategoryLinkRenderer(category, opts) {}if (opts.subcategoryCount) {- html += `<span class="plus-subcategories">${I18n.t(+ html += `<span class="plus-subcategories">${i18n("category_row.subcategory_count",{ count: opts.subcategoryCount })}</span>`;diff --git a/app/assets/javascripts/discourse/app/helpers/directory-item-label.js b/app/assets/javascripts/discourse/app/helpers/directory-item-label.jsindex 64d3bd0f8c4..41747ddf8f8 100644--- a/app/assets/javascripts/discourse/app/helpers/directory-item-label.js+++ b/app/assets/javascripts/discourse/app/helpers/directory-item-label.js@@ -1,10 +1,10 @@import { htmlSafe } from "@ember/template";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function directoryItemLabel(args) {// Args should include key/values { item, column }const count = args.item.get(args.column.name);const translationPrefix =args.column.type === "automatic" ? "directory." : "";- return htmlSafe(I18n.t(`${translationPrefix}${args.column.name}`, { count }));+ return htmlSafe(i18n(`${translationPrefix}${args.column.name}`, { count }));}diff --git a/app/assets/javascripts/discourse/app/helpers/directory-table-header-title.js b/app/assets/javascripts/discourse/app/helpers/directory-table-header-title.jsindex 091a6276fce..caf775ca10b 100644--- a/app/assets/javascripts/discourse/app/helpers/directory-table-header-title.js+++ b/app/assets/javascripts/discourse/app/helpers/directory-table-header-title.js@@ -1,6 +1,6 @@import { htmlSafe } from "@ember/template";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function directoryTableHeaderTitle(args) {// Args should include key/values { field, labelKey, icon, translated }@@ -13,6 +13,6 @@ export default function directoryTableHeaderTitle(args) {html += args.translated? args.field- : I18n.t(labelKey + "_long", { defaultValue: I18n.t(labelKey) });+ : i18n(labelKey + "_long", { defaultValue: i18n(labelKey) });return htmlSafe(html);}diff --git a/app/assets/javascripts/discourse/app/helpers/number.js b/app/assets/javascripts/discourse/app/helpers/number.jsindex 4076b99d60d..e46845480c6 100644--- a/app/assets/javascripts/discourse/app/helpers/number.js+++ b/app/assets/javascripts/discourse/app/helpers/number.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import { number as numberFormatter } from "discourse/lib/formatter";import { escapeExpression } from "discourse/lib/utilities";import { registerRawHelper } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";registerRawHelper("number", number);@@ -14,7 +14,7 @@ export default function number(orig, params = {}) {let title = I18n.toNumber(orig, { precision: 0 });if (params.numberKey) {- title = I18n.t(params.numberKey, {+ title = i18n(params.numberKey, {number: title,count: parseInt(orig, 10),});diff --git a/app/assets/javascripts/discourse/app/helpers/period-title.js b/app/assets/javascripts/discourse/app/helpers/period-title.jsindex d83fb708adc..67d94dcb8b3 100644--- a/app/assets/javascripts/discourse/app/helpers/period-title.js+++ b/app/assets/javascripts/discourse/app/helpers/period-title.js@@ -1,5 +1,5 @@import { htmlSafe } from "@ember/template";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const TITLE_SUBS = {all: "all_time",@@ -10,7 +10,7 @@ const TITLE_SUBS = {};export default function periodTitle(period, { showDateRange, fullDay } = {}) {- const title = I18n.t("filters.top." + (TITLE_SUBS[period] || "this_week"));+ const title = i18n("filters.top." + (TITLE_SUBS[period] || "this_week"));if (!showDateRange) {return htmlSafe(title);@@ -31,18 +31,18 @@ export default function periodTitle(period, { showDateRange, fullDay } = {}) {finish.clone().subtract(1, "year")- .format(I18n.t("dates.long_with_year_no_time")) ++ .format(i18n("dates.long_with_year_no_time")) +" – " +- finish.format(I18n.t("dates.long_with_year_no_time"));+ finish.format(i18n("dates.long_with_year_no_time"));break;case "quarterly":dateString =finish.clone().subtract(3, "month")- .format(I18n.t("dates.long_no_year_no_time")) ++ .format(i18n("dates.long_no_year_no_time")) +" – " +- finish.format(I18n.t("dates.long_no_year_no_time"));+ finish.format(i18n("dates.long_no_year_no_time"));break;case "weekly":let start;@@ -53,21 +53,21 @@ export default function periodTitle(period, { showDateRange, fullDay } = {}) {}dateString =- start.format(I18n.t("dates.long_no_year_no_time")) ++ start.format(i18n("dates.long_no_year_no_time")) +" – " +- finish.format(I18n.t("dates.long_no_year_no_time"));+ finish.format(i18n("dates.long_no_year_no_time"));break;case "monthly":dateString =finish.clone().subtract(1, "month")- .format(I18n.t("dates.long_no_year_no_time")) ++ .format(i18n("dates.long_no_year_no_time")) +" – " +- finish.format(I18n.t("dates.long_no_year_no_time"));+ finish.format(i18n("dates.long_no_year_no_time"));break;case "daily":- dateString = finish.clone().format(I18n.t("dates.full_no_year_no_time"));+ dateString = finish.clone().format(i18n("dates.full_no_year_no_time"));break;}diff --git a/app/assets/javascripts/discourse/app/helpers/reviewable-history-description.js b/app/assets/javascripts/discourse/app/helpers/reviewable-history-description.jsindex 133d0b3a6a3..8b961d597aa 100644--- a/app/assets/javascripts/discourse/app/helpers/reviewable-history-description.js+++ b/app/assets/javascripts/discourse/app/helpers/reviewable-history-description.js@@ -2,14 +2,12 @@ import { htmlSafe } from "@ember/template";import { htmlStatus } from "discourse/helpers/reviewable-status";import { EDITED } from "discourse/models/reviewable-history";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function reviewableHistoryDescription(rh) {switch (rh.reviewable_history_type) {case EDITED:- return htmlSafe(- iconHTML("pencil") + " " + I18n.t("review.history.edited")- );+ return htmlSafe(iconHTML("pencil") + " " + i18n("review.history.edited"));default:return htmlSafe(htmlStatus(rh.status));}diff --git a/app/assets/javascripts/discourse/app/helpers/reviewable-status.js b/app/assets/javascripts/discourse/app/helpers/reviewable-status.jsindex ddd9ac29296..93b7506f957 100644--- a/app/assets/javascripts/discourse/app/helpers/reviewable-status.js+++ b/app/assets/javascripts/discourse/app/helpers/reviewable-status.js@@ -7,7 +7,7 @@ import {REJECTED,} from "discourse/models/reviewable";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function dataFor(status, type) {switch (status) {@@ -76,7 +76,7 @@ export function htmlStatus(status, type) {return `<span class="${data.cssClass || data.name}">${icon}- ${I18n.t("review.statuses." + data.name + ".title")}+ ${i18n("review.statuses." + data.name + ".title")}</span>`;}diff --git a/app/assets/javascripts/discourse/app/helpers/theme-i18n.js b/app/assets/javascripts/discourse/app/helpers/theme-i18n.jsindex 5756eca4a36..3869b1d94a7 100644--- a/app/assets/javascripts/discourse/app/helpers/theme-i18n.js+++ b/app/assets/javascripts/discourse/app/helpers/theme-i18n.js@@ -1,5 +1,5 @@import { registerRawHelper } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";registerRawHelper("theme-i18n", themeI18n);export default function themeI18n(themeId, key, params) {@@ -10,5 +10,5 @@ export default function themeI18n(themeId, key, params) {`'themePrefix' is available automatically, and does not need to be imported.\n`);}- return I18n.t(`theme_translations.${themeId}.${key}`, params);+ return i18n(`theme_translations.${themeId}.${key}`, params);}diff --git a/app/assets/javascripts/discourse/app/helpers/user-status.js b/app/assets/javascripts/discourse/app/helpers/user-status.jsindex 31b2ec1f1a1..cb65bd5381f 100644--- a/app/assets/javascripts/discourse/app/helpers/user-status.js+++ b/app/assets/javascripts/discourse/app/helpers/user-status.js@@ -1,7 +1,7 @@import { htmlSafe } from "@ember/template";import { escapeExpression } from "discourse/lib/utilities";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function userStatus(user, { currentUser } = {}) {if (!user) {@@ -13,7 +13,7 @@ export default function userStatus(user, { currentUser } = {}) {if (user.admin && currentUser?.staff) {return htmlSafe(iconHTML("shield-halved", {- label: I18n.t("user.admin", { user: name }),+ label: i18n("user.admin", { user: name }),}));}@@ -21,7 +21,7 @@ export default function userStatus(user, { currentUser } = {}) {if (user.moderator) {return htmlSafe(iconHTML("shield-halved", {- label: I18n.t("user.moderator", { user: name }),+ label: i18n("user.moderator", { user: name }),}));}diff --git a/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js b/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.jsindex 9166bd5d19f..3cbe7b093e7 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js+++ b/app/assets/javascripts/discourse/app/instance-initializers/auth-complete.js@@ -5,7 +5,7 @@ import CreateAccount from "discourse/components/modal/create-account";import LoginModal from "discourse/components/modal/login";import cookie, { removeCookie } from "discourse/lib/cookie";import DiscourseUrl from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// This is happening outside of the app via popupconst AuthErrors = [@@ -91,7 +91,7 @@ export default {if (options.omniauth_disallow_totp) {return loginError(- I18n.t("login.omniauth_disallow_totp"),+ i18n("login.omniauth_disallow_totp"),"error",{loginName: options.email,@@ -104,7 +104,7 @@ export default {for (let i = 0; i < AuthErrors.length; i++) {const cond = AuthErrors[i];if (options[cond]) {- return loginError(htmlSafe(I18n.t(`login.${cond}`)));+ return loginError(htmlSafe(i18n(`login.${cond}`)));}}diff --git a/app/assets/javascripts/discourse/app/instance-initializers/logout.js b/app/assets/javascripts/discourse/app/instance-initializers/logout.jsindex 6a00e33d69c..87eff7f25e9 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/logout.js+++ b/app/assets/javascripts/discourse/app/instance-initializers/logout.js@@ -2,7 +2,7 @@ import { setOwner } from "@ember/owner";import { service } from "@ember/service";import logout from "discourse/lib/logout";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _showingLogout = false;@@ -41,7 +41,7 @@ class LogoutInit {_showingLogout = true;this.dialog.alert({- message: I18n.t("logout"),+ message: i18n("logout"),confirmButtonLabel: "home",didConfirm: logout,didCancel: logout,diff --git a/app/assets/javascripts/discourse/app/instance-initializers/more-topics-tabs.gjs b/app/assets/javascripts/discourse/app/instance-initializers/more-topics-tabs.gjsindex 73b7055aa63..baf0502f8fb 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/more-topics-tabs.gjs+++ b/app/assets/javascripts/discourse/app/instance-initializers/more-topics-tabs.gjs@@ -1,7 +1,7 @@import RelatedMessages from "discourse/components/related-messages";import SuggestedTopics from "discourse/components/suggested-topics";import { withPluginApi } from "discourse/lib/plugin-api";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default {initialize() {diff --git a/app/assets/javascripts/discourse/app/instance-initializers/post-decorations.js b/app/assets/javascripts/discourse/app/instance-initializers/post-decorations.jsindex ac254d84084..4e13b65feec 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/post-decorations.js+++ b/app/assets/javascripts/discourse/app/instance-initializers/post-decorations.js@@ -14,7 +14,7 @@ import { parseAsync } from "discourse/lib/text";import { setTextDirections } from "discourse/lib/text-direction";import { tokenRange } from "discourse/lib/utilities";import { iconHTML, iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default {initialize(owner) {@@ -129,13 +129,13 @@ export default {}if (props.title) {- openPopupBtn.title = I18n.t(props.title);+ openPopupBtn.title = i18n(props.title);}if (props.label && capabilities.touch) {openPopupBtn.innerHTML = `<span class="d-button-label">- ${I18n.t(props.label)}+ ${i18n(props.label)}</div>`;}diff --git a/app/assets/javascripts/discourse/app/instance-initializers/sharing-sources.js b/app/assets/javascripts/discourse/app/instance-initializers/sharing-sources.jsindex 7b83c5401ae..3d2e4c3dbe9 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/sharing-sources.js+++ b/app/assets/javascripts/discourse/app/instance-initializers/sharing-sources.js@@ -1,5 +1,5 @@import Sharing from "discourse/lib/sharing";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default {initialize(owner) {@@ -15,14 +15,14 @@ export default {)}&text=${encodeURIComponent(text)}`;},shouldOpenInPopup: true,- title: I18n.t("share.twitter"),+ title: i18n("share.twitter"),popupHeight: 265,});Sharing.addSource({id: "facebook",icon: "fab-facebook",- title: I18n.t("share.facebook"),+ title: i18n("share.facebook"),generateUrl(link, title, quote = "") {const fb_url = siteSettings.facebook_app_id? `https://www.facebook.com/dialog/share?app_id=${@@ -38,7 +38,7 @@ export default {Sharing.addSource({id: "email",icon: "envelope",- title: I18n.t("share.email"),+ title: i18n("share.email"),generateUrl(link, title, quote = "") {const body = quote ? `${quote} \n\n ${link}` : link;return (diff --git a/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js b/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.jsindex dd9e4db8633..80d639f0013 100644--- a/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js+++ b/app/assets/javascripts/discourse/app/instance-initializers/video-placeholder.js@@ -2,7 +2,7 @@ import { spinnerHTML } from "discourse/helpers/loading-spinner";import { withPluginApi } from "discourse/lib/plugin-api";import { iconHTML } from "discourse-common/lib/icon-library";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default {initialize(owner) {@@ -46,7 +46,7 @@ export default {notice.innerHTML =iconHTML("triangle-exclamation") +" " +- I18n.t("cannot_render_video");+ i18n("cannot_render_video");parentDiv.appendChild(notice);}diff --git a/app/assets/javascripts/discourse/app/lib/ajax-error.js b/app/assets/javascripts/discourse/app/lib/ajax-error.jsindex fb0f49c42cb..4e751ff1562 100644--- a/app/assets/javascripts/discourse/app/lib/ajax-error.js+++ b/app/assets/javascripts/discourse/app/lib/ajax-error.js@@ -1,7 +1,7 @@import { htmlSafe } from "@ember/template";import $ from "jquery";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function extractErrorInfo(error, defaultMessage) {if (error instanceof Error) {@@ -42,11 +42,11 @@ function extractErrorInfo(error, defaultMessage) {}if (parsedJSON.errors?.length > 1) {- parsedError = I18n.t("multiple_errors", {+ parsedError = i18n("multiple_errors", {errors: parsedJSON.errors.map((e, i) => `${i + 1}) ${e}`).join(" "),});} else if (parsedJSON.errors?.length > 0) {- parsedError = I18n.t("generic_error_with_reason", {+ parsedError = i18n("generic_error_with_reason", {error: parsedJSON.errors[0],});} else if (parsedJSON.error) {@@ -66,7 +66,7 @@ function extractErrorInfo(error, defaultMessage) {return {html,- message: parsedError || defaultMessage || I18n.t("generic_error"),+ message: parsedError || defaultMessage || i18n("generic_error"),};}diff --git a/app/assets/javascripts/discourse/app/lib/bookmark.js b/app/assets/javascripts/discourse/app/lib/bookmark.jsindex c8f3d7283f4..cbad97acb86 100644--- a/app/assets/javascripts/discourse/app/lib/bookmark.js+++ b/app/assets/javascripts/discourse/app/lib/bookmark.js@@ -1,19 +1,19 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function formattedReminderTime(reminderAt, timezone) {let reminderAtDate = moment.tz(reminderAt, timezone);- let formatted = reminderAtDate.format(I18n.t("dates.time"));+ let formatted = reminderAtDate.format(i18n("dates.time"));let now = moment.tz(timezone);let tomorrow = moment(now).add(1, "day");if (reminderAtDate.isSame(tomorrow, "date")) {- return I18n.t("bookmarks.reminders.tomorrow_with_time", {+ return i18n("bookmarks.reminders.tomorrow_with_time", {time: formatted,});} else if (reminderAtDate.isSame(now, "date")) {- return I18n.t("bookmarks.reminders.today_with_time", { time: formatted });+ return i18n("bookmarks.reminders.today_with_time", { time: formatted });}- return I18n.t("bookmarks.reminders.at_time", {- date_time: reminderAtDate.format(I18n.t("dates.long_with_year")),+ return i18n("bookmarks.reminders.at_time", {+ date_time: reminderAtDate.format(i18n("dates.long_with_year")),});}diff --git a/app/assets/javascripts/discourse/app/lib/click-track.js b/app/assets/javascripts/discourse/app/lib/click-track.jsindex 91d1ac2f6d9..2efa072746f 100644--- a/app/assets/javascripts/discourse/app/lib/click-track.js+++ b/app/assets/javascripts/discourse/app/lib/click-track.js@@ -8,7 +8,7 @@ import { isTesting } from "discourse-common/config/environment";import deprecated from "discourse-common/lib/deprecated";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL, { samePrefix } from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function isValidLink(link) {if (link instanceof jQuery) {@@ -105,7 +105,7 @@ export default {!User.current()) {const dialog = getOwnerWithFallback(this).lookup("service:dialog");- dialog.alert(I18n.t("post.errors.attachment_download_requires_login"));+ dialog.alert(i18n("post.errors.attachment_download_requires_login"));} else if (wantsNewWindow(e)) {const newWindow = window.open(href, "_blank");newWindow.opener = null;diff --git a/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js b/app/assets/javascripts/discourse/app/lib/codeblock-buttons.jsindex a3ed907fd54..06128d66120 100644--- a/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js+++ b/app/assets/javascripts/discourse/app/lib/codeblock-buttons.js@@ -7,7 +7,7 @@ import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import { iconHTML } from "discourse-common/lib/icon-library";import discourseLater from "discourse-common/lib/later";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Use to attach copy/fullscreen buttons to a block of code, either// within the post stream or for a regular element that contains@@ -111,7 +111,7 @@ export default class CodeblockButtons {if (this.showCopy) {const copyButton = document.createElement("button");copyButton.classList.add("btn", "nohighlight", "copy-cmd", "btn-flat");- copyButton.ariaLabel = I18n.t("copy_codeblock.copy");+ copyButton.ariaLabel = i18n("copy_codeblock.copy");copyButton.innerHTML = iconHTML("copy");wrapperEl.appendChild(copyButton);wrapperEl.style.right = `${@@ -127,7 +127,7 @@ export default class CodeblockButtons {"fullscreen-cmd","btn-flat");- fullscreenButton.ariaLabel = I18n.t("copy_codeblock.fullscreen");+ fullscreenButton.ariaLabel = i18n("copy_codeblock.fullscreen");fullscreenButton.innerHTML = iconHTML("discourse-expand");wrapperEl.appendChild(fullscreenButton);}@@ -188,7 +188,7 @@ export default class CodeblockButtons {_copyComplete(button) {button.classList.add("action-complete");const state = button.innerHTML;- button.innerHTML = I18n.t("copy_codeblock.copied");+ button.innerHTML = i18n("copy_codeblock.copied");const commandId = guidFor(button);diff --git a/app/assets/javascripts/discourse/app/lib/color-scheme-picker.js b/app/assets/javascripts/discourse/app/lib/color-scheme-picker.jsindex ca4a27554cb..559bde7e7f5 100644--- a/app/assets/javascripts/discourse/app/lib/color-scheme-picker.js+++ b/app/assets/javascripts/discourse/app/lib/color-scheme-picker.js@@ -2,7 +2,7 @@ import { ajax } from "discourse/lib/ajax";import cookie, { removeCookie } from "discourse/lib/cookie";import Session from "discourse/models/session";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function listColorSchemes(site, options = {}) {let schemes = site.get("user_color_schemes");@@ -32,7 +32,7 @@ export function listColorSchemes(site, options = {}) {if (!existing) {results.unshift({id: defaultDarkColorScheme.id,- name: `${defaultDarkColorScheme.name} ${I18n.t(+ name: `${defaultDarkColorScheme.name} ${i18n("user.color_schemes.default_dark_scheme")}`,});@@ -41,7 +41,7 @@ export function listColorSchemes(site, options = {}) {results.unshift({id: -1,- name: I18n.t("user.color_schemes.disable_dark_scheme"),+ name: i18n("user.color_schemes.disable_dark_scheme"),});}diff --git a/app/assets/javascripts/discourse/app/lib/composer-video-thumbnail-uppy.js b/app/assets/javascripts/discourse/app/lib/composer-video-thumbnail-uppy.jsindex e31e872291a..f38ec96ab1c 100644--- a/app/assets/javascripts/discourse/app/lib/composer-video-thumbnail-uppy.js+++ b/app/assets/javascripts/discourse/app/lib/composer-video-thumbnail-uppy.js@@ -4,7 +4,7 @@ import { getOwner, setOwner } from "@ember/owner";import { service } from "@ember/service";import { isVideo } from "discourse/lib/uploads";import UppyUpload from "discourse/lib/uppy/uppy-upload";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Ideally, this would be refactored into an uppy postprocessor and support// for that would be added to the ExtendableUploader.@@ -107,7 +107,7 @@ export default class ComposerVideoThumbnailUppy {this._uppyUpload.uppyWrapper.uppyInstance.on("upload-error",(file, error, response) => {- let message = I18n.t("wizard.upload_error");+ let message = i18n("wizard.upload_error");if (response.body.errors) {message = response.body.errors.join("\n");}diff --git a/app/assets/javascripts/discourse/app/lib/composer/toolbar.js b/app/assets/javascripts/discourse/app/lib/composer/toolbar.jsindex bf113a6553b..9e7d34f5d7d 100644--- a/app/assets/javascripts/discourse/app/lib/composer/toolbar.js+++ b/app/assets/javascripts/discourse/app/lib/composer/toolbar.js@@ -1,10 +1,10 @@import { PLATFORM_KEY_MODIFIER } from "discourse/lib/keyboard-shortcuts";import { translateModKey } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getButtonLabel(labelKey, defaultLabel) {// use the Font Awesome icon if the label matches the default- return I18n.t(labelKey) === defaultLabel ? null : labelKey;+ return i18n(labelKey) === defaultLabel ? null : labelKey;}export default class Toolbar {@@ -154,9 +154,7 @@ export default class Toolbar {createdButton.sendAction = buttonAttrs.sendAction;}- const title = I18n.t(- buttonAttrs.title || `composer.${buttonAttrs.id}_title`- );+ const title = i18n(buttonAttrs.title || `composer.${buttonAttrs.id}_title`);if (buttonAttrs.shortcut) {const shortcutTitle = `${translateModKey(PLATFORM_KEY_MODIFIER + "+"diff --git a/app/assets/javascripts/discourse/app/lib/computed.js b/app/assets/javascripts/discourse/app/lib/computed.jsindex 7a56bd051ed..1a15278cbef 100644--- a/app/assets/javascripts/discourse/app/lib/computed.js+++ b/app/assets/javascripts/discourse/app/lib/computed.js@@ -2,7 +2,7 @@ import { computed } from "@ember/object";import { htmlSafe as htmlSafeTemplateHelper } from "@ember/template";import getURL from "discourse-common/lib/get-url";import { deepEqual } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function addonFmt(str, formats) {let cachedFormats = formats;@@ -73,17 +73,20 @@ export function propertyLessThan(p1, p2) {/**Returns i18n version of a string based on a property.- @method i18n+ @method computedI18n@params {String} properties* to format@params {String} format the i18n format string@return {Function} discourseComputedProperty function**/-export function i18n(...args) {+export function computedI18n(...args) {const format = args.pop();return computed(...args, function () {- return I18n.t(addonFmt(format, ...args.map((a) => this.get(a))));+ return i18n(addonFmt(format, ...args.map((a) => this.get(a))));});}++export { computedI18n as i18n };+/**Returns htmlSafe version of a string.diff --git a/app/assets/javascripts/discourse/app/lib/desktop-notifications.js b/app/assets/javascripts/discourse/app/lib/desktop-notifications.jsindex 15c75d086ce..18d95959837 100644--- a/app/assets/javascripts/discourse/app/lib/desktop-notifications.js+++ b/app/assets/javascripts/discourse/app/lib/desktop-notifications.js@@ -5,7 +5,7 @@ import { formatUsername } from "discourse/lib/utilities";import Site from "discourse/models/site";import User from "discourse/models/user";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let primaryTab = false;let liveEnabled = false;@@ -77,11 +77,11 @@ function init(messageBus) {function confirmNotification(siteSettings) {const notification = new Notification(- I18n.t("notifications.popup.confirm_title", {+ i18n("notifications.popup.confirm_title", {site_title: siteSettings.title,}),{- body: I18n.t("notifications.popup.confirm_body"),+ body: i18n("notifications.popup.confirm_body"),icon: siteSettings.site_logo_small_url || siteSettings.site_logo_url,tag: "confirm-subscription",}@@ -149,7 +149,7 @@ async function onNotification(data, siteSettings, user, appEvents) {if (showNotifications) {const notificationTitle =data.translated_title ||- I18n.t(i18nKey(data.notification_type), {+ i18n(i18nKey(data.notification_type), {site_title: siteSettings.title,topic: data.topic_title,username: formatUsername(data.username),diff --git a/app/assets/javascripts/discourse/app/lib/export-csv.js b/app/assets/javascripts/discourse/app/lib/export-csv.jsindex 07baed9359b..9142ee4824d 100644--- a/app/assets/javascripts/discourse/app/lib/export-csv.js+++ b/app/assets/javascripts/discourse/app/lib/export-csv.js@@ -1,7 +1,7 @@import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function exportEntityByType(type, entity, args) {return ajax("/export_csv/export_entity.json", {@@ -14,7 +14,7 @@ export function exportUserArchive() {const dialog = getOwnerWithFallback(this).lookup("service:dialog");return exportEntityByType("user", "user_archive").then(function () {- dialog.alert(I18n.t("user.download_archive.success"));+ dialog.alert(i18n("user.download_archive.success"));}).catch(popupAjaxError);}diff --git a/app/assets/javascripts/discourse/app/lib/export-result.js b/app/assets/javascripts/discourse/app/lib/export-result.jsindex 01168e44870..8fcc688c60a 100644--- a/app/assets/javascripts/discourse/app/lib/export-result.js+++ b/app/assets/javascripts/discourse/app/lib/export-result.js@@ -1,12 +1,12 @@import { getOwnerWithFallback } from "discourse-common/lib/get-owner";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function outputExportResult(result) {const dialog = getOwnerWithFallback(this).lookup("service:dialog");if (result.success) {- dialog.alert(I18n.t("admin.export_csv.success"));+ dialog.alert(i18n("admin.export_csv.success"));} else {- dialog.alert(I18n.t("admin.export_csv.failed"));+ dialog.alert(i18n("admin.export_csv.failed"));}}diff --git a/app/assets/javascripts/discourse/app/lib/form-template-validation.js b/app/assets/javascripts/discourse/app/lib/form-template-validation.jsindex cf9e7c9cf4e..2270d301b5c 100644--- a/app/assets/javascripts/discourse/app/lib/form-template-validation.js+++ b/app/assets/javascripts/discourse/app/lib/form-template-validation.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function getFormTemplateObject(form) {const formData = new FormData(form);@@ -124,35 +124,35 @@ function _showErrorMessage(field, element) {];_showErrorByType(element, field, prefix, types);} else if (field.validity.tooShort) {- element.textContent = I18n.t("form_templates.errors.too_short", {+ element.textContent = i18n("form_templates.errors.too_short", {count: field.minLength,});} else if (field.validity.tooLong) {- element.textContent = I18n.t("form_templates.errors.too_long", {+ element.textContent = i18n("form_templates.errors.too_long", {count: field.maxLength,});} else if (field.validity.rangeOverflow) {- element.textContent = I18n.t("form_templates.errors.range_overflow", {+ element.textContent = i18n("form_templates.errors.range_overflow", {count: field.max,});} else if (field.validity.rangeUnderflow) {- element.textContent = I18n.t("form_templates.errors.range_underflow", {+ element.textContent = i18n("form_templates.errors.range_underflow", {count: field.min,});} else if (field.validity.patternMismatch) {- element.textContent = I18n.t("form_templates.errors.pattern_mismatch");+ element.textContent = i18n("form_templates.errors.pattern_mismatch");} else if (field.validity.badInput) {- element.textContent = I18n.t("form_templates.errors.bad_input");+ element.textContent = i18n("form_templates.errors.bad_input");}}function _showErrorByType(element, field, prefix, types, i18nMappings) {if (!types.includes(field.type)) {- element.textContent = I18n.t(`${prefix}.default`);+ element.textContent = i18n(`${prefix}.default`);} else {types.forEach((type) => {if (field.type === type) {- element.textContent = I18n.t(+ element.textContent = i18n(`${prefix}.${i18nMappings && i18nMappings[type] ? i18nMappings[type] : type}`diff --git a/app/assets/javascripts/discourse/app/lib/formatter.js b/app/assets/javascripts/discourse/app/lib/formatter.jsindex aecb943c192..f0a88bdf1c4 100644--- a/app/assets/javascripts/discourse/app/lib/formatter.js+++ b/app/assets/javascripts/discourse/app/lib/formatter.js@@ -1,14 +1,14 @@import jQuery from "jquery";import deprecated from "discourse-common/lib/deprecated";import { helperContext, makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";export function shortDate(date) {- return moment(date).format(I18n.t("dates.medium.date_year"));+ return moment(date).format(i18n("dates.medium.date_year"));}export function shortDateNoYear(date) {- return moment(date).format(I18n.t("dates.tiny.date_month"));+ return moment(date).format(i18n("dates.tiny.date_month"));}// Suppress year if it's this year@@ -19,7 +19,7 @@ export function smartShortDate(date, withYear = tinyDateYear) {}export function tinyDateYear(date) {- return moment(date).format(I18n.t("dates.tiny.date_year"));+ return moment(date).format(i18n("dates.tiny.date_year"));}// http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript@@ -34,7 +34,7 @@ export function longDate(dt) {if (!dt) {return;}- return moment(dt).format(I18n.t("dates.long_with_year"));+ return moment(dt).format(i18n("dates.long_with_year"));}// suppress year, if current year@@ -44,9 +44,9 @@ export function longDateNoYear(dt) {}if (new Date().getFullYear() !== dt.getFullYear()) {- return moment(dt).format(I18n.t("dates.long_date_with_year"));+ return moment(dt).format(i18n("dates.long_date_with_year"));} else {- return moment(dt).format(I18n.t("dates.long_date_without_year"));+ return moment(dt).format(i18n("dates.long_date_without_year"));}}@@ -132,18 +132,18 @@ export function until(untilDate, timezone, locale) {const localeData = moment.localeData(locale);untilFormatted = untilMoment.format(localeData.longDateFormat("LT"));} else {- untilFormatted = untilMoment.format(I18n.t("dates.long_no_year_no_time"));+ untilFormatted = untilMoment.format(i18n("dates.long_no_year_no_time"));}- return `${I18n.t("until")} ${untilFormatted}`;+ return `${i18n("until")} ${untilFormatted}`;}function wrapAgo(dateStr) {- return I18n.t("dates.wrap_ago", { date: dateStr });+ return i18n("dates.wrap_ago", { date: dateStr });}function wrapOn(dateStr) {- return I18n.t("dates.wrap_on", { date: dateStr });+ return i18n("dates.wrap_on", { date: dateStr });}export function duration(distance, ageOpts) {@@ -156,7 +156,7 @@ export function duration(distance, ageOpts) {const t = function (key, opts) {const format = (ageOpts && ageOpts.format) || "tiny";- const result = I18n.t("dates." + format + "." + key, opts);+ const result = i18n("dates." + format + "." + key, opts);return ageOpts && ageOpts.addAgo ? wrapAgo(result) : result;};@@ -222,7 +222,7 @@ function relativeAgeTiny(date, ageOpts) {let formatted;const t = function (key, opts) {- const result = I18n.t("dates." + format + "." + key, opts);+ const result = i18n("dates." + format + "." + key, opts);return ageOpts && ageOpts.addAgo ? wrapAgo(result) : result;};@@ -275,7 +275,7 @@ export function relativeAgeMediumSpan(distance, leaveAgo) {const distanceInMinutes = Math.round(distance / 60.0);const t = function (key, opts) {- return I18n.t(+ return i18n("dates.medium" + (leaveAgo ? "_with_ago" : "") + "." + key,opts);@@ -328,7 +328,7 @@ function relativeAgeMedium(date, options) {let displayDate = "";if (distance < oneMinuteAgo) {- displayDate = I18n.t("now");+ displayDate = i18n("now");} else if (distance > fiveDaysAgo) {displayDate = smartShortDate(date, shortDate);if (options.wrapOn) {@@ -384,13 +384,13 @@ export function number(val) {if (val > 999999) {formattedNumber = I18n.toNumber(val / 1000000, { precision: 1 });- return I18n.t("number.short.millions", { number: formattedNumber });+ return i18n("number.short.millions", { number: formattedNumber });} else if (val > 99999) {formattedNumber = I18n.toNumber(Math.floor(val / 1000), { precision: 0 });- return I18n.t("number.short.thousands", { number: formattedNumber });+ return i18n("number.short.thousands", { number: formattedNumber });} else if (val > 999) {formattedNumber = I18n.toNumber(val / 1000, { precision: 1 });- return I18n.t("number.short.thousands", { number: formattedNumber });+ return i18n("number.short.thousands", { number: formattedNumber });}return val.toString();}diff --git a/app/assets/javascripts/discourse/app/lib/lightbox.js b/app/assets/javascripts/discourse/app/lib/lightbox.jsindex 951418ec859..f25a8a94e2c 100644--- a/app/assets/javascripts/discourse/app/lib/lightbox.js+++ b/app/assets/javascripts/discourse/app/lib/lightbox.js@@ -9,7 +9,7 @@ import deprecated from "discourse-common/lib/deprecated";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import { helperContext } from "discourse-common/lib/helpers";import { renderIcon } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export async function setupLightboxes({ container, selector }) {const lightboxService = getOwnerWithFallback(this).lookup("service:lightbox");@@ -57,20 +57,20 @@ export default function lightbox(elem, siteSettings) {closeOnContentClick: false,removalDelay: isTesting() ? 0 : 300,mainClass: "mfp-zoom-in",- tClose: I18n.t("lightbox.close"),+ tClose: i18n("lightbox.close"),tLoading: spinnerHTML,prependTo: isTesting() && document.getElementById("ember-testing"),gallery: {enabled: true,- tPrev: I18n.t("lightbox.previous"),- tNext: I18n.t("lightbox.next"),- tCounter: I18n.t("lightbox.counter"),+ tPrev: i18n("lightbox.previous"),+ tNext: i18n("lightbox.next"),+ tCounter: i18n("lightbox.counter"),navigateByImgClick: imageClickNavigation,},ajax: {- tError: I18n.t("lightbox.content_load_error"),+ tError: i18n("lightbox.content_load_error"),},callbacks: {@@ -112,7 +112,7 @@ export default function lightbox(elem, siteSettings) {},image: {- tError: I18n.t("lightbox.image_load_error"),+ tError: i18n("lightbox.image_load_error"),titleSrc(item) {const href = item.el.data("download-href") || item.src;let src = [@@ -128,7 +128,7 @@ export default function lightbox(elem, siteSettings) {href +'">' +renderIcon("string", "download") +- I18n.t("lightbox.download") ++ i18n("lightbox.download") +"</a>");}@@ -137,7 +137,7 @@ export default function lightbox(elem, siteSettings) {item.src +'">' +renderIcon("string", "image") +- I18n.t("lightbox.open") ++ i18n("lightbox.open") +"</a>");return src.join(" · ");diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/admin-problems.js b/app/assets/javascripts/discourse/app/lib/notification-types/admin-problems.jsindex f1b798beb96..6159578062a 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/admin-problems.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/admin-problems.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get label() {@@ -8,7 +8,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.admin_problems");+ return i18n("notifications.admin_problems");}get linkHref() {diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/base.js b/app/assets/javascripts/discourse/app/lib/notification-types/base.jsindex 3bd5400188f..a4e676ab88d 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/base.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/base.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import { emojiUnescape } from "discourse/lib/text";import { userPath } from "discourse/lib/url";import { formatUsername, postUrl } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NotificationTypeBase {constructor({ notification, currentUser, siteSettings, site }) {@@ -54,7 +54,7 @@ export default class NotificationTypeBase {*/get linkTitle() {if (this.notificationName) {- return I18n.t(`notifications.titles.${this.notificationName}`);+ return i18n(`notifications.titles.${this.notificationName}`);} else {// notifications with unknown types, e.g. notifications that come from a// plugin that's no longer installeddiff --git a/app/assets/javascripts/discourse/app/lib/notification-types/bookmark-reminder.js b/app/assets/javascripts/discourse/app/lib/notification-types/bookmark-reminder.jsindex 13dec5c304a..1a2b3eb89f3 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/bookmark-reminder.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/bookmark-reminder.js@@ -1,11 +1,11 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import getUrl from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkTitle() {if (this.notification.data.bookmark_name) {- return I18n.t("notifications.titles.bookmark_reminder_with_name", {+ return i18n("notifications.titles.bookmark_reminder_with_name", {name: this.notification.data.bookmark_name,});}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/custom.js b/app/assets/javascripts/discourse/app/lib/notification-types/custom.jsindex a34805dec1e..eb2edda8160 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/custom.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/custom.js@@ -1,10 +1,10 @@import NotificationTypeBase from "discourse/lib/notification-types/base";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkTitle() {if (this.notification.data.title) {- return I18n.t(this.notification.data.title);+ return i18n(this.notification.data.title);}}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/granted-badge.js b/app/assets/javascripts/discourse/app/lib/notification-types/granted-badge.jsindex bca3d8facdd..937d55e073b 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/granted-badge.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/granted-badge.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -21,7 +21,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.granted_badge", {+ return i18n("notifications.granted_badge", {description: this.notification.data.badge_name,});}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/group-message-summary.js b/app/assets/javascripts/discourse/app/lib/notification-types/group-message-summary.jsindex a06b08ba677..6b9780a4a16 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/group-message-summary.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/group-message-summary.js@@ -1,10 +1,10 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get description() {- return I18n.t("notifications.group_message_summary", {+ return i18n("notifications.group_message_summary", {count: this.notification.data.inbox_count,group_name: this.notification.data.group_name,});diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/invitee-accepted.js b/app/assets/javascripts/discourse/app/lib/notification-types/invitee-accepted.jsindex d403f2d44e7..bce428cf235 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/invitee-accepted.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/invitee-accepted.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -8,6 +8,6 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.invitee_accepted_your_invitation");+ return i18n("notifications.invitee_accepted_your_invitation");}}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/liked-consolidated.js b/app/assets/javascripts/discourse/app/lib/notification-types/liked-consolidated.jsindex 452f8e19be1..1d61004dc49 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/liked-consolidated.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/liked-consolidated.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -11,7 +11,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.liked_consolidated_description", {+ return i18n("notifications.liked_consolidated_description", {count: this.notification.data.count,});}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/liked.js b/app/assets/javascripts/discourse/app/lib/notification-types/liked.jsindex f109105112b..aa85c85c1f5 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/liked.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/liked.js@@ -1,16 +1,16 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { formatUsername } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get label() {if (this.count === 2) {- return I18n.t("notifications.liked_by_2_users", {+ return i18n("notifications.liked_by_2_users", {username: this.username,username2: this.#username2,});} else if (this.count > 2) {- return I18n.t("notifications.liked_by_multiple_users", {+ return i18n("notifications.liked_by_multiple_users", {username: this.username,count: this.count - 1,});diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/linked-consolidated.js b/app/assets/javascripts/discourse/app/lib/notification-types/linked-consolidated.jsindex 9ea8fcf43ce..e02d5cec2e5 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/linked-consolidated.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/linked-consolidated.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -10,7 +10,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.linked_consolidated_description", {+ return i18n("notifications.linked_consolidated_description", {count: this.notification.data.count,});}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-accepted.js b/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-accepted.jsindex 2174e5fa0dd..df7f8b10864 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-accepted.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-accepted.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { groupPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -8,7 +8,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.membership_request_accepted", {+ return i18n("notifications.membership_request_accepted", {group_name: this.notification.data.group_name,});}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-consolidated.js b/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-consolidated.jsindex 534129f5ba5..38011aa0dba 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-consolidated.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/membership-request-consolidated.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import { userPath } from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get linkHref() {@@ -10,7 +10,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.membership_request_consolidated", {+ return i18n("notifications.membership_request_consolidated", {group_name: this.notification.data.group_name,count: this.notification.data.count,});diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/moved-post.js b/app/assets/javascripts/discourse/app/lib/notification-types/moved-post.jsindex 9d7df157ffd..9db3f2f435f 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/moved-post.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/moved-post.js@@ -1,8 +1,8 @@import NotificationTypeBase from "discourse/lib/notification-types/base";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get label() {- return I18n.t("notifications.user_moved_post", { username: this.username });+ return i18n("notifications.user_moved_post", { username: this.username });}}diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/new-features.js b/app/assets/javascripts/discourse/app/lib/notification-types/new-features.jsindex 4955bec4818..3a7e473ea79 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/new-features.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/new-features.js@@ -1,6 +1,6 @@import NotificationTypeBase from "discourse/lib/notification-types/base";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get label() {@@ -8,7 +8,7 @@ export default class extends NotificationTypeBase {}get description() {- return I18n.t("notifications.new_features");+ return i18n("notifications.new_features");}get linkHref() {diff --git a/app/assets/javascripts/discourse/app/lib/notification-types/watching-first-post.js b/app/assets/javascripts/discourse/app/lib/notification-types/watching-first-post.jsindex 3fb92268fda..0b4285a5663 100644--- a/app/assets/javascripts/discourse/app/lib/notification-types/watching-first-post.js+++ b/app/assets/javascripts/discourse/app/lib/notification-types/watching-first-post.js@@ -1,8 +1,8 @@import NotificationTypeBase from "discourse/lib/notification-types/base";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends NotificationTypeBase {get label() {- return I18n.t("notifications.watching_first_post_label");+ return i18n("notifications.watching_first_post_label");}}diff --git a/app/assets/javascripts/discourse/app/lib/post-action-feedback.js b/app/assets/javascripts/discourse/app/lib/post-action-feedback.jsindex 6cd34026648..05a986b957a 100644--- a/app/assets/javascripts/discourse/app/lib/post-action-feedback.js+++ b/app/assets/javascripts/discourse/app/lib/post-action-feedback.js@@ -1,5 +1,5 @@import { SVG_NAMESPACE } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function postActionFeedback({postId,@@ -42,7 +42,7 @@ export function showAlert(postId, actionClass, messageKey, opts = {}) {actionBtn?.classList.add("post-action-feedback-button");- createAlert(I18n.t(messageKey), postId, actionBtn);+ createAlert(i18n(messageKey), postId, actionBtn);createCheckmark(actionBtn, actionClass, postId);styleBtn(actionBtn);}diff --git a/app/assets/javascripts/discourse/app/lib/register-topic-footer-button.js b/app/assets/javascripts/discourse/app/lib/register-topic-footer-button.jsindex dee2a712e94..37a83d5e7ce 100644--- a/app/assets/javascripts/discourse/app/lib/register-topic-footer-button.js+++ b/app/assets/javascripts/discourse/app/lib/register-topic-footer-button.js@@ -1,5 +1,5 @@import { computed } from "@ember/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _topicFooterButtons = {};@@ -103,12 +103,12 @@ export function getTopicFooterButtons() {const label = _compute(button, "label");discourseComputedButton.label = label- ? I18n.t(label)+ ? i18n(label): _compute(button, "translatedLabel");const ariaLabel = _compute(button, "ariaLabel");if (ariaLabel) {- discourseComputedButton.ariaLabel = I18n.t(ariaLabel);+ discourseComputedButton.ariaLabel = i18n(ariaLabel);} else {const translatedAriaLabel = _compute(button, "translatedAriaLabel");discourseComputedButton.ariaLabel =@@ -117,7 +117,7 @@ export function getTopicFooterButtons() {const title = _compute(button, "title");discourseComputedButton.title = title- ? I18n.t(title)+ ? i18n(title): _compute(button, "translatedTitle");discourseComputedButton.classNames = (diff --git a/app/assets/javascripts/discourse/app/lib/render-tags.js b/app/assets/javascripts/discourse/app/lib/render-tags.jsindex 9b5de0fdc05..4ec6c029080 100644--- a/app/assets/javascripts/discourse/app/lib/render-tags.js+++ b/app/assets/javascripts/discourse/app/lib/render-tags.js@@ -1,5 +1,5 @@import renderTag from "discourse/lib/render-tag";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let callbacks = null;let priorities = null;@@ -58,7 +58,7 @@ export default function (topic, params) {if (customHtml || (tags && tags.length > 0)) {buffer = `<div class='discourse-tags' role='list'- aria-label=${I18n.t("tagging.tags")}>`;+ aria-label=${i18n("tagging.tags")}>`;if (tags) {for (let i = 0; i < tags.length; i++) {buffer +=diff --git a/app/assets/javascripts/discourse/app/lib/reviewable-types/base.js b/app/assets/javascripts/discourse/app/lib/reviewable-types/base.jsindex 54e271bc0ef..8531de2151d 100644--- a/app/assets/javascripts/discourse/app/lib/reviewable-types/base.js+++ b/app/assets/javascripts/discourse/app/lib/reviewable-types/base.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ReviewableTypeBase {constructor({ reviewable, currentUser, siteSettings, site }) {@@ -13,12 +13,12 @@ export default class ReviewableTypeBase {if (flagger) {return flagger;} else {- return I18n.t("user_menu.reviewable.deleted_user");+ return i18n("user_menu.reviewable.deleted_user");}}get description() {- return I18n.t("user_menu.reviewable.default_item", {+ return i18n("user_menu.reviewable.default_item", {reviewable_id: this.reviewable.id,});}diff --git a/app/assets/javascripts/discourse/app/lib/reviewable-types/flagged-post.js b/app/assets/javascripts/discourse/app/lib/reviewable-types/flagged-post.jsindex 94bb7132523..0818fa2878c 100644--- a/app/assets/javascripts/discourse/app/lib/reviewable-types/flagged-post.js+++ b/app/assets/javascripts/discourse/app/lib/reviewable-types/flagged-post.js@@ -1,7 +1,7 @@import { htmlSafe } from "@ember/template";import ReviewableTypeBase from "discourse/lib/reviewable-types/base";import { emojiUnescape } from "discourse/lib/text";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends ReviewableTypeBase {get description() {@@ -9,13 +9,13 @@ export default class extends ReviewableTypeBase {const postNumber = this.reviewable.post_number;if (title && postNumber) {return htmlSafe(- I18n.t("user_menu.reviewable.post_number_with_topic_title", {+ i18n("user_menu.reviewable.post_number_with_topic_title", {post_number: postNumber,title: emojiUnescape(title),}));} else {- return I18n.t("user_menu.reviewable.deleted_post");+ return i18n("user_menu.reviewable.deleted_post");}}}diff --git a/app/assets/javascripts/discourse/app/lib/reviewable-types/queued-post.js b/app/assets/javascripts/discourse/app/lib/reviewable-types/queued-post.jsindex fc98b712be7..874e955f430 100644--- a/app/assets/javascripts/discourse/app/lib/reviewable-types/queued-post.js+++ b/app/assets/javascripts/discourse/app/lib/reviewable-types/queued-post.js@@ -2,11 +2,11 @@ import { htmlSafe } from "@ember/template";import ReviewableTypeBase from "discourse/lib/reviewable-types/base";import { emojiUnescape } from "discourse/lib/text";import { escapeExpression } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends ReviewableTypeBase {get actor() {- return I18n.t("user_menu.reviewable.queue");+ return i18n("user_menu.reviewable.queue");}get description() {@@ -19,7 +19,7 @@ export default class extends ReviewableTypeBase {return htmlSafe(title);} else {return htmlSafe(- I18n.t("user_menu.reviewable.new_post_in_topic", {+ i18n("user_menu.reviewable.new_post_in_topic", {title,}));diff --git a/app/assets/javascripts/discourse/app/lib/reviewable-types/user.js b/app/assets/javascripts/discourse/app/lib/reviewable-types/user.jsindex 6e967b94cd4..c0af6af7362 100644--- a/app/assets/javascripts/discourse/app/lib/reviewable-types/user.js+++ b/app/assets/javascripts/discourse/app/lib/reviewable-types/user.js@@ -1,9 +1,9 @@import ReviewableTypeBase from "discourse/lib/reviewable-types/base";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends ReviewableTypeBase {get description() {- return I18n.t("user_menu.reviewable.user_requires_approval", {+ return i18n("user_menu.reviewable.user_requires_approval", {username: this.reviewable.username,});}diff --git a/app/assets/javascripts/discourse/app/lib/search.js b/app/assets/javascripts/discourse/app/lib/search.jsindex a5d6acb2159..668b6be88cb 100644--- a/app/assets/javascripts/discourse/app/lib/search.js+++ b/app/assets/javascripts/discourse/app/lib/search.js@@ -15,7 +15,7 @@ import User from "discourse/models/user";import getURL from "discourse-common/lib/get-url";import { deepMerge } from "discourse-common/lib/object";import { findRawTemplate } from "discourse-common/lib/raw-templates";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const translateResultsCallbacks = [];const MAX_RECENT_SEARCHES = 5; // should match backend constant with the same name@@ -191,15 +191,15 @@ export function searchContextDescription(type, name) {if (type) {switch (type) {case "topic":- return I18n.t("search.context.topic");+ return i18n("search.context.topic");case "user":- return I18n.t("search.context.user", { username: name });+ return i18n("search.context.user", { username: name });case "category":- return I18n.t("search.context.category", { category: name });+ return i18n("search.context.category", { category: name });case "tag":- return I18n.t("search.context.tag", { tag: name });+ return i18n("search.context.tag", { tag: name });case "private_messages":- return I18n.t("search.context.private_messages");+ return i18n("search.context.private_messages");}}}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/admin-sidebar.js b/app/assets/javascripts/discourse/app/lib/sidebar/admin-sidebar.jsindex 470236d7b32..ac12228719e 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/admin-sidebar.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/admin-sidebar.js@@ -11,7 +11,7 @@ import { ADMIN_PANEL } from "discourse/lib/sidebar/panels";import { escapeExpression } from "discourse/lib/utilities";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";let additionalAdminSidebarSectionLinks = {};@@ -60,7 +60,7 @@ class SidebarAdminSectionLink extends BaseCustomSidebarSectionLink {get text() {return this.adminSidebarNavLink.label- ? I18n.t(this.adminSidebarNavLink.label)+ ? i18n(this.adminSidebarNavLink.label): this.adminSidebarNavLink.text;}@@ -153,7 +153,7 @@ function defineAdminSection(get text() {return this.adminNavSectionData.label- ? I18n.t(this.adminNavSectionData.label)+ ? i18n(this.adminNavSectionData.label): this.adminNavSectionData.text;}@@ -258,7 +258,7 @@ export function addAdminSidebarSectionLink(sectionName, link) {// label must be valid, don't want broken [XYZ translation missing]if (link.label &&- I18n.t(link.label) === I18n.missingTranslation(link.label, null, {})+ i18n(link.label) === I18n.missingTranslation(link.label, null, {})) {// eslint-disable-next-line no-consoleconsole.debug(@@ -382,7 +382,7 @@ export default class AdminSidebarPanel extends BaseCustomSidebarPanel {if (link.keywords) {this.adminSidebarStateManager.setLinkKeywords(link.name,- I18n.t(link.keywords).split("|")+ i18n(link.keywords).split("|"));}})@@ -424,6 +424,6 @@ export default class AdminSidebarPanel extends BaseCustomSidebarPanel {),};- return htmlSafe(I18n.t("sidebar.no_results.description", params));+ return htmlSafe(i18n("sidebar.no_results.description", params));}}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/about-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/about-section-link.jsindex bae4df2ebc1..198ac143ad6 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/about-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/about-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AboutSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class AboutSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.about.title");+ return i18n("sidebar.sections.community.links.about.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/badges-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/badges-section-link.jsindex c43f0685896..48b2976c251 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/badges-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/badges-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BadgesSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class BadgesSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.badges.title");+ return i18n("sidebar.sections.community.links.badges.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.jsindex 7dacb08e0cd..f2900934b58 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/everything-section-link.js@@ -1,6 +1,6 @@import { tracked } from "@glimmer/tracking";import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EverythingSectionLink extends BaseSectionLink {@tracked totalUnread = 0;@@ -40,11 +40,11 @@ export default class EverythingSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.topics.title");+ return i18n("sidebar.sections.community.links.topics.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });@@ -62,11 +62,11 @@ export default class EverythingSectionLink extends BaseSectionLink {if (this.#newNewViewEnabled && this.#unreadAndNewCount > 0) {return this.#unreadAndNewCount.toString();} else if (this.totalUnread > 0) {- return I18n.t("sidebar.unread_count", {+ return i18n("sidebar.unread_count", {count: this.totalUnread,});} else if (this.totalNew > 0) {- return I18n.t("sidebar.new_count", {+ return i18n("sidebar.new_count", {count: this.totalNew,});}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.jsindex dcb1643dac8..4b3701b6862 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/faq-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FAQSectionLink extends BaseSectionLink {get renameToGuidelines() {@@ -22,16 +22,16 @@ export default class FAQSectionLink extends BaseSectionLink {get title() {if (this.renameToGuidelines) {- return I18n.t("sidebar.sections.community.links.guidelines.title");+ return i18n("sidebar.sections.community.links.guidelines.title");} else {- return I18n.t("sidebar.sections.community.links.faq.title");+ return i18n("sidebar.sections.community.links.faq.title");}}get text() {const name = this.renameToGuidelines ? "Guidelines" : this.overridenName;- return I18n.t(+ return i18n(`sidebar.sections.community.links.${name.toLowerCase()}.content`,{ defaultValue: name });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/groups-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/groups-section-link.jsindex 57218009aff..57e8ecc5f2b 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/groups-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/groups-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class GroupsSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.groups.title");+ return i18n("sidebar.sections.community.links.groups.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/users-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/users-section-link.jsindex 11d59180b63..7b0e409f8b0 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/users-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/common/community-section/users-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UsersSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class UsersSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.users.title");+ return i18n("sidebar.sections.community.links.users.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/custom-sections.js b/app/assets/javascripts/discourse/app/lib/sidebar/custom-sections.jsindex 2a7f5c1bf9b..b53657a23ac 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/custom-sections.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/custom-sections.js@@ -2,7 +2,7 @@ import BaseCustomSidebarPanel from "discourse/lib/sidebar/base-custom-sidebar-paimport BaseCustomSidebarSection from "discourse/lib/sidebar/base-custom-sidebar-section";import BaseCustomSidebarSectionLink from "discourse/lib/sidebar/base-custom-sidebar-section-link";import { MAIN_PANEL } from "discourse/lib/sidebar/panels";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminSidebarPanel from "./admin-sidebar";class MainSidebarPanel {@@ -13,7 +13,7 @@ class MainSidebarPanel {}get switchButtonLabel() {- return I18n.t("sidebar.panels.forum.label");+ return i18n("sidebar.panels.forum.label");}get switchButtonIcon() {diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/section.js b/app/assets/javascripts/discourse/app/lib/sidebar/section.jsindex c3a3c010ec1..fe656be9196 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/section.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/section.js@@ -7,7 +7,7 @@ import { ajax } from "discourse/lib/ajax";import SectionLink from "discourse/lib/sidebar/section-link";import { unicodeSlugify } from "discourse/lib/utilities";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Section {@service currentUser;@@ -47,7 +47,7 @@ export default class Section {model: this,});},- title: I18n.t("sidebar.sections.custom.edit"),+ title: i18n("sidebar.sections.custom.edit"),},];}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/categories-section/category-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/categories-section/category-section-link.jsindex d14bd6de981..311fb362a48 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/categories-section/category-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/categories-section/category-section-link.js@@ -2,7 +2,7 @@ import { tracked } from "@glimmer/tracking";import { get, set } from "@ember/object";import Category from "discourse/models/category";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const UNREAD_AND_NEW_COUNTABLE = {propertyName: "unreadAndNewCount",@@ -19,7 +19,7 @@ const DEFAULT_COUNTABLES = [{propertyName: "totalUnread",badgeTextFunction: (count) => {- return I18n.t("sidebar.unread_count", { count });+ return i18n("sidebar.unread_count", { count });},route: "discovery.unreadCategory",refreshCountFunction: ({ topicTrackingState, category }) => {@@ -31,7 +31,7 @@ const DEFAULT_COUNTABLES = [{propertyName: "totalNew",badgeTextFunction: (count) => {- return I18n.t("sidebar.new_count", { count });+ return i18n("sidebar.new_count", { count });},route: "discovery.newCategory",refreshCountFunction: ({ topicTrackingState, category }) => {diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section-link.jsindex f6d63f44859..d891f8f9915 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AdminSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class AdminSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.admin.content");+ return i18n("sidebar.sections.community.links.admin.content");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section.jsindex 756bd31ceb6..74c9eba413e 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/admin-section.js@@ -2,7 +2,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import SidebarSectionForm from "discourse/components/modal/sidebar-section-form";import CommonCommunitySection from "discourse/lib/sidebar/common/community-section/section";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends CommonCommunitySection {@service modal;@@ -14,7 +14,7 @@ export default class extends CommonCommunitySection {}get moreSectionButtonText() {- return I18n.t(+ return i18n(`sidebar.sections.community.edit_section.${this.navigationMenu.isDesktopDropdownMode? "header_dropdown"diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/invite-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/invite-section-link.jsindex f6e5469d087..1096d34c031 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/invite-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/invite-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class InviteSectionLink extends BaseSectionLink {get name() {@@ -11,11 +11,11 @@ export default class InviteSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.invite.content");+ return i18n("sidebar.sections.community.links.invite.content");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.jsindex 4e93ba5512b..6b0b8032283 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/my-posts-section-link.js@@ -1,6 +1,6 @@import { tracked } from "@glimmer/tracking";import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const USER_DRAFTS_CHANGED_EVENT = "user-drafts:changed";@@ -61,17 +61,17 @@ export default class MyPostsSectionLink extends BaseSectionLink {get title() {if (this._hasDraft) {- return I18n.t("sidebar.sections.community.links.my_posts.title_drafts");+ return i18n("sidebar.sections.community.links.my_posts.title_drafts");} else {- return I18n.t("sidebar.sections.community.links.my_posts.title");+ return i18n("sidebar.sections.community.links.my_posts.title");}}get text() {if (this._hasDraft && this.currentUser?.new_new_view_enabled) {- return I18n.t("sidebar.sections.community.links.my_posts.content_drafts");+ return i18n("sidebar.sections.community.links.my_posts.content_drafts");} else {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase().replace(" ", "_")}.content`,@@ -88,7 +88,7 @@ export default class MyPostsSectionLink extends BaseSectionLink {if (this.currentUser.new_new_view_enabled) {return this.draftCount.toString();} else {- return I18n.t("sidebar.sections.community.links.my_posts.draft_count", {+ return i18n("sidebar.sections.community.links.my_posts.draft_count", {count: this.draftCount,});}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/review-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/review-section-link.jsindex 75598e571d9..f7ea9c98b62 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/review-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/community-section/review-section-link.js@@ -1,5 +1,5 @@import BaseSectionLink from "discourse/lib/sidebar/base-community-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ReviewSectionLink extends BaseSectionLink {get shouldDisplay() {@@ -15,11 +15,11 @@ export default class ReviewSectionLink extends BaseSectionLink {}get title() {- return I18n.t("sidebar.sections.community.links.review.title");+ return i18n("sidebar.sections.community.links.review.title");}get text() {- return I18n.t(+ return i18n(`sidebar.sections.community.links.${this.overridenName.toLowerCase()}.content`,{ defaultValue: this.overridenName });@@ -29,7 +29,7 @@ export default class ReviewSectionLink extends BaseSectionLink {// force a tracker for reviewable_count by using .get to ensure badgeText// rerenders when reviewable_count changesif (this.currentUser?.get("reviewable_count") > 0) {- return I18n.t("sidebar.sections.community.links.review.pending_count", {+ return i18n("sidebar.sections.community.links.review.pending_count", {count: this.currentUser.reviewable_count,});}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/group-message-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/group-message-section-link.jsindex b4006b68bec..44231c88b5c 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/group-message-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/group-message-section-link.js@@ -1,5 +1,5 @@import MessageSectionLink from "discourse/lib/sidebar/user/messages-section/message-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupMessageSectionLink extends MessageSectionLink {routeNames = new Set([@@ -40,11 +40,11 @@ export default class GroupMessageSectionLink extends MessageSectionLink {if (this._isInbox) {return this.group.name;} else if (this.count > 0) {- return I18n.t(`sidebar.sections.messages.links.${this.type}_with_count`, {+ return i18n(`sidebar.sections.messages.links.${this.type}_with_count`, {count: this.count,});} else {- return I18n.t(`sidebar.sections.messages.links.${this.type}`);+ return i18n(`sidebar.sections.messages.links.${this.type}`);}}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/personal-message-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/personal-message-section-link.jsindex a665b58e5e4..cceaad3814b 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/personal-message-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/personal-message-section-link.js@@ -1,5 +1,5 @@import MessageSectionLink from "discourse/lib/sidebar/user/messages-section/message-section-link";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PersonalMessageSectionLink extends MessageSectionLink {routeNames = new Set([@@ -39,11 +39,11 @@ export default class PersonalMessageSectionLink extends MessageSectionLink {get text() {if (this.count > 0) {- return I18n.t(`sidebar.sections.messages.links.${this.type}_with_count`, {+ return i18n(`sidebar.sections.messages.links.${this.type}_with_count`, {count: this.count,});} else {- return I18n.t(`sidebar.sections.messages.links.${this.type}`);+ return i18n(`sidebar.sections.messages.links.${this.type}`);}}diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/tags-section/tag-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/tags-section/tag-section-link.jsindex 45e5565f1b7..d92bfe8633f 100644--- a/app/assets/javascripts/discourse/app/lib/sidebar/user/tags-section/tag-section-link.js+++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/tags-section/tag-section-link.js@@ -1,7 +1,7 @@import { tracked } from "@glimmer/tracking";import BaseTagSectionLink from "discourse/lib/sidebar/user/tags-section/base-tag-section-link";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TagSectionLink extends BaseTagSectionLink {@tracked totalUnread = 0;@@ -59,11 +59,11 @@ export default class TagSectionLink extends BaseTagSectionLink {if (this.#newNewViewEnabled && this.#unreadAndNewCount > 0) {return this.#unreadAndNewCount.toString();} else if (this.totalUnread > 0) {- return I18n.t("sidebar.unread_count", {+ return i18n("sidebar.unread_count", {count: this.totalUnread,});} else if (this.totalNew > 0) {- return I18n.t("sidebar.new_count", {+ return i18n("sidebar.new_count", {count: this.totalNew,});}diff --git a/app/assets/javascripts/discourse/app/lib/site-setting-filter.js b/app/assets/javascripts/discourse/app/lib/site-setting-filter.jsindex 91c74f18169..e3d3f3fb243 100644--- a/app/assets/javascripts/discourse/app/lib/site-setting-filter.js+++ b/app/assets/javascripts/discourse/app/lib/site-setting-filter.js@@ -1,5 +1,5 @@import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class SiteSettingFilter {constructor(siteSettings) {@@ -46,7 +46,7 @@ export default class SiteSettingFilter {if (opts.includeAllCategory) {all = {nameKey: "all_results",- name: I18n.t("admin.site_settings.categories.all_results"),+ name: i18n("admin.site_settings.categories.all_results"),siteSettings: [],};@@ -114,7 +114,7 @@ export default class SiteSettingFilter {matches.pushObjects(siteSettings);matchesGroupedByCategory.pushObject({nameKey: settingsCategory.nameKey,- name: I18n.t(+ name: i18n("admin.site_settings.categories." + settingsCategory.nameKey),siteSettings: this.sortSettings(siteSettings),diff --git a/app/assets/javascripts/discourse/app/lib/text.js b/app/assets/javascripts/discourse/app/lib/text.jsindex 544a71953e7..56cfc70b897 100644--- a/app/assets/javascripts/discourse/app/lib/text.js+++ b/app/assets/javascripts/discourse/app/lib/text.js@@ -4,7 +4,7 @@ import { sanitize as textSanitize } from "pretty-text/sanitizer";import deprecated from "discourse-common/lib/deprecated";import { getURLWithCDN } from "discourse-common/lib/get-url";import { helperContext } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";async function withEngine(name, ...args) {const engine = await import("discourse/static/markdown-it");@@ -146,8 +146,8 @@ export function humanizeList(listItems) {return last;} else {return [- items.join(I18n.t("word_connector.comma")),- I18n.t("word_connector.last_item"),+ items.join(i18n("word_connector.comma")),+ i18n("word_connector.last_item"),last,].join(" ");}diff --git a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.jsindex 8ac6b48d19d..2c5f4ceb07a 100644--- a/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js+++ b/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js@@ -14,7 +14,7 @@ import {} from "discourse/lib/utilities";import { isTesting } from "discourse-common/config/environment";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const INDENT_DIRECTION_LEFT = "left";const INDENT_DIRECTION_RIGHT = "right";@@ -191,7 +191,7 @@ export default class TextareaTextManipulation {}const [hval, hlen] = getHead(head);- const example = I18n.t(`composer.${exampleKey}`);+ const example = i18n(`composer.${exampleKey}`);this._insertAt(sel.start, sel.end, `${hval}${example}${tail}`);this.selectText(pre.length + hlen, example.length);} else if (opts && !opts.multiline) {diff --git a/app/assets/javascripts/discourse/app/lib/theme-selector.js b/app/assets/javascripts/discourse/app/lib/theme-selector.jsindex b4a995bd1b2..60b52c73b65 100644--- a/app/assets/javascripts/discourse/app/lib/theme-selector.js+++ b/app/assets/javascripts/discourse/app/lib/theme-selector.js@@ -1,6 +1,6 @@import cookie, { removeCookie } from "discourse/lib/cookie";import deprecated from "discourse-common/lib/deprecated";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const keySelector = "meta[name=discourse_theme_id]";const COOKIE_NAME = "theme_ids";@@ -68,7 +68,7 @@ export function listThemes(site) {let results = [];if (!hasDefault) {- results.push({ name: I18n.t("themes.default_description"), id: null });+ results.push({ name: i18n("themes.default_description"), id: null });}themes.forEach((t) => {diff --git a/app/assets/javascripts/discourse/app/lib/time-shortcut.js b/app/assets/javascripts/discourse/app/lib/time-shortcut.jsindex e9830f709fb..e175eddd082 100644--- a/app/assets/javascripts/discourse/app/lib/time-shortcut.js+++ b/app/assets/javascripts/discourse/app/lib/time-shortcut.js@@ -24,7 +24,7 @@ import {twoMonths,twoWeeks,} from "discourse/lib/time-utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const TIME_SHORTCUT_TYPES = {ONE_HOUR: "one_hour",@@ -308,5 +308,5 @@ export function formatTime(shortcut) {return null;}- return shortcut.time.format(I18n.t(shortcut.timeFormatKey));+ return shortcut.time.format(i18n(shortcut.timeFormatKey));}diff --git a/app/assets/javascripts/discourse/app/lib/transform-post.js b/app/assets/javascripts/discourse/app/lib/transform-post.jsindex ce0fd1eb24d..1347f2b6d7c 100644--- a/app/assets/javascripts/discourse/app/lib/transform-post.js+++ b/app/assets/javascripts/discourse/app/lib/transform-post.js@@ -1,7 +1,7 @@import { isEmpty } from "@ember/utils";import { userPath } from "discourse/lib/url";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const _additionalAttributes = [];@@ -201,8 +201,8 @@ export default function transformPost(postId: post.id,action,canUndo: a.can_undo,- description: I18n.t(`post.actions.by_you.${action}`, {- defaultValue: I18n.t(`post.actions.by_you.custom`, {+ description: i18n(`post.actions.by_you.${action}`, {+ defaultValue: i18n(`post.actions.by_you.custom`, {custom: a.actionType.name,}),}),diff --git a/app/assets/javascripts/discourse/app/lib/uploads.js b/app/assets/javascripts/discourse/app/lib/uploads.jsindex fd0208e9102..39f08007067 100644--- a/app/assets/javascripts/discourse/app/lib/uploads.js+++ b/app/assets/javascripts/discourse/app/lib/uploads.js@@ -2,7 +2,7 @@ import { humanizeList } from "discourse/lib/text";import { isAppleDevice } from "discourse/lib/utilities";import deprecated from "discourse-common/lib/deprecated";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";function isGUID(value) {return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(@@ -36,7 +36,7 @@ export function markdownNameFromFileName(fileName) {let name = fileName.slice(0, fileName.lastIndexOf("."));if (isAppleDevice() && isGUID(name)) {- name = I18n.t("upload_selector.default_image_alt_text");+ name = i18n("upload_selector.default_image_alt_text");}return name.replace(/\[|\]|\|/g, "");@@ -48,7 +48,7 @@ export function validateUploadedFiles(files, opts) {}if (files.length > 1) {- dialog.alert(I18n.t("post.errors.too_many_uploads"));+ dialog.alert(i18n("post.errors.too_many_uploads"));return false;}@@ -79,7 +79,7 @@ export function validateUploadedFile(file, opts) {let staff = user && user.staff;if (!authorizesOneOrMoreExtensions(staff, opts.siteSettings)) {- dialog.alert(I18n.t("post.errors.no_uploads_authorized"));+ dialog.alert(i18n("post.errors.no_uploads_authorized"));return false;}@@ -99,7 +99,7 @@ export function validateUploadedFile(file, opts) {if (opts.imagesOnly) {if (!isImage(name) && !isAuthorizedImage(name, staff, opts.siteSettings)) {dialog.alert(- I18n.t("post.errors.upload_not_authorized", {+ i18n("post.errors.upload_not_authorized", {authorized_extensions: authorizedImagesExtensions(staff,opts.siteSettings@@ -110,7 +110,7 @@ export function validateUploadedFile(file, opts) {}} else if (opts.csvOnly) {if (!/\.csv$/i.test(name)) {- dialog.alert(I18n.t("user.invited.bulk_invite.error"));+ dialog.alert(i18n("user.invited.bulk_invite.error"));return false;}} else {@@ -119,7 +119,7 @@ export function validateUploadedFile(file, opts) {!isAuthorizedFile(name, staff, opts.siteSettings)) {dialog.alert(- I18n.t("post.errors.upload_not_authorized", {+ i18n("post.errors.upload_not_authorized", {authorized_extensions: authorizedExtensions(staff,opts.siteSettings@@ -134,7 +134,7 @@ export function validateUploadedFile(file, opts) {// ensures that new users can upload a fileif (user && !user.isAllowedToUploadAFile(opts.type)) {dialog.alert(- I18n.t(`post.errors.${opts.type}_upload_not_allowed_for_new_user`)+ i18n(`post.errors.${opts.type}_upload_not_allowed_for_new_user`));return false;}@@ -143,7 +143,7 @@ export function validateUploadedFile(file, opts) {if (file.size === 0) {/* eslint-disable no-console */console.warn("File with a 0 byte size detected, cancelling upload.", file);- dialog.alert(I18n.t("post.errors.file_size_zero"));+ dialog.alert(i18n("post.errors.file_size_zero"));return false;}@@ -320,7 +320,7 @@ export function getUploadMarkdown(upload) {export function displayErrorForBulkUpload(errors) {const fileNames = humanizeList(errors.mapBy("fileName"));- dialog.alert(I18n.t("post.errors.upload", { file_name: fileNames }));+ dialog.alert(i18n("post.errors.upload", { file_name: fileNames }));}export function displayErrorForUpload(data, siteSettings, fileName) {@@ -366,25 +366,25 @@ export function displayErrorForUpload(data, siteSettings, fileName) {}// otherwise, display a generic error message- dialog.alert(I18n.t("post.errors.upload", { file_name: fileName }));+ dialog.alert(i18n("post.errors.upload", { file_name: fileName }));}function displayErrorByResponseStatus(status, body, fileName, siteSettings) {switch (status) {// didn't get headers from server, or browser refuses to tell uscase 0:- dialog.alert(I18n.t("post.errors.upload", { file_name: fileName }));+ dialog.alert(i18n("post.errors.upload", { file_name: fileName }));return true;// entity too large, usually returned from the web servercase 413:const type = uploadTypeFromFileName(fileName);if (type === "backup") {- dialog.alert(I18n.t("post.errors.backup_too_large"));+ dialog.alert(i18n("post.errors.backup_too_large"));} else {const max_size_kb = siteSettings[`max_${type}_size_kb`];dialog.alert(- I18n.t("post.errors.file_too_large_humanized", {+ i18n("post.errors.file_too_large_humanized", {max_size: I18n.toHumanSize(max_size_kb * 1024),}));diff --git a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.jsindex 48777aa1220..62ef632d87a 100644--- a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js+++ b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js@@ -24,7 +24,7 @@ import { clipboardHelpers } from "discourse/lib/utilities";import getURL from "discourse-common/lib/get-url";import { bind } from "discourse-common/utils/decorators";import escapeRegExp from "discourse-common/utils/escape-regexp";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UppyComposerUpload {@service dialog;@@ -222,7 +222,7 @@ export default class UppyComposerUpload {const fileCount = Object.keys(unhandledFiles).length;if (maxFiles > 0 && fileCount > maxFiles) {this.dialog.alert(- I18n.t("post.errors.too_many_dragged_and_dropped_files", {+ i18n("post.errors.too_many_dragged_and_dropped_files", {count: maxFiles,}));@@ -506,12 +506,9 @@ export default class UppyComposerUpload {this.uppyWrapper.onPreProcessProgress((file) => {let placeholderData = this.#placeholders[file.id];- placeholderData.processingPlaceholder = `[${I18n.t(- "processing_filename",- {- filename: file.name,- }- )}]()\n`;+ placeholderData.processingPlaceholder = `[${i18n("processing_filename", {+ filename: file.name,+ })}]()\n`;this.appEvents.trigger(`${this.composerEventPrefix}:replace-text`,@@ -561,7 +558,7 @@ export default class UppyComposerUpload {// placeholder already existing in the editor ie [Uploading: test.png…]// and add order nr to the next one: [Uploading: test.png(1)…]const escapedFilename = escapeRegExp(filename);- const regexString = `\\[${I18n.t("uploading_filename", {+ const regexString = `\\[${i18n("uploading_filename", {filename: escapedFilename + "(?:\\()?([0-9])?(?:\\))?",})}\\]\\(\\)`;const globalRegex = new RegExp(regexString, "g");@@ -581,13 +578,13 @@ export default class UppyComposerUpload {}#uploadPlaceholder(file) {- const clipboard = I18n.t("clipboard");+ const clipboard = i18n("clipboard");const uploadFilenamePlaceholder = this.#uploadFilenamePlaceholder(file);const filename = uploadFilenamePlaceholder? uploadFilenamePlaceholder: clipboard;- let placeholder = `[${I18n.t("uploading_filename", { filename })}]()\n`;+ let placeholder = `[${i18n("uploading_filename", { filename })}]()\n`;if (!this.#cursorIsOnEmptyLine()) {placeholder = `\n${placeholder}`;}@@ -728,7 +725,7 @@ export default class UppyComposerUpload {const reply = this.composerModel.get("reply");const imagesToWrapGrid = new Set(this.#consecutiveImages);- const uploadingText = I18n.t("uploading_filename", {+ const uploadingText = i18n("uploading_filename", {filename: "%placeholder%",});const uploadingTextMatch = uploadingText.match(/^.*(?=: %placeholder%…)/);diff --git a/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js b/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.jsindex 1aa43c6f825..53cc1fff20c 100644--- a/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js+++ b/app/assets/javascripts/discourse/app/lib/uppy/uppy-upload.js@@ -22,7 +22,7 @@ import UppyChunkedUploader from "discourse/lib/uppy-chunked-uploader-plugin";import getUrl from "discourse-common/lib/get-url";import { deepMerge } from "discourse-common/lib/object";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const HUGE_FILE_THRESHOLD_BYTES = 104_857_600; // 100MB@@ -186,7 +186,7 @@ export default class UppyUpload {if (tooMany) {this.dialog.alert(- I18n.t("post.errors.too_many_dragged_and_dropped_files", {+ i18n("post.errors.too_many_dragged_and_dropped_files", {count: this.allowMultipleFiles ? maxFiles : 1,}));diff --git a/app/assets/javascripts/discourse/app/lib/user-menu/message-item.js b/app/assets/javascripts/discourse/app/lib/user-menu/message-item.jsindex 09a7b8ce881..1ce55fca75f 100644--- a/app/assets/javascripts/discourse/app/lib/user-menu/message-item.js+++ b/app/assets/javascripts/discourse/app/lib/user-menu/message-item.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import { emojiUnescape } from "discourse/lib/text";import UserMenuBaseItem from "discourse/lib/user-menu/base-item";import { postUrl } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserMenuMessageItem extends UserMenuBaseItem {constructor({ message }) {@@ -23,7 +23,7 @@ export default class UserMenuMessageItem extends UserMenuBaseItem {}get linkTitle() {- return I18n.t("user.private_message");+ return i18n("user.private_message");}get icon() {diff --git a/app/assets/javascripts/discourse/app/lib/user-menu/tab.js b/app/assets/javascripts/discourse/app/lib/user-menu/tab.jsindex af8517fabf1..dfaa287b03c 100644--- a/app/assets/javascripts/discourse/app/lib/user-menu/tab.js+++ b/app/assets/javascripts/discourse/app/lib/user-menu/tab.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";/*** abstract class representing a tab in the user menu@@ -37,7 +37,7 @@ export default class UserMenuTab {key = `user_menu.tabs.${id}`;}- return I18n.t(key, { count });+ return i18n(key, { count });}/**diff --git a/app/assets/javascripts/discourse/app/lib/utilities.js b/app/assets/javascripts/discourse/app/lib/utilities.jsindex 62a3abc58d7..6a6d7129247 100644--- a/app/assets/javascripts/discourse/app/lib/utilities.js+++ b/app/assets/javascripts/discourse/app/lib/utilities.js@@ -7,7 +7,7 @@ import * as AvatarUtils from "discourse-common/lib/avatar-utils";import deprecated from "discourse-common/lib/deprecated";import escape from "discourse-common/lib/escape";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _defaultHomepage;@@ -494,10 +494,10 @@ export function translateModKey(string) {} else {string = string.toLowerCase()- .replace("shift", I18n.t("shortcut_modifier_key.shift"))- .replace("ctrl", I18n.t("shortcut_modifier_key.ctrl"))- .replace("meta", I18n.t("shortcut_modifier_key.ctrl"))- .replace("alt", I18n.t("shortcut_modifier_key.alt"));+ .replace("shift", i18n("shortcut_modifier_key.shift"))+ .replace("ctrl", i18n("shortcut_modifier_key.ctrl"))+ .replace("meta", i18n("shortcut_modifier_key.ctrl"))+ .replace("alt", i18n("shortcut_modifier_key.alt"));}return string;diff --git a/app/assets/javascripts/discourse/app/lib/webauthn.js b/app/assets/javascripts/discourse/app/lib/webauthn.jsindex 06073fc38f0..08c61c7d130 100644--- a/app/assets/javascripts/discourse/app/lib/webauthn.js+++ b/app/assets/javascripts/discourse/app/lib/webauthn.js@@ -1,5 +1,5 @@import { ajax } from "discourse/lib/ajax";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function stringToBuffer(str) {let buffer = new ArrayBuffer(str.length);@@ -46,7 +46,7 @@ export function getWebauthnCredential(errorCallback) {if (!isWebauthnSupported()) {- return errorCallback(I18n.t("login.security_key_support_missing_error"));+ return errorCallback(i18n("login.security_key_support_missing_error"));}let challengeBuffer = stringToBuffer(challenge);@@ -76,9 +76,7 @@ export function getWebauthnCredential(.then((credential) => {// 3. If credential.response is not an instance of AuthenticatorAssertionResponse, abort the ceremony.if (!(credential.response instanceof AuthenticatorAssertionResponse)) {- return errorCallback(- I18n.t("login.security_key_invalid_response_error")- );+ return errorCallback(i18n("login.security_key_invalid_response_error"));}// 4. Let clientExtensionResults be the result of calling credential.getClientExtensionResults().@@ -92,7 +90,7 @@ export function getWebauthnCredential()) {return errorCallback(- I18n.t("login.security_key_no_matching_credential_error")+ i18n("login.security_key_no_matching_credential_error"));}@@ -110,7 +108,7 @@ export function getWebauthnCredential(}).catch((err) => {if (err.name === "NotAllowedError") {- return errorCallback(I18n.t("login.security_key_not_allowed_error"));+ return errorCallback(i18n("login.security_key_not_allowed_error"));}errorCallback(err);});@@ -122,7 +120,7 @@ export async function getPasskeyCredential(isFirefox = false) {if (!isWebauthnSupported()) {- return errorCallback(I18n.t("login.security_key_support_missing_error"));+ return errorCallback(i18n("login.security_key_support_missing_error"));}// we need to check isConditionalMediationAvailable for Firefox@@ -177,10 +175,10 @@ export async function getPasskeyCredential(}if (error.name === "NotAllowedError") {- return errorCallback(I18n.t("login.security_key_not_allowed_error"));+ return errorCallback(i18n("login.security_key_not_allowed_error"));} else if (error.name === "SecurityError") {return errorCallback(- I18n.t("login.passkey_security_error", {+ i18n("login.passkey_security_error", {message: error.message,}));diff --git a/app/assets/javascripts/discourse/app/mixins/name-validation.js b/app/assets/javascripts/discourse/app/mixins/name-validation.jsindex 99586ce10e3..37022993b6f 100644--- a/app/assets/javascripts/discourse/app/mixins/name-validation.js+++ b/app/assets/javascripts/discourse/app/mixins/name-validation.js@@ -1,11 +1,11 @@import EmberObject, { computed } from "@ember/object";import Mixin from "@ember/object/mixin";import { isEmpty } from "@ember/utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default Mixin.create({get nameTitle() {- return I18n.t(+ return i18n(this.siteSettings.full_name_required? "user.name.title": "user.name.title_optional"@@ -19,8 +19,8 @@ export default Mixin.create({return EmberObject.create({failed: true,ok: false,- message: I18n.t("user.name.required"),- reason: forceValidationReason ? I18n.t("user.name.required") : null,+ message: i18n("user.name.required"),+ reason: forceValidationReason ? i18n("user.name.required") : null,element: document.querySelector("#new-account-name"),});}diff --git a/app/assets/javascripts/discourse/app/mixins/password-validation.js b/app/assets/javascripts/discourse/app/mixins/password-validation.jsindex dd9b2145e77..ffe80c14b1b 100644--- a/app/assets/javascripts/discourse/app/mixins/password-validation.js+++ b/app/assets/javascripts/discourse/app/mixins/password-validation.js@@ -1,7 +1,7 @@import EmberObject, { computed } from "@ember/object";import Mixin from "@ember/object/mixin";import { isEmpty } from "@ember/utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default Mixin.create({rejectedPasswords: null,@@ -13,7 +13,7 @@ export default Mixin.create({},passwordInstructions: computed("passwordMinLength", function () {- return I18n.t("user.password.instructions", {+ return i18n("user.password.instructions", {count: this.passwordMinLength,});}),@@ -49,7 +49,7 @@ export default Mixin.create({Object.assign(failedAttrs, {reason:this.rejectedPasswordsMessages.get(this.accountPassword) ||- I18n.t("user.password.common"),+ i18n("user.password.common"),}));}@@ -58,9 +58,9 @@ export default Mixin.create({if (isEmpty(this.accountPassword)) {return EmberObject.create(Object.assign(failedAttrs, {- message: I18n.t("user.password.required"),+ message: i18n("user.password.required"),reason: this.forceValidationReason- ? I18n.t("user.password.required")+ ? i18n("user.password.required"): null,}));@@ -70,7 +70,7 @@ export default Mixin.create({if (this.accountPassword.length < this.passwordMinLength) {return EmberObject.create(Object.assign(failedAttrs, {- reason: I18n.t("user.password.too_short", {+ reason: i18n("user.password.too_short", {count: this.passwordMinLength,}),})@@ -83,7 +83,7 @@ export default Mixin.create({) {return EmberObject.create(Object.assign(failedAttrs, {- reason: I18n.t("user.password.same_as_username"),+ reason: i18n("user.password.same_as_username"),}));}@@ -94,7 +94,7 @@ export default Mixin.create({) {return EmberObject.create(Object.assign(failedAttrs, {- reason: I18n.t("user.password.same_as_email"),+ reason: i18n("user.password.same_as_email"),}));}@@ -102,7 +102,7 @@ export default Mixin.create({// Looks good!return EmberObject.create({ok: true,- reason: I18n.t("user.password.ok"),+ reason: i18n("user.password.ok"),});}),diff --git a/app/assets/javascripts/discourse/app/mixins/user-fields-validation.js b/app/assets/javascripts/discourse/app/mixins/user-fields-validation.jsindex 40abe71bae7..83a0d3278a2 100644--- a/app/assets/javascripts/discourse/app/mixins/user-fields-validation.js+++ b/app/assets/javascripts/discourse/app/mixins/user-fields-validation.js@@ -2,7 +2,7 @@ import EmberObject, { computed } from "@ember/object";import { on } from "@ember/object/evented";import Mixin from "@ember/object/mixin";import { isEmpty } from "@ember/utils";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const addCustomUserFieldValidationCallbacks = [];export function addCustomUserFieldValidationCallback(callback) {@@ -38,7 +38,7 @@ export default Mixin.create({) {validation = EmberObject.create({failed: true,- reason: I18n.t("user_fields.required", {+ reason: i18n("user_fields.required", {name: userField.field.name,}),element: userField.field.element,@@ -53,7 +53,7 @@ export default Mixin.create({) {validation = EmberObject.create({failed: true,- reason: I18n.t("user_fields.same_as_password"),+ reason: i18n("user_fields.same_as_password"),element: userField.field.element,});}diff --git a/app/assets/javascripts/discourse/app/mixins/username-validation.js b/app/assets/javascripts/discourse/app/mixins/username-validation.jsindex 2480094dd6a..f5d3f68f5d0 100644--- a/app/assets/javascripts/discourse/app/mixins/username-validation.js+++ b/app/assets/javascripts/discourse/app/mixins/username-validation.js@@ -4,7 +4,7 @@ import { isEmpty } from "@ember/utils";import { setting } from "discourse/lib/computed";import User from "discourse/models/user";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function failedResult(attrs) {return EmberObject.create({@@ -66,29 +66,29 @@ export default Mixin.create({basicUsernameValidation(username) {if (username && username === this.prefilledUsername) {- return validResult({ reason: I18n.t("user.username.prefilled") });+ return validResult({ reason: i18n("user.username.prefilled") });}if (isEmpty(username)) {return failedResult({- message: I18n.t("user.username.required"),+ message: i18n("user.username.required"),reason: this.forceValidationReason- ? I18n.t("user.username.required")+ ? i18n("user.username.required"): null,});}if (username.length < this.siteSettings.min_username_length) {- return failedResult({ reason: I18n.t("user.username.too_short") });+ return failedResult({ reason: i18n("user.username.too_short") });}if (username.length > this.maxUsernameLength) {- return failedResult({ reason: I18n.t("user.username.too_long") });+ return failedResult({ reason: i18n("user.username.too_long") });}return failedResult({shouldCheck: true,- reason: I18n.t("user.username.checking"),+ reason: i18n("user.username.checking"),});},@@ -108,13 +108,13 @@ export default Mixin.create({if (result.available) {this.set("usernameValidationResult",- validResult({ reason: I18n.t("user.username.available") })+ validResult({ reason: i18n("user.username.available") }));} else if (result.suggestion) {this.set("usernameValidationResult",failedResult({- reason: I18n.t("user.username.not_available", result),+ reason: i18n("user.username.not_available", result),}));} else {@@ -123,7 +123,7 @@ export default Mixin.create({failedResult({reason: result.errors? result.errors.join(" ")- : I18n.t("user.username.not_available_no_suggestion"),+ : i18n("user.username.not_available_no_suggestion"),}));}diff --git a/app/assets/javascripts/discourse/app/models/badge-grouping.js b/app/assets/javascripts/discourse/app/models/badge-grouping.jsindex e60b79f5ea7..d517fa42264 100644--- a/app/assets/javascripts/discourse/app/models/badge-grouping.js+++ b/app/assets/javascripts/discourse/app/models/badge-grouping.js@@ -1,6 +1,6 @@import RestModel from "discourse/models/rest";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BadgeGrouping extends RestModel {@discourseComputed("name")@@ -11,6 +11,6 @@ export default class BadgeGrouping extends RestModel {@discourseComputed("name")displayName() {const i18nKey = `badges.badge_grouping.${this.i18nNameKey}.name`;- return I18n.t(i18nKey, { defaultValue: this.name });+ return i18n(i18nKey, { defaultValue: this.name });}}diff --git a/app/assets/javascripts/discourse/app/models/bookmark.js b/app/assets/javascripts/discourse/app/models/bookmark.jsindex 22e5c963476..e5c8f7dad70 100644--- a/app/assets/javascripts/discourse/app/models/bookmark.js+++ b/app/assets/javascripts/discourse/app/models/bookmark.js@@ -12,7 +12,7 @@ import Topic from "discourse/models/topic";import User from "discourse/models/user";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Category from "./category";export const AUTO_DELETE_PREFERENCES = {@@ -128,17 +128,17 @@ export default class Bookmark extends RestModel {const createdAtStr = moment(createdAt).format(BUMPED_FORMAT);return bumpedAtStr !== createdAtStr- ? `${I18n.t("topic.created_at", {+ ? `${i18n("topic.created_at", {date: longDate(createdAt),- })}\n${I18n.t("topic.bumped_at", { date: longDate(bumpedAt) })}`- : I18n.t("topic.created_at", { date: longDate(createdAt) });+ })}\n${i18n("topic.bumped_at", { date: longDate(bumpedAt) })}`+ : i18n("topic.created_at", { date: longDate(createdAt) });}}@discourseComputed("name", "reminder_at")reminderTitle(name, reminderAt) {if (!isEmpty(reminderAt)) {- return I18n.t("bookmarks.created_with_reminder_generic", {+ return i18n("bookmarks.created_with_reminder_generic", {date: formattedReminderTime(reminderAt,this.currentUser?.user_option?.timezone || moment.tz.guess()@@ -147,7 +147,7 @@ export default class Bookmark extends RestModel {});}- return I18n.t("bookmarks.created_generic", {+ return i18n("bookmarks.created_generic", {name: name || "",});}diff --git a/app/assets/javascripts/discourse/app/models/category-list.js b/app/assets/javascripts/discourse/app/models/category-list.jsindex 4ad96d56b5c..62132ff7338 100644--- a/app/assets/javascripts/discourse/app/models/category-list.js+++ b/app/assets/javascripts/discourse/app/models/category-list.js@@ -6,7 +6,7 @@ import Site from "discourse/models/site";import Topic from "discourse/models/topic";import deprecated from "discourse-common/lib/deprecated";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class CategoryList extends ArrayProxy {static categoriesFrom(store, result, parentCategory = null) {@@ -46,29 +46,29 @@ export default class CategoryList extends ArrayProxy {const stat = c[`topics_${statPeriod}`];if ((statPeriod === "week" || statPeriod === "month") && stat > 0) {- const unit = I18n.t(`categories.topic_stat_unit.${statPeriod}`);+ const unit = i18n(`categories.topic_stat_unit.${statPeriod}`);- c.stat = I18n.t("categories.topic_stat", {+ c.stat = i18n("categories.topic_stat", {count: stat, // only used to correctly pluralize the stringnumber: `<span class="value">${number(stat)}</span>`,unit: `<span class="unit">${unit}</span>`,});- c.statTitle = I18n.t(`categories.topic_stat_sentence_${statPeriod}`, {+ c.statTitle = i18n(`categories.topic_stat_sentence_${statPeriod}`, {count: stat,});c.pickAll = false;} else {c.stat = `<span class="value">${number(c.topics_all_time)}</span>`;- c.statTitle = I18n.t("categories.topic_sentence", {+ c.statTitle = i18n("categories.topic_sentence", {count: c.topics_all_time,});c.pickAll = true;}if (Site.current().mobileView) {- c.statTotal = I18n.t("categories.topic_stat_all_time", {+ c.statTotal = i18n("categories.topic_stat_all_time", {count: c.topics_all_time,number: `<span class="value">${number(c.topics_all_time)}</span>`,});diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.jsindex 2267070ac42..d7b9c128e5a 100644--- a/app/assets/javascripts/discourse/app/models/composer.js+++ b/app/assets/javascripts/discourse/app/models/composer.js@@ -21,7 +21,7 @@ import User from "discourse/models/user";import { tinyAvatar } from "discourse-common/lib/avatar-utils";import deprecated from "discourse-common/lib/deprecated";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _customizations = [];export function registerCustomizationCallback(cb) {@@ -423,7 +423,7 @@ export default class Composer extends RestModel {}if (post) {- options.label = I18n.t(`post.${action}`);+ options.label = i18n(`post.${action}`);options.userAvatar = tinyAvatar(post.avatar_template);if (this.site.desktopView) {@@ -443,7 +443,7 @@ export default class Composer extends RestModel {options.postLink = {href: `${topic.url}/${postNumber}`,- anchor: I18n.t("post.post_number", { number: postNumber }),+ anchor: i18n("post.post_number", { number: postNumber }),};const name = prioritizeNameFallback(post.name, post.username);@@ -535,9 +535,7 @@ export default class Composer extends RestModel {const category = this.category;if (category && category.topic_template) {if (this.reply.trim() === category.topic_template.trim()) {- this.dialog.alert(- I18n.t("composer.error.topic_template_not_modified")- );+ this.dialog.alert(i18n("composer.error.topic_template_not_modified"));return true;}}@@ -1321,7 +1319,7 @@ export default class Composer extends RestModel {}if (result.conflict_user) {this.setProperties({- draftStatus: I18n.t("composer.edit_conflict"),+ draftStatus: i18n("composer.edit_conflict"),draftConflictUser: result.conflict_user,});} else {@@ -1355,12 +1353,12 @@ export default class Composer extends RestModel {message: json.extras.description,buttons: [{- label: I18n.t("composer.reload"),+ label: i18n("composer.reload"),class: "btn-primary",action: () => window.location.reload(),},{- label: I18n.t("composer.ignore"),+ label: i18n("composer.ignore"),class: "btn",action: () => this.set("draftForceSave", true),},@@ -1369,7 +1367,7 @@ export default class Composer extends RestModel {}}this.setProperties({- draftStatus: draftStatus || I18n.t("composer.drafts_offline"),+ draftStatus: draftStatus || i18n("composer.drafts_offline"),draftConflictUser: null,});})diff --git a/app/assets/javascripts/discourse/app/models/group-history.js b/app/assets/javascripts/discourse/app/models/group-history.jsindex c72c7cd6b24..5b8615bdb37 100644--- a/app/assets/javascripts/discourse/app/models/group-history.js+++ b/app/assets/javascripts/discourse/app/models/group-history.js@@ -1,10 +1,10 @@import RestModel from "discourse/models/rest";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupHistory extends RestModel {@discourseComputed("action")actionTitle(action) {- return I18n.t(`group_histories.actions.${action}`);+ return i18n(`group_histories.actions.${action}`);}}diff --git a/app/assets/javascripts/discourse/app/models/login-method.js b/app/assets/javascripts/discourse/app/models/login-method.jsindex 5da0cb4bc0d..30ffe43b573 100644--- a/app/assets/javascripts/discourse/app/models/login-method.js+++ b/app/assets/javascripts/discourse/app/models/login-method.js@@ -5,7 +5,7 @@ import Session from "discourse/models/session";import Site from "discourse/models/site";import getURL from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class LoginMethod extends EmberObject {static buildPostForm(url) {@@ -30,20 +30,20 @@ export default class LoginMethod extends EmberObject {@discourseComputedtitle() {- return this.title_override || I18n.t(`login.${this.name}.title`);+ return this.title_override || i18n(`login.${this.name}.title`);}@discourseComputedscreenReaderTitle() {return (this.title_override ||- I18n.t(`login.${this.name}.sr_title`, { defaultValue: this.title })+ i18n(`login.${this.name}.sr_title`, { defaultValue: this.title }));}@discourseComputedprettyName() {- return this.pretty_name_override || I18n.t(`login.${this.name}.name`);+ return this.pretty_name_override || i18n(`login.${this.name}.name`);}doLogin({ reconnect = false, signup = false, params = {} } = {}) {diff --git a/app/assets/javascripts/discourse/app/models/nav-item.js b/app/assets/javascripts/discourse/app/models/nav-item.jsindex 665866b478f..25f64e39a27 100644--- a/app/assets/javascripts/discourse/app/models/nav-item.js+++ b/app/assets/javascripts/discourse/app/models/nav-item.js@@ -16,7 +16,7 @@ import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL from "discourse-common/lib/get-url";import { deepMerge } from "discourse-common/lib/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NavItem extends EmberObject {static extraArgsCallbacks = [];@@ -231,7 +231,7 @@ export default class NavItem extends EmberObject {return this._title;}- return I18n.t("filters." + this.name.replace("/", ".") + ".help", {});+ return i18n("filters." + this.name.replace("/", ".") + ".help", {});}set title(value) {@@ -257,7 +257,7 @@ export default class NavItem extends EmberObject {const titleKey = count === 0 ? ".title" : ".title_with_count";return emojiUnescape(- I18n.t(`filters.${this.name.replace("/", ".") + titleKey}`, extra)+ i18n(`filters.${this.name.replace("/", ".") + titleKey}`, extra));}diff --git a/app/assets/javascripts/discourse/app/models/permission-type.js b/app/assets/javascripts/discourse/app/models/permission-type.jsindex e0fec7e90c2..bae93c05450 100644--- a/app/assets/javascripts/discourse/app/models/permission-type.js+++ b/app/assets/javascripts/discourse/app/models/permission-type.js@@ -1,9 +1,9 @@import EmberObject from "@ember/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function buildPermissionDescription(id) {- return I18n.t("permission_types." + PermissionType.DESCRIPTION_KEYS[id]);+ return i18n("permission_types." + PermissionType.DESCRIPTION_KEYS[id]);}export default class PermissionType extends EmberObject {diff --git a/app/assets/javascripts/discourse/app/models/post-stream.js b/app/assets/javascripts/discourse/app/models/post-stream.jsindex a30e1f51afc..0c16712e5f8 100644--- a/app/assets/javascripts/discourse/app/models/post-stream.js+++ b/app/assets/javascripts/discourse/app/models/post-stream.js@@ -13,7 +13,7 @@ import { loadTopicView } from "discourse/models/topic";import deprecated from "discourse-common/lib/deprecated";import { deepMerge } from "discourse-common/lib/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _lastEditNotificationClick = null;export function setLastEditNotificationClick(@@ -1255,7 +1255,7 @@ export default class PostStream extends RestModel {topic.set("errorTitle", json.extras.title);topic.set("errorHtml", json.extras.html);} else {- topic.set("errorMessage", I18n.t("topic.server_error.description"));+ topic.set("errorMessage", i18n("topic.server_error.description"));topic.set("noRetry", error.jqXHR.status === 403);}}diff --git a/app/assets/javascripts/discourse/app/models/post.js b/app/assets/javascripts/discourse/app/models/post.jsindex 3b1fdba5874..e1d83242c75 100644--- a/app/assets/javascripts/discourse/app/models/post.js+++ b/app/assets/javascripts/discourse/app/models/post.js@@ -18,7 +18,7 @@ import RestModel from "discourse/models/rest";import Site from "discourse/models/site";import User from "discourse/models/user";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Post extends RestModel {static munge(json) {@@ -421,7 +421,7 @@ export default class Post extends RestModel {this.post_number === 1? "topic.deleted_by_author_simple": "post.deleted_by_author_simple";- promise = cook(I18n.t(key)).then((cooked) => {+ promise = cook(i18n(key)).then((cooked) => {this.setProperties({cooked,can_delete: false,diff --git a/app/assets/javascripts/discourse/app/models/reviewable.js b/app/assets/javascripts/discourse/app/models/reviewable.jsindex 4c348d5d280..163a2f8d82c 100644--- a/app/assets/javascripts/discourse/app/models/reviewable.js+++ b/app/assets/javascripts/discourse/app/models/reviewable.js@@ -3,7 +3,7 @@ import { Promise } from "rsvp";import { ajax } from "discourse/lib/ajax";import RestModel from "discourse/models/rest";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import Category from "./category";export const PENDING = 0;@@ -31,7 +31,7 @@ export default class Reviewable extends RestModel {@discourseComputed("resolvedType")humanType(resolvedType) {- return I18n.t(`review.types.${underscore(resolvedType)}.title`, {+ return i18n(`review.types.${underscore(resolvedType)}.title`, {defaultValue: "",});}@@ -43,7 +43,7 @@ export default class Reviewable extends RestModel {@discourseComputed("resolvedType")humanNoun(resolvedType) {- return I18n.t(`review.types.${underscore(resolvedType)}.noun`, {+ return i18n(`review.types.${underscore(resolvedType)}.noun`, {defaultValue: "reviewable",});}@@ -55,7 +55,7 @@ export default class Reviewable extends RestModel {if (uniqueReviewableScores.length === 1) {if (uniqueReviewableScores[0].score_type.type === "notify_moderators") {- return I18n.t("review.context_question.something_else_wrong", {+ return i18n("review.context_question.something_else_wrong", {reviewable_type: humanNoun,});}@@ -65,10 +65,10 @@ export default class Reviewable extends RestModel {uniqueReviewableScores.map((score) => score.score_type.title.toLowerCase()).uniq(),- I18n.t("review.context_question.delimiter")+ i18n("review.context_question.delimiter"));- return I18n.t("review.context_question.is_this_post", {+ return i18n("review.context_question.is_this_post", {reviewable_human_score_types: listOfQuestions,reviewable_type: humanNoun,});diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.jsindex ef72df30faa..b44c6075620 100644--- a/app/assets/javascripts/discourse/app/models/topic.js+++ b/app/assets/javascripts/discourse/app/models/topic.js@@ -24,7 +24,7 @@ import deprecated from "discourse-common/lib/deprecated";import getURL from "discourse-common/lib/get-url";import { deepMerge } from "discourse-common/lib/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Category from "./category";export function loadTopicView(topic, args) {@@ -394,10 +394,10 @@ export default class Topic extends RestModel {const createdAtStr = moment(createdAt).format(BUMPED_FORMAT);return bumpedAtStr !== createdAtStr- ? `${I18n.t("topic.created_at", {+ ? `${i18n("topic.created_at", {date: longDate(createdAt),- })}\n${I18n.t("topic.bumped_at", { date: longDate(bumpedAt) })}`- : I18n.t("topic.created_at", { date: longDate(createdAt) });+ })}\n${i18n("topic.bumped_at", { date: longDate(bumpedAt) })}`+ : i18n("topic.created_at", { date: longDate(createdAt) });}}@@ -478,7 +478,7 @@ export default class Topic extends RestModel {const reasonKey = Object.keys(TOPIC_VISIBILITY_REASONS).find((key) => TOPIC_VISIBILITY_REASONS[key] === this.visibility_reason_id);- return I18n.t(`topic_statuses.visibility_reasons.${reasonKey}`);+ return i18n(`topic_statuses.visibility_reasons.${reasonKey}`);}return "";diff --git a/app/assets/javascripts/discourse/app/models/trust-level.js b/app/assets/javascripts/discourse/app/models/trust-level.jsindex 7f67cdf70cf..49a9ed9cc40 100644--- a/app/assets/javascripts/discourse/app/models/trust-level.js+++ b/app/assets/javascripts/discourse/app/models/trust-level.js@@ -1,5 +1,5 @@import { computed } from "@ember/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TrustLevel {constructor(id, key) {@@ -9,12 +9,12 @@ export default class TrustLevel {@computedget name() {- return I18n.t(`trust_levels.names.${this._key}`);+ return i18n(`trust_levels.names.${this._key}`);}@computedget detailedName() {- return I18n.t("trust_levels.detailed_name", {+ return i18n("trust_levels.detailed_name", {level: this.id,name: this.name,});diff --git a/app/assets/javascripts/discourse/app/models/user-draft.js b/app/assets/javascripts/discourse/app/models/user-draft.jsindex 27e0853e2f8..dd52878be5c 100644--- a/app/assets/javascripts/discourse/app/models/user-draft.js+++ b/app/assets/javascripts/discourse/app/models/user-draft.js@@ -7,7 +7,7 @@ import {} from "discourse/models/composer";import RestModel from "discourse/models/rest";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserDraft extends RestModel {@service currentUser;@@ -35,9 +35,9 @@ export default class UserDraft extends RestModel {draftType(draftKey) {switch (draftKey) {case NEW_TOPIC_KEY:- return I18n.t("drafts.new_topic");+ return i18n("drafts.new_topic");case NEW_PRIVATE_MESSAGE_KEY:- return I18n.t("drafts.new_private_message");+ return i18n("drafts.new_private_message");default:return false;}diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.jsindex 77078a37730..778488326d5 100644--- a/app/assets/javascripts/discourse/app/models/user.js+++ b/app/assets/javascripts/discourse/app/models/user.js@@ -39,7 +39,7 @@ import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL, { getURLWithCDN } from "discourse-common/lib/get-url";import discourseLater from "discourse-common/lib/later";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const SECOND_FACTOR_METHODS = {TOTP: 1,@@ -990,7 +990,7 @@ export default class User extends RestModel.extend(Evented) {data: { context: window.location.pathname },});} else {- return Promise.reject(I18n.t("user.delete_yourself_not_allowed"));+ return Promise.reject(i18n("user.delete_yourself_not_allowed"));}}diff --git a/app/assets/javascripts/discourse/app/raw-views/list/new-list-header-controls.js b/app/assets/javascripts/discourse/app/raw-views/list/new-list-header-controls.jsindex 71f0cafa651..fae719ca212 100644--- a/app/assets/javascripts/discourse/app/raw-views/list/new-list-header-controls.js+++ b/app/assets/javascripts/discourse/app/raw-views/list/new-list-header-controls.js@@ -1,6 +1,6 @@import EmberObject from "@ember/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NewListHeaderControls extends EmberObject {@discourseComputed@@ -21,22 +21,22 @@ export default class NewListHeaderControls extends EmberObject {@discourseComputedrepliesButtonLabel() {if (this.newRepliesCount > 0) {- return I18n.t("filters.new.replies_with_count", {+ return i18n("filters.new.replies_with_count", {count: this.newRepliesCount,});} else {- return I18n.t("filters.new.replies");+ return i18n("filters.new.replies");}}@discourseComputedtopicsButtonLabel() {if (this.newTopicsCount > 0) {- return I18n.t("filters.new.topics_with_count", {+ return i18n("filters.new.topics_with_count", {count: this.newTopicsCount,});} else {- return I18n.t("filters.new.topics");+ return i18n("filters.new.topics");}}diff --git a/app/assets/javascripts/discourse/app/raw-views/list/post-count-or-badges.js b/app/assets/javascripts/discourse/app/raw-views/list/post-count-or-badges.jsindex 24670fd09ee..77113c2e3ff 100644--- a/app/assets/javascripts/discourse/app/raw-views/list/post-count-or-badges.js+++ b/app/assets/javascripts/discourse/app/raw-views/list/post-count-or-badges.js@@ -1,7 +1,7 @@import EmberObject from "@ember/object";import { and } from "@ember/object/computed";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PostCountOrBadges extends EmberObject {@and("postBadgesEnabled", "topic.unread_posts") showBadges;@@ -10,6 +10,6 @@ export default class PostCountOrBadges extends EmberObject {newDotText() {return this.currentUser && this.currentUser.trust_level > 0? ""- : I18n.t("filters.new.lower_title");+ : i18n("filters.new.lower_title");}}diff --git a/app/assets/javascripts/discourse/app/raw-views/topic-bulk-select-dropdown.gjs b/app/assets/javascripts/discourse/app/raw-views/topic-bulk-select-dropdown.gjsindex 52e3ddc1f20..0ac85b60db3 100644--- a/app/assets/javascripts/discourse/app/raw-views/topic-bulk-select-dropdown.gjs+++ b/app/assets/javascripts/discourse/app/raw-views/topic-bulk-select-dropdown.gjs@@ -2,7 +2,7 @@ import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";import BulkSelectTopicsDropdown from "discourse/components/bulk-select-topics-dropdown";import rawRenderGlimmer from "discourse/lib/raw-render-glimmer";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class extends EmberObject {@service router;diff --git a/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js b/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.jsindex cad09289c00..d990d94c4a3 100644--- a/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js+++ b/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js@@ -1,7 +1,7 @@import EmberObject from "@ember/object";import { and } from "@ember/object/computed";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TopicListHeaderColumn extends EmberObject {sortable = null;@@ -14,7 +14,7 @@ export default class TopicListHeaderColumn extends EmberObject {return this.forceName;}- return this.name ? I18n.t(this.name) : "";+ return this.name ? i18n(this.name) : "";}@discourseComputeddiff --git a/app/assets/javascripts/discourse/app/raw-views/topic-status.js b/app/assets/javascripts/discourse/app/raw-views/topic-status.jsindex e77367d7ceb..8e8c6c400e2 100644--- a/app/assets/javascripts/discourse/app/raw-views/topic-status.js+++ b/app/assets/javascripts/discourse/app/raw-views/topic-status.js@@ -1,6 +1,6 @@import EmberObject from "@ember/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TopicStatus extends EmberObject {showDefault = null;@@ -73,7 +73,7 @@ export default class TopicStatus extends EmberObject {translationParams.unlistedReason = topic.visibilityReasonTranslated;}- result.title = I18n.t(+ result.title = i18n(`topic_statuses.${result.key}.help`,translationParams);diff --git a/app/assets/javascripts/discourse/app/routes/about.js b/app/assets/javascripts/discourse/app/routes/about.jsindex 5c0af69efbc..dfed837b448 100644--- a/app/assets/javascripts/discourse/app/routes/about.js+++ b/app/assets/javascripts/discourse/app/routes/about.js@@ -2,7 +2,7 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import Category from "discourse/models/category";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class About extends DiscourseRoute {@service site;@@ -32,6 +32,6 @@ export default class About extends DiscourseRoute {}titleToken() {- return I18n.t("about.simple_title");+ return i18n("about.simple_title");}}diff --git a/app/assets/javascripts/discourse/app/routes/account-created.js b/app/assets/javascripts/discourse/app/routes/account-created.jsindex 745960ee18a..5aa5bddf02b 100644--- a/app/assets/javascripts/discourse/app/routes/account-created.js+++ b/app/assets/javascripts/discourse/app/routes/account-created.js@@ -1,10 +1,10 @@import PreloadStore from "discourse/lib/preload-store";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class AccountCreated extends DiscourseRoute {titleToken() {- return I18n.t("create_account.activation_title");+ return i18n("create_account.activation_title");}setupController(controller) {diff --git a/app/assets/javascripts/discourse/app/routes/activate-account.js b/app/assets/javascripts/discourse/app/routes/activate-account.jsindex 5d5af2de174..a1893adbe3a 100644--- a/app/assets/javascripts/discourse/app/routes/activate-account.js+++ b/app/assets/javascripts/discourse/app/routes/activate-account.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ActivateAccountRoute extends DiscourseRoute {titleToken() {- return I18n.t("login.activate_account");+ return i18n("login.activate_account");}}diff --git a/app/assets/javascripts/discourse/app/routes/application.js b/app/assets/javascripts/discourse/app/routes/application.jsindex 9e82bcafeef..2cd41cc9110 100644--- a/app/assets/javascripts/discourse/app/routes/application.js+++ b/app/assets/javascripts/discourse/app/routes/application.js@@ -19,7 +19,7 @@ import DiscourseRoute from "discourse/routes/discourse";import deprecated from "discourse-common/lib/deprecated";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function isStrictlyReadonly(site) {return site.isReadOnly && !site.isStaffWritesOnly;@@ -101,7 +101,7 @@ export default class ApplicationRoute extends DiscourseRoute {@actionlogout() {if (isStrictlyReadonly(this.site)) {- this.dialog.alert(I18n.t("read_only_mode.logout_disabled"));+ this.dialog.alert(i18n("read_only_mode.logout_disabled"));return;}this._handleLogout();@@ -127,7 +127,7 @@ export default class ApplicationRoute extends DiscourseRoute {? `${window.location.protocol}//${window.location.host}${post.url}`: null;const title = post- ? I18n.t("composer.reference_topic_title", {+ ? i18n("composer.reference_topic_title", {title: post.topic.title,}): null;@@ -191,7 +191,7 @@ export default class ApplicationRoute extends DiscourseRoute {@actionshowLogin() {if (isStrictlyReadonly(this.site)) {- this.dialog.alert(I18n.t("read_only_mode.login_disabled"));+ this.dialog.alert(i18n("read_only_mode.login_disabled"));return;}this.handleShowLogin();@@ -200,7 +200,7 @@ export default class ApplicationRoute extends DiscourseRoute {@actionshowCreateAccount(createAccountProps = {}) {if (this.site.isReadOnly) {- this.dialog.alert(I18n.t("read_only_mode.login_disabled"));+ this.dialog.alert(i18n("read_only_mode.login_disabled"));} else {this.handleShowCreateAccount(createAccountProps);}diff --git a/app/assets/javascripts/discourse/app/routes/badges-index.js b/app/assets/javascripts/discourse/app/routes/badges-index.jsindex 43fec31dbf5..6fd4964b8c3 100644--- a/app/assets/javascripts/discourse/app/routes/badges-index.js+++ b/app/assets/javascripts/discourse/app/routes/badges-index.js@@ -1,7 +1,7 @@import PreloadStore from "discourse/lib/preload-store";import Badge from "discourse/models/badge";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class BadgesIndex extends DiscourseRoute {model() {@@ -15,6 +15,6 @@ export default class BadgesIndex extends DiscourseRoute {}titleToken() {- return I18n.t("badges.title");+ return i18n("badges.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/build-category-route.js b/app/assets/javascripts/discourse/app/routes/build-category-route.jsindex f4a83abcf6d..839a96e227e 100644--- a/app/assets/javascripts/discourse/app/routes/build-category-route.js+++ b/app/assets/javascripts/discourse/app/routes/build-category-route.js@@ -12,7 +12,7 @@ import {findTopicList,} from "discourse/routes/build-topic-route";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";@disableImplicitInjectionsclass AbstractCategoryRoute extends DiscourseRoute {@@ -113,7 +113,7 @@ class AbstractCategoryRoute extends DiscourseRoute {titleToken() {const category = this.currentModel.category;- const filterText = I18n.t(+ const filterText = i18n("filters." + this.filter(category).replace("/", ".") + ".title");@@ -124,7 +124,7 @@ class AbstractCategoryRoute extends DiscourseRoute {categoryName = `${parentCategory.displayName}/${categoryName}`;}- return I18n.t("filters.with_category", {+ return i18n("filters.with_category", {filter: filterText,category: categoryName,});diff --git a/app/assets/javascripts/discourse/app/routes/build-group-messages-route.js b/app/assets/javascripts/discourse/app/routes/build-group-messages-route.jsindex a9bf510efc5..c177dde84a8 100644--- a/app/assets/javascripts/discourse/app/routes/build-group-messages-route.js+++ b/app/assets/javascripts/discourse/app/routes/build-group-messages-route.js@@ -1,10 +1,10 @@import UserTopicListRoute from "discourse/routes/user-topic-list";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default (type) => {return class BuildGroupMessagesRoute extends UserTopicListRoute {titleToken() {- return I18n.t(`user.messages.${type}`);+ return i18n(`user.messages.${type}`);}async model() {@@ -50,7 +50,7 @@ export default (type) => {emptyState() {return {- title: I18n.t("no_group_messages_title"),+ title: i18n("no_group_messages_title"),body: "",};}diff --git a/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.js b/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.jsindex eb90fdb79a8..3cd73abe4b2 100644--- a/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.js+++ b/app/assets/javascripts/discourse/app/routes/build-private-messages-group-route.js@@ -2,7 +2,7 @@ import { getOwner } from "@ember/owner";import { capitalize } from "@ember/string";import { findOrResetCachedTopicList } from "discourse/lib/cached-topic-list";import createPMRoute from "discourse/routes/build-private-messages-route";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default (inboxType, filter) => {return class extends createPMRoute(@@ -19,10 +19,10 @@ export default (inboxType, filter) => {let title = capitalize(groupName);if (filter !== "inbox") {- title = `${title} ${I18n.t("user.messages." + filter)}`;+ title = `${title} ${i18n("user.messages." + filter)}`;}- return [title, I18n.t(`user.private_messages`)];+ return [title, i18n(`user.private_messages`)];}}@@ -89,7 +89,7 @@ export default (inboxType, filter) => {emptyState() {return {- title: I18n.t("user.no_messages_title"),+ title: i18n("user.no_messages_title"),body: "",};}diff --git a/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js b/app/assets/javascripts/discourse/app/routes/build-private-messages-route.jsindex c8fa983a1bb..b004bd455f3 100644--- a/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js+++ b/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js@@ -5,7 +5,7 @@ import UserAction from "discourse/models/user-action";import UserTopicListRoute from "discourse/routes/user-topic-list";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const NEW_FILTER = "new";export const UNREAD_FILTER = "unread";@@ -18,10 +18,7 @@ export default (inboxType, path, filter) => {userActionType = UserAction.TYPES.messages_received;titleToken() {- return [- I18n.t(`user.messages.${filter}`),- I18n.t("user.private_messages"),- ];+ return [i18n(`user.messages.${filter}`), i18n("user.private_messages")];}async model(params = {}) {@@ -102,10 +99,10 @@ export default (inboxType, path, filter) => {}emptyState() {- const title = I18n.t("user.no_messages_title");+ const title = i18n("user.no_messages_title");const body = this.currentUser?.can_send_private_messages? htmlSafe(- I18n.t("user.no_messages_body", {+ i18n("user.no_messages_body", {aboutUrl: getURL("/about"),icon: iconHTML("envelope"),})diff --git a/app/assets/javascripts/discourse/app/routes/build-topic-route.js b/app/assets/javascripts/discourse/app/routes/build-topic-route.jsindex 76608d8eb27..55194551052 100644--- a/app/assets/javascripts/discourse/app/routes/build-topic-route.js+++ b/app/assets/javascripts/discourse/app/routes/build-topic-route.js@@ -9,7 +9,7 @@ import Session from "discourse/models/session";import Site from "discourse/models/site";import DiscourseRoute from "discourse/routes/discourse";import { deepEqual } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// A helper to build a topic route for a filterexport function filterQueryParams(params, defaultParams) {@@ -120,10 +120,10 @@ class AbstractTopicRoute extends DiscourseRoute {return;}- const filterText = I18n.t(+ const filterText = i18n("filters." + this.routeConfig.filter.replace("/", ".") + ".title");- return I18n.t("filters.with_topics", { filter: filterText });+ return i18n("filters.with_topics", { filter: filterText });}setupController(controller, model) {diff --git a/app/assets/javascripts/discourse/app/routes/confirm-new-email.js b/app/assets/javascripts/discourse/app/routes/confirm-new-email.jsindex 5e08a00fc44..d6c914c66ce 100644--- a/app/assets/javascripts/discourse/app/routes/confirm-new-email.js+++ b/app/assets/javascripts/discourse/app/routes/confirm-new-email.js@@ -1,10 +1,10 @@import { ajax } from "discourse/lib/ajax";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ConfirmNewEmailRoute extends DiscourseRoute {titleToken() {- return I18n.t("user.change_email.title");+ return i18n("user.change_email.title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/confirm-old-email.js b/app/assets/javascripts/discourse/app/routes/confirm-old-email.jsindex 0d2bd97d69e..cfd1ff05d55 100644--- a/app/assets/javascripts/discourse/app/routes/confirm-old-email.js+++ b/app/assets/javascripts/discourse/app/routes/confirm-old-email.js@@ -1,10 +1,10 @@import { ajax } from "discourse/lib/ajax";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ConfirmOldEmailRoute extends DiscourseRoute {titleToken() {- return I18n.t("user.change_email.title");+ return i18n("user.change_email.title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/discovery-categories.js b/app/assets/javascripts/discourse/app/routes/discovery-categories.jsindex 5f4b1326674..2153e846500 100644--- a/app/assets/javascripts/discourse/app/routes/discovery-categories.js+++ b/app/assets/javascripts/discourse/app/routes/discovery-categories.js@@ -9,7 +9,7 @@ import Category from "discourse/models/category";import CategoryList from "discourse/models/category-list";import TopicList from "discourse/models/topic-list";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class DiscoveryCategoriesRoute extends DiscourseRoute {@service modal;@@ -141,7 +141,7 @@ export default class DiscoveryCategoriesRoute extends DiscourseRoute {if (defaultHomepage() === "categories") {return;}- return I18n.t("filters.categories.title");+ return i18n("filters.categories.title");}setupController(controller) {diff --git a/app/assets/javascripts/discourse/app/routes/discovery-filter.js b/app/assets/javascripts/discourse/app/routes/discovery-filter.jsindex 689f570b90d..fdb817bb581 100644--- a/app/assets/javascripts/discourse/app/routes/discovery-filter.js+++ b/app/assets/javascripts/discourse/app/routes/discovery-filter.js@@ -1,6 +1,6 @@import { setTopicList } from "discourse/lib/topic-list-tracker";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class DiscoveryFilterRoute extends DiscourseRoute {queryParams = {@@ -19,7 +19,7 @@ export default class DiscoveryFilterRoute extends DiscourseRoute {}titleToken() {- const filterText = I18n.t("filters.filter.title");- return I18n.t("filters.with_topics", { filter: filterText });+ const filterText = i18n("filters.filter.title");+ return i18n("filters.with_topics", { filter: filterText });}}diff --git a/app/assets/javascripts/discourse/app/routes/edit-category.js b/app/assets/javascripts/discourse/app/routes/edit-category.jsindex dcabd8d8a34..bd2a5ea720f 100644--- a/app/assets/javascripts/discourse/app/routes/edit-category.js+++ b/app/assets/javascripts/discourse/app/routes/edit-category.js@@ -1,7 +1,7 @@import { service } from "@ember/service";import Category from "discourse/models/category";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EditCategory extends DiscourseRoute {@service router;@@ -20,7 +20,7 @@ export default class EditCategory extends DiscourseRoute {}titleToken() {- return I18n.t("category.edit_dialog_title", {+ return i18n("category.edit_dialog_title", {categoryName: this.currentModel.name,});}diff --git a/app/assets/javascripts/discourse/app/routes/email-login.js b/app/assets/javascripts/discourse/app/routes/email-login.jsindex f8dd7ae5939..b945142da58 100644--- a/app/assets/javascripts/discourse/app/routes/email-login.js+++ b/app/assets/javascripts/discourse/app/routes/email-login.js@@ -1,11 +1,11 @@import { ajax } from "discourse/lib/ajax";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class EmailLogin extends DiscourseRoute {titleToken() {- return I18n.t("login.title");+ return i18n("login.title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/faq.js b/app/assets/javascripts/discourse/app/routes/faq.jsindex 678d2168089..4ee69d0edd0 100644--- a/app/assets/javascripts/discourse/app/routes/faq.js+++ b/app/assets/javascripts/discourse/app/routes/faq.js@@ -2,7 +2,7 @@ import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";import StaticPage from "discourse/models/static-page";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FaqRoute extends DiscourseRoute {@service siteSettings;@@ -27,6 +27,6 @@ export default class FaqRoute extends DiscourseRoute {}titleToken() {- return I18n.t(this.pageId);+ return i18n(this.pageId);}}diff --git a/app/assets/javascripts/discourse/app/routes/full-page-search.js b/app/assets/javascripts/discourse/app/routes/full-page-search.jsindex d3a6f66c4aa..780e6dde090 100644--- a/app/assets/javascripts/discourse/app/routes/full-page-search.js+++ b/app/assets/javascripts/discourse/app/routes/full-page-search.js@@ -9,7 +9,7 @@ import {} from "discourse/lib/search";import { escapeExpression } from "discourse/lib/utilities";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class FullPageSearch extends DiscourseRoute {queryParams = {@@ -23,7 +23,7 @@ export default class FullPageSearch extends DiscourseRoute {category = null;titleToken() {- return I18n.t("search.results_page", {+ return i18n("search.results_page", {term: escapeExpression(this.controllerFor("full-page-search").get("searchTerm")),diff --git a/app/assets/javascripts/discourse/app/routes/group-activity-posts.js b/app/assets/javascripts/discourse/app/routes/group-activity-posts.jsindex 41008bbdc8b..d12f409b45c 100644--- a/app/assets/javascripts/discourse/app/routes/group-activity-posts.js+++ b/app/assets/javascripts/discourse/app/routes/group-activity-posts.js@@ -1,6 +1,6 @@import { action, get } from "@ember/object";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function buildGroupPage(type) {return class GroupActivityPosts extends DiscourseRoute {@@ -9,7 +9,7 @@ export function buildGroupPage(type) {controllerName = "group-activity-posts";titleToken() {- return I18n.t(`groups.${type}`);+ return i18n(`groups.${type}`);}model(params, transition) {diff --git a/app/assets/javascripts/discourse/app/routes/group-activity-topics.js b/app/assets/javascripts/discourse/app/routes/group-activity-topics.jsindex 32117e2b153..ce849795c50 100644--- a/app/assets/javascripts/discourse/app/routes/group-activity-topics.js+++ b/app/assets/javascripts/discourse/app/routes/group-activity-topics.js@@ -1,9 +1,9 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupActivityTopics extends DiscourseRoute {titleToken() {- return I18n.t(`groups.topics`);+ return i18n(`groups.topics`);}model(params = {}) {diff --git a/app/assets/javascripts/discourse/app/routes/group-index.js b/app/assets/javascripts/discourse/app/routes/group-index.jsindex a83f0e7b137..200d5fe2407 100644--- a/app/assets/javascripts/discourse/app/routes/group-index.js+++ b/app/assets/javascripts/discourse/app/routes/group-index.js@@ -3,13 +3,13 @@ import { service } from "@ember/service";import CreateInvite from "discourse/components/modal/create-invite";import GroupAddMembersModal from "discourse/components/modal/group-add-members";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupIndex extends DiscourseRoute {@service modal;titleToken() {- return I18n.t("groups.members.title");+ return i18n("groups.members.title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-categories.js b/app/assets/javascripts/discourse/app/routes/group-manage-categories.jsindex 526f596dbad..16929ffaebb 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-categories.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-categories.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageCategories extends DiscourseRoute {titleToken() {- return I18n.t("groups.manage.categories.title");+ return i18n("groups.manage.categories.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-email.js b/app/assets/javascripts/discourse/app/routes/group-manage-email.jsindex 9ff3785eb96..6090f73f755 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-email.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-email.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageEmail extends DiscourseRoute {@service router;@@ -13,6 +13,6 @@ export default class GroupManageEmail extends DiscourseRoute {}titleToken() {- return I18n.t("groups.manage.email.title");+ return i18n("groups.manage.email.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-interaction.js b/app/assets/javascripts/discourse/app/routes/group-manage-interaction.jsindex d67fb97cd02..7713bd1d319 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-interaction.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-interaction.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageInteraction extends DiscourseRoute {titleToken() {- return I18n.t("groups.manage.interaction.title");+ return i18n("groups.manage.interaction.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-logs.js b/app/assets/javascripts/discourse/app/routes/group-manage-logs.jsindex 137c329e443..9d1bf700315 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-logs.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-logs.js@@ -1,10 +1,10 @@import { action } from "@ember/object";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageLogs extends DiscourseRoute {titleToken() {- return I18n.t("groups.manage.logs.title");+ return i18n("groups.manage.logs.title");}model() {diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-membership.js b/app/assets/javascripts/discourse/app/routes/group-manage-membership.jsindex 334fc41eb7b..15bc1d3169d 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-membership.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-membership.js@@ -1,12 +1,12 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageMembership extends DiscourseRoute {@service router;titleToken() {- return I18n.t("groups.manage.membership.title");+ return i18n("groups.manage.membership.title");}afterModel(group) {diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-profile.js b/app/assets/javascripts/discourse/app/routes/group-manage-profile.jsindex 575500a06b9..ac96d369a68 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-profile.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-profile.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageProfile extends DiscourseRoute {titleToken() {- return I18n.t("groups.manage.profile.title");+ return i18n("groups.manage.profile.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/group-manage-tags.js b/app/assets/javascripts/discourse/app/routes/group-manage-tags.jsindex 7e8e05d5f7a..2a773ef499c 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage-tags.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage-tags.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManageTags extends DiscourseRoute {titleToken() {- return I18n.t("groups.manage.tags.title");+ return i18n("groups.manage.tags.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/group-manage.js b/app/assets/javascripts/discourse/app/routes/group-manage.jsindex eca64b860cf..e6f026f49ab 100644--- a/app/assets/javascripts/discourse/app/routes/group-manage.js+++ b/app/assets/javascripts/discourse/app/routes/group-manage.js@@ -1,12 +1,12 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupManage extends DiscourseRoute {@service router;titleToken() {- return I18n.t("groups.manage.title");+ return i18n("groups.manage.title");}model() {diff --git a/app/assets/javascripts/discourse/app/routes/group-messages.js b/app/assets/javascripts/discourse/app/routes/group-messages.jsindex cfd52fe4f56..455afee4ead 100644--- a/app/assets/javascripts/discourse/app/routes/group-messages.js+++ b/app/assets/javascripts/discourse/app/routes/group-messages.js@@ -1,13 +1,13 @@import { action } from "@ember/object";import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupMessages extends DiscourseRoute {@service router;titleToken() {- return I18n.t("groups.messages");+ return i18n("groups.messages");}model() {diff --git a/app/assets/javascripts/discourse/app/routes/group-permissions.js b/app/assets/javascripts/discourse/app/routes/group-permissions.jsindex 24090869417..90055e9a1e3 100644--- a/app/assets/javascripts/discourse/app/routes/group-permissions.js+++ b/app/assets/javascripts/discourse/app/routes/group-permissions.js@@ -2,13 +2,13 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { buildPermissionDescription } from "discourse/models/permission-type";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupPermissions extends DiscourseRoute {@service router;titleToken() {- return I18n.t("groups.permissions.title");+ return i18n("groups.permissions.title");}model() {diff --git a/app/assets/javascripts/discourse/app/routes/group-requests.js b/app/assets/javascripts/discourse/app/routes/group-requests.jsindex c500a11c98a..a51ba38ebe4 100644--- a/app/assets/javascripts/discourse/app/routes/group-requests.js+++ b/app/assets/javascripts/discourse/app/routes/group-requests.js@@ -1,9 +1,9 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupRequests extends DiscourseRoute {titleToken() {- return I18n.t("groups.requests.title");+ return i18n("groups.requests.title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/groups-index.js b/app/assets/javascripts/discourse/app/routes/groups-index.jsindex 7e224e01c88..fe20b9be9a4 100644--- a/app/assets/javascripts/discourse/app/routes/groups-index.js+++ b/app/assets/javascripts/discourse/app/routes/groups-index.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsIndexRoute extends DiscourseRoute {queryParams = {@@ -11,7 +11,7 @@ export default class GroupsIndexRoute extends DiscourseRoute {};titleToken() {- return I18n.t("groups.index.title");+ return i18n("groups.index.title");}async model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/groups-new.js b/app/assets/javascripts/discourse/app/routes/groups-new.jsindex 33af1fe5ec3..4772788dcef 100644--- a/app/assets/javascripts/discourse/app/routes/groups-new.js+++ b/app/assets/javascripts/discourse/app/routes/groups-new.js@@ -1,13 +1,13 @@import { service } from "@ember/service";import Group from "discourse/models/group";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class GroupsNew extends DiscourseRoute {@service router;titleToken() {- return I18n.t("admin.groups.new.title");+ return i18n("admin.groups.new.title");}model() {diff --git a/app/assets/javascripts/discourse/app/routes/invites-show.js b/app/assets/javascripts/discourse/app/routes/invites-show.jsindex 78596e1c623..5760275832f 100644--- a/app/assets/javascripts/discourse/app/routes/invites-show.js+++ b/app/assets/javascripts/discourse/app/routes/invites-show.js@@ -3,13 +3,13 @@ import { ajax } from "discourse/lib/ajax";import PreloadStore from "discourse/lib/preload-store";import DiscourseRoute from "discourse/routes/discourse";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class InvitesShow extends DiscourseRoute {@service siteSettings;titleToken() {- return I18n.t("invites.accept_title");+ return i18n("invites.accept_title");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/new-category.js b/app/assets/javascripts/discourse/app/routes/new-category.jsindex 16473ba6ab4..18c95d9c420 100644--- a/app/assets/javascripts/discourse/app/routes/new-category.js+++ b/app/assets/javascripts/discourse/app/routes/new-category.js@@ -2,7 +2,7 @@ import { service } from "@ember/service";import { Promise } from "rsvp";import { SEARCH_PRIORITIES } from "discourse/lib/constants";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _newCategoryColor = "0088CC";let _newCategoryTextColor = "FFFFFF";@@ -62,7 +62,7 @@ export default class NewCategory extends DiscourseRoute {}titleToken() {- return I18n.t("category.create");+ return i18n("category.create");}groupPermissions() {diff --git a/app/assets/javascripts/discourse/app/routes/new-invite.js b/app/assets/javascripts/discourse/app/routes/new-invite.jsindex b2122b65e4a..b044af7f631 100644--- a/app/assets/javascripts/discourse/app/routes/new-invite.js+++ b/app/assets/javascripts/discourse/app/routes/new-invite.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import CreateInvite from "discourse/components/modal/create-invite";import cookie from "discourse/lib/cookie";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends DiscourseRoute {@service router;@@ -37,7 +37,7 @@ export default class extends DiscourseRoute {if (this.currentUser.can_invite_to_forum) {this.modal.show(CreateInvite, { model: { invites: [] } });} else {- this.dialog.alert(I18n.t("user.invited.cannot_invite_to_forum"));+ this.dialog.alert(i18n("user.invited.cannot_invite_to_forum"));}});}diff --git a/app/assets/javascripts/discourse/app/routes/new-message.js b/app/assets/javascripts/discourse/app/routes/new-message.jsindex 7031e6d7299..cae206ebb0a 100644--- a/app/assets/javascripts/discourse/app/routes/new-message.js+++ b/app/assets/javascripts/discourse/app/routes/new-message.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import cookie from "discourse/lib/cookie";import Group from "discourse/models/group";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class NewMessage extends DiscourseRoute {@service dialog;@@ -36,12 +36,12 @@ export default class NewMessage extends DiscourseRoute {this.openComposer(transition, groupName);} else {this.dialog.alert(- I18n.t("composer.cant_send_pm", { username: groupName })+ i18n("composer.cant_send_pm", { username: groupName }));}}).catch(() =>- this.dialog.alert(I18n.t("composer.create_message_error"))+ this.dialog.alert(i18n("composer.create_message_error")));}@@ -63,12 +63,12 @@ export default class NewMessage extends DiscourseRoute {this.openComposer(transition, groupName);} else {this.dialog.alert(- I18n.t("composer.cant_send_pm", { username: groupName })+ i18n("composer.cant_send_pm", { username: groupName }));}}).catch(() =>- this.dialog.alert(I18n.t("composer.create_message_error"))+ this.dialog.alert(i18n("composer.create_message_error")));}diff --git a/app/assets/javascripts/discourse/app/routes/password-reset.js b/app/assets/javascripts/discourse/app/routes/password-reset.jsindex 7ded636b757..ee2dcced9ca 100644--- a/app/assets/javascripts/discourse/app/routes/password-reset.js+++ b/app/assets/javascripts/discourse/app/routes/password-reset.js@@ -3,11 +3,11 @@ import PreloadStore from "discourse/lib/preload-store";import { userPath } from "discourse/lib/url";import DiscourseRoute from "discourse/routes/discourse";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PasswordReset extends DiscourseRoute {titleToken() {- return I18n.t("login.reset_password");+ return i18n("login.reset_password");}model(params) {diff --git a/app/assets/javascripts/discourse/app/routes/preferences-account.js b/app/assets/javascripts/discourse/app/routes/preferences-account.jsindex 48e0b470c85..2a805cf9410 100644--- a/app/assets/javascripts/discourse/app/routes/preferences-account.js+++ b/app/assets/javascripts/discourse/app/routes/preferences-account.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import AvatarSelectorModal from "discourse/components/modal/avatar-selector";import UserBadge from "discourse/models/user-badge";import RestrictedUserRoute from "discourse/routes/restricted-user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PreferencesAccount extends RestrictedUserRoute {@service modal;@@ -34,7 +34,7 @@ export default class PreferencesAccount extends RestrictedUserRoute {newPrimaryGroupInput: user.get("primary_group_id"),newFlairGroupId: user.get("flair_group_id"),newStatus: user.status,- subpageTitle: I18n.t("user.preferences_nav.account"),+ subpageTitle: i18n("user.preferences_nav.account"),});}diff --git a/app/assets/javascripts/discourse/app/routes/preferences.js b/app/assets/javascripts/discourse/app/routes/preferences.jsindex 02ddb803938..bd09eac2d3b 100644--- a/app/assets/javascripts/discourse/app/routes/preferences.js+++ b/app/assets/javascripts/discourse/app/routes/preferences.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import RestrictedUserRoute from "discourse/routes/restricted-user";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Preferences extends RestrictedUserRoute {@service router;@@ -13,7 +13,7 @@ export default class Preferences extends RestrictedUserRoute {let controller = this.controllerFor(this.router.currentRouteName);let subpageTitle = controller?.subpageTitle;return subpageTitle- ? `${subpageTitle} - ${I18n.t("user.preferences.title")}`- : I18n.t("user.preferences.title");+ ? `${subpageTitle} - ${i18n("user.preferences.title")}`+ : i18n("user.preferences.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/privacy.js b/app/assets/javascripts/discourse/app/routes/privacy.jsindex 638555d1b1b..c635a78256f 100644--- a/app/assets/javascripts/discourse/app/routes/privacy.js+++ b/app/assets/javascripts/discourse/app/routes/privacy.js@@ -2,7 +2,7 @@ import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";import StaticPage from "discourse/models/static-page";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PrivacyRoute extends DiscourseRoute {@service siteSettings;@@ -24,6 +24,6 @@ export default class PrivacyRoute extends DiscourseRoute {}titleToken() {- return I18n.t("privacy");+ return i18n("privacy");}}diff --git a/app/assets/javascripts/discourse/app/routes/review.js b/app/assets/javascripts/discourse/app/routes/review.jsindex 4ff737bae94..4857fbd4bb6 100644--- a/app/assets/javascripts/discourse/app/routes/review.js+++ b/app/assets/javascripts/discourse/app/routes/review.js@@ -1,8 +1,8 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Review extends DiscourseRoute {titleToken() {- return I18n.t("review.title");+ return i18n("review.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/tag-groups-new.js b/app/assets/javascripts/discourse/app/routes/tag-groups-new.jsindex cf15b02f44d..1b6e3432065 100644--- a/app/assets/javascripts/discourse/app/routes/tag-groups-new.js+++ b/app/assets/javascripts/discourse/app/routes/tag-groups-new.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TagGroupsNew extends DiscourseRoute {@service router;@@ -13,7 +13,7 @@ export default class TagGroupsNew extends DiscourseRoute {model() {return this.store.createRecord("tagGroup", {- name: I18n.t("tagging.groups.new_name"),+ name: i18n("tagging.groups.new_name"),});}}diff --git a/app/assets/javascripts/discourse/app/routes/tag-groups.js b/app/assets/javascripts/discourse/app/routes/tag-groups.jsindex 80f175d5700..08900a8a945 100644--- a/app/assets/javascripts/discourse/app/routes/tag-groups.js+++ b/app/assets/javascripts/discourse/app/routes/tag-groups.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TagGroups extends DiscourseRoute {model() {@@ -7,6 +7,6 @@ export default class TagGroups extends DiscourseRoute {}titleToken() {- return I18n.t("tagging.groups.title");+ return i18n("tagging.groups.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/tag-show.js b/app/assets/javascripts/discourse/app/routes/tag-show.jsindex fbd7ae19c68..846e1de7a2b 100644--- a/app/assets/javascripts/discourse/app/routes/tag-show.js+++ b/app/assets/javascripts/discourse/app/routes/tag-show.js@@ -13,7 +13,7 @@ import {findTopicList,} from "discourse/routes/build-topic-route";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const NONE = "none";const ALL = "all";@@ -168,33 +168,31 @@ export default class TagShowRoute extends DiscourseRoute {}titleToken() {- const filterText = I18n.t(- `filters.${this.navMode.replace("/", ".")}.title`- );+ const filterText = i18n(`filters.${this.navMode.replace("/", ".")}.title`);const model = this.currentModel;const tag = model?.tag?.id;if (tag && tag !== NONE) {if (model.category) {- return I18n.t("tagging.filters.with_category", {+ return i18n("tagging.filters.with_category", {filter: filterText,tag: model.tag.id,category: model.category.displayName,});} else {- return I18n.t("tagging.filters.without_category", {+ return i18n("tagging.filters.without_category", {filter: filterText,tag: model.tag.id,});}} else {if (model.category) {- return I18n.t("tagging.filters.untagged_with_category", {+ return i18n("tagging.filters.untagged_with_category", {filter: filterText,category: model.category.displayName,});} else {- return I18n.t("tagging.filters.untagged_without_category", {+ return i18n("tagging.filters.untagged_without_category", {filter: filterText,});}diff --git a/app/assets/javascripts/discourse/app/routes/tags-index.js b/app/assets/javascripts/discourse/app/routes/tags-index.jsindex 301bc342c43..cb19348b393 100644--- a/app/assets/javascripts/discourse/app/routes/tags-index.js+++ b/app/assets/javascripts/discourse/app/routes/tags-index.js@@ -2,7 +2,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import Tag from "discourse/models/tag";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TagsIndex extends DiscourseRoute {@service router;@@ -26,7 +26,7 @@ export default class TagsIndex extends DiscourseRoute {}titleToken() {- return I18n.t("tagging.tags");+ return i18n("tagging.tags");}setupController(controller, model) {diff --git a/app/assets/javascripts/discourse/app/routes/tos.js b/app/assets/javascripts/discourse/app/routes/tos.jsindex dcc74c3f562..b80a62a08b0 100644--- a/app/assets/javascripts/discourse/app/routes/tos.js+++ b/app/assets/javascripts/discourse/app/routes/tos.js@@ -2,7 +2,7 @@ import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";import StaticPage from "discourse/models/static-page";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class TosRoute extends DiscourseRoute {@service siteSettings;@@ -24,6 +24,6 @@ export default class TosRoute extends DiscourseRoute {}titleToken() {- return I18n.t("tos");+ return i18n("tos");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-bookmarks.js b/app/assets/javascripts/discourse/app/routes/user-activity-bookmarks.jsindex 568fb45a32b..d763024a854 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-bookmarks.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-bookmarks.js@@ -6,7 +6,7 @@ import { ajax } from "discourse/lib/ajax";import Bookmark from "discourse/models/bookmark";import Site from "discourse/models/site";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityBookmarks extends DiscourseRoute {@service historyStore;@@ -60,7 +60,7 @@ export default class UserActivityBookmarks extends DiscourseRoute {}titleToken() {- return I18n.t("user_action_groups.3");+ return i18n("user_action_groups.3");}@actiondiff --git a/app/assets/javascripts/discourse/app/routes/user-activity-drafts.js b/app/assets/javascripts/discourse/app/routes/user-activity-drafts.jsindex 195bd92dd5f..4987edd2cee 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-drafts.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-drafts.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityDrafts extends DiscourseRoute {templateName = "user/stream";@@ -18,8 +18,8 @@ export default class UserActivityDrafts extends DiscourseRoute {}emptyState() {- const title = I18n.t("user_activity.no_drafts_title");- const body = I18n.t("user_activity.no_drafts_body");+ const title = i18n("user_activity.no_drafts_title");+ const body = i18n("user_activity.no_drafts_body");return { title, body };}@@ -32,6 +32,6 @@ export default class UserActivityDrafts extends DiscourseRoute {}titleToken() {- return I18n.t("user_action_groups.15");+ return i18n("user_action_groups.15");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-index.js b/app/assets/javascripts/discourse/app/routes/user-activity-index.jsindex c782fb66132..462d5bcefa2 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-index.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-index.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityIndex extends UserActivityStreamRoute {userActionType = null;@@ -10,11 +10,11 @@ export default class UserActivityIndex extends UserActivityStreamRoute {emptyState() {const user = this.modelFor("user");- const title = I18n.t("user_activity.no_activity_title");+ const title = i18n("user_activity.no_activity_title");let body = "";if (this.isCurrentUser(user)) {body = htmlSafe(- I18n.t("user_activity.no_activity_body", {+ i18n("user_activity.no_activity_body", {topUrl: getURL("/top"),categoriesUrl: getURL("/categories"),preferencesUrl: getURL("/my/preferences"),@@ -27,6 +27,6 @@ export default class UserActivityIndex extends UserActivityStreamRoute {}titleToken() {- return I18n.t("user.filters.all");+ return i18n("user.filters.all");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-likes-given.js b/app/assets/javascripts/discourse/app/routes/user-activity-likes-given.jsindex 07506b707cf..9277cdfff16 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-likes-given.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-likes-given.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityLikesGiven extends UserActivityStreamRoute {userActionType = UserAction.TYPES["likes_given"];@@ -11,12 +11,12 @@ export default class UserActivityLikesGiven extends UserActivityStreamRoute {const user = this.modelFor("user");const title = this.isCurrentUser(user)- ? I18n.t("user_activity.no_likes_title")- : I18n.t("user_activity.no_likes_title_others", {+ ? i18n("user_activity.no_likes_title")+ : i18n("user_activity.no_likes_title_others", {username: user.username,});const body = htmlSafe(- I18n.t("user_activity.no_likes_body", {+ i18n("user_activity.no_likes_body", {heartIcon: iconHTML("heart"),}));@@ -25,6 +25,6 @@ export default class UserActivityLikesGiven extends UserActivityStreamRoute {}titleToken() {- return I18n.t("user_action_groups.1");+ return i18n("user_action_groups.1");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-read.js b/app/assets/javascripts/discourse/app/routes/user-activity-read.jsindex 342f4fd4299..359ed9bf813 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-read.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-read.js@@ -4,7 +4,7 @@ import UserAction from "discourse/models/user-action";import UserTopicListRoute from "discourse/routes/user-topic-list";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityRead extends UserTopicListRoute {userActionType = UserAction.TYPES.topics;@@ -24,9 +24,9 @@ export default class UserActivityRead extends UserTopicListRoute {}emptyState() {- const title = I18n.t("user_activity.no_read_topics_title");+ const title = i18n("user_activity.no_read_topics_title");const body = htmlSafe(- I18n.t("user_activity.no_read_topics_body", {+ i18n("user_activity.no_read_topics_body", {topUrl: getURL("/top"),categoriesUrl: getURL("/categories"),searchIcon: iconHTML("magnifying-glass"),@@ -36,7 +36,7 @@ export default class UserActivityRead extends UserTopicListRoute {}titleToken() {- return `${I18n.t("user.read")}`;+ return `${i18n("user.read")}`;}@actiondiff --git a/app/assets/javascripts/discourse/app/routes/user-activity-replies.js b/app/assets/javascripts/discourse/app/routes/user-activity-replies.jsindex dcf6d8f96c0..39c571c8cbe 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-replies.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-replies.js@@ -2,7 +2,7 @@ import { htmlSafe } from "@ember/template";import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityReplies extends UserActivityStreamRoute {userActionType = UserAction.TYPES["posts"];@@ -12,14 +12,14 @@ export default class UserActivityReplies extends UserActivityStreamRoute {let title, body;if (this.isCurrentUser(user)) {- title = I18n.t("user_activity.no_replies_title");+ title = i18n("user_activity.no_replies_title");body = htmlSafe(- I18n.t("user_activity.no_replies_body", {+ i18n("user_activity.no_replies_body", {searchUrl: getURL("/search"),}));} else {- title = I18n.t("user_activity.no_replies_title_others", {+ title = i18n("user_activity.no_replies_title_others", {username: user.username,});body = "";@@ -29,6 +29,6 @@ export default class UserActivityReplies extends UserActivityStreamRoute {}titleToken() {- return I18n.t("user_action_groups.5");+ return i18n("user_action_groups.5");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-stream.js b/app/assets/javascripts/discourse/app/routes/user-activity-stream.jsindex 25a4a378179..00007e1a62e 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-stream.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-stream.js@@ -1,6 +1,6 @@import ViewingActionType from "discourse/mixins/viewing-action-type";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityStream extends DiscourseRoute.extend(ViewingActionType@@ -34,7 +34,7 @@ export default class UserActivityStream extends DiscourseRoute.extend(}emptyState() {- const title = I18n.t("user_activity.no_activity_title");+ const title = i18n("user_activity.no_activity_title");const body = "";return { title, body };}diff --git a/app/assets/javascripts/discourse/app/routes/user-activity-topics.js b/app/assets/javascripts/discourse/app/routes/user-activity-topics.jsindex ea50e143ecc..d8c60de60e0 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity-topics.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity-topics.js@@ -3,7 +3,7 @@ import { htmlSafe } from "@ember/template";import UserAction from "discourse/models/user-action";import UserTopicListRoute from "discourse/routes/user-topic-list";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivityTopics extends UserTopicListRoute {userActionType = UserAction.TYPES.topics;@@ -28,14 +28,14 @@ export default class UserActivityTopics extends UserTopicListRoute {const user = this.modelFor("user");let title, body;if (this.isCurrentUser(user)) {- title = I18n.t("user_activity.no_topics_title");+ title = i18n("user_activity.no_topics_title");body = htmlSafe(- I18n.t("user_activity.no_topics_body", {+ i18n("user_activity.no_topics_body", {searchUrl: getURL("/search"),}));} else {- title = I18n.t("user_activity.no_topics_title_others", {+ title = i18n("user_activity.no_topics_title_others", {username: user.username,});body = "";@@ -45,7 +45,7 @@ export default class UserActivityTopics extends UserTopicListRoute {}titleToken() {- return I18n.t("user_action_groups.4");+ return i18n("user_action_groups.4");}@actiondiff --git a/app/assets/javascripts/discourse/app/routes/user-activity.js b/app/assets/javascripts/discourse/app/routes/user-activity.jsindex 09377ead385..4622552794d 100644--- a/app/assets/javascripts/discourse/app/routes/user-activity.js+++ b/app/assets/javascripts/discourse/app/routes/user-activity.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserActivity extends DiscourseRoute {@service router;@@ -19,6 +19,6 @@ export default class UserActivity extends DiscourseRoute {}titleToken() {- return I18n.t("user.activity_stream");+ return i18n("user.activity_stream");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-badges.js b/app/assets/javascripts/discourse/app/routes/user-badges.jsindex 7131591cd7b..1add47f22ef 100644--- a/app/assets/javascripts/discourse/app/routes/user-badges.js+++ b/app/assets/javascripts/discourse/app/routes/user-badges.js@@ -1,7 +1,7 @@import ViewingActionType from "discourse/mixins/viewing-action-type";import UserBadge from "discourse/models/user-badge";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserBadges extends DiscourseRoute.extend(ViewingActionType@@ -21,6 +21,6 @@ export default class UserBadges extends DiscourseRoute.extend(}titleToken() {- return I18n.t("badges.title");+ return i18n("badges.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-invited-show.js b/app/assets/javascripts/discourse/app/routes/user-invited-show.jsindex c5fc072784d..ee4cb506fd1 100644--- a/app/assets/javascripts/discourse/app/routes/user-invited-show.js+++ b/app/assets/javascripts/discourse/app/routes/user-invited-show.js@@ -2,7 +2,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import Invite from "discourse/models/invite";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserInvitedShow extends DiscourseRoute {@service router;@@ -32,7 +32,7 @@ export default class UserInvitedShow extends DiscourseRoute {}titleToken() {- return I18n.t("user.invited." + this.inviteFilter + "_tab");+ return i18n("user.invited." + this.inviteFilter + "_tab");}@actiondiff --git a/app/assets/javascripts/discourse/app/routes/user-invited.js b/app/assets/javascripts/discourse/app/routes/user-invited.jsindex c289f50c7d0..2d4698dcb0a 100644--- a/app/assets/javascripts/discourse/app/routes/user-invited.js+++ b/app/assets/javascripts/discourse/app/routes/user-invited.js@@ -1,5 +1,5 @@import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserInvited extends DiscourseRoute {setupController(controller) {@@ -13,6 +13,6 @@ export default class UserInvited extends DiscourseRoute {}titleToken() {- return I18n.t("user.invited.title");+ return i18n("user.invited.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-edits.js b/app/assets/javascripts/discourse/app/routes/user-notifications-edits.jsindex 0d575f61479..4b322345dd5 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-edits.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-edits.js@@ -1,11 +1,11 @@import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsEdits extends UserActivityStreamRoute {userActionType = UserAction.TYPES["edits"];titleToken() {- return I18n.t("user_action_groups.11");+ return i18n("user_action_groups.11");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-index.js b/app/assets/javascripts/discourse/app/routes/user-notifications-index.jsindex 7f8eda28360..07aece6bcec 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-index.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-index.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsIndex extends DiscourseRoute {@service router;@@ -9,7 +9,7 @@ export default class UserNotificationsIndex extends DiscourseRoute {templateName = "user/notifications-index";titleToken() {- return I18n.t("user.filters.all");+ return i18n("user.filters.all");}afterModel(model) {diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-likes-received.js b/app/assets/javascripts/discourse/app/routes/user-notifications-likes-received.jsindex f9d9d2aae4d..3745ed925e4 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-likes-received.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-likes-received.js@@ -1,11 +1,11 @@import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsLikesReceived extends UserActivityStreamRoute {userActionType = UserAction.TYPES["likes_received"];titleToken() {- return I18n.t("user_action_groups.1");+ return i18n("user_action_groups.1");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-links.js b/app/assets/javascripts/discourse/app/routes/user-notifications-links.jsindex f58f008672f..e453374f472 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-links.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-links.js@@ -1,11 +1,11 @@import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsLinks extends UserActivityStreamRoute {userActionType = UserAction.TYPES["links"];titleToken() {- return I18n.t("user_action_groups.17");+ return i18n("user_action_groups.17");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-mentions.js b/app/assets/javascripts/discourse/app/routes/user-notifications-mentions.jsindex b3b189bd961..1cf43975835 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-mentions.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-mentions.js@@ -1,11 +1,11 @@import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsMentions extends UserActivityStreamRoute {userActionType = UserAction.TYPES["mentions"];titleToken() {- return I18n.t("user_action_groups.7");+ return i18n("user_action_groups.7");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications-responses.js b/app/assets/javascripts/discourse/app/routes/user-notifications-responses.jsindex 8c7e87598cc..8662b3e3264 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications-responses.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications-responses.js@@ -1,11 +1,11 @@import UserAction from "discourse/models/user-action";import UserActivityStreamRoute from "discourse/routes/user-activity-stream";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserNotificationsResponses extends UserActivityStreamRoute {userActionType = UserAction.TYPES["replies"];titleToken() {- return I18n.t("user_action_groups.6");+ return i18n("user_action_groups.6");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-notifications.js b/app/assets/javascripts/discourse/app/routes/user-notifications.jsindex ec5a6d6da53..84d1347896a 100644--- a/app/assets/javascripts/discourse/app/routes/user-notifications.js+++ b/app/assets/javascripts/discourse/app/routes/user-notifications.js@@ -1,6 +1,6 @@import ViewingActionType from "discourse/mixins/viewing-action-type";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DEFAULT_LIMIT = 60;let limit = DEFAULT_LIMIT;@@ -37,6 +37,6 @@ export default class UserNotifications extends DiscourseRoute.extend(}titleToken() {- return I18n.t("user.notifications");+ return i18n("user.notifications");}}diff --git a/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-index.js b/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-index.jsindex 79f64dc2b1a..325da8a4157 100644--- a/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-index.js+++ b/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-index.js@@ -2,7 +2,7 @@ import EmberObject from "@ember/object";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserPrivateMessagesTagsIndex extends DiscourseRoute {model() {@@ -16,7 +16,7 @@ export default class UserPrivateMessagesTagsIndex extends DiscourseRoute {}titleToken() {- return [I18n.t("tagging.tags"), I18n.t("user.private_messages")];+ return [i18n("tagging.tags"), i18n("user.private_messages")];}setupController(controller, model) {diff --git a/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-show.js b/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-show.jsindex 01479381948..7ddc554febd 100644--- a/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-show.js+++ b/app/assets/javascripts/discourse/app/routes/user-private-messages-tags-show.js@@ -1,12 +1,12 @@import createPMRoute from "discourse/routes/build-private-messages-route";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends createPMRoute("tags", "private-messages-tags") {titleToken() {return [this.get("tagId"),- I18n.t("tagging.tags"),- I18n.t("user.private_messages"),+ i18n("tagging.tags"),+ i18n("user.private_messages"),];}diff --git a/app/assets/javascripts/discourse/app/routes/user-summary.js b/app/assets/javascripts/discourse/app/routes/user-summary.jsindex dd033d7549a..3a40e43f3ea 100644--- a/app/assets/javascripts/discourse/app/routes/user-summary.js+++ b/app/assets/javascripts/discourse/app/routes/user-summary.js@@ -1,6 +1,6 @@import { service } from "@ember/service";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserSummary extends DiscourseRoute {@service router;@@ -15,6 +15,6 @@ export default class UserSummary extends DiscourseRoute {}titleToken() {- return I18n.t("user.summary.title");+ return i18n("user.summary.title");}}diff --git a/app/assets/javascripts/discourse/app/routes/user.js b/app/assets/javascripts/discourse/app/routes/user.jsindex c728a8f2f15..f1e7ebb50e8 100644--- a/app/assets/javascripts/discourse/app/routes/user.js+++ b/app/assets/javascripts/discourse/app/routes/user.js@@ -4,7 +4,7 @@ import { RouteException } from "discourse/controllers/exception";import User from "discourse/models/user";import DiscourseRoute from "discourse/routes/discourse";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class UserRoute extends DiscourseRoute {@service router;@@ -16,7 +16,7 @@ export default class UserRoute extends DiscourseRoute {if (this.siteSettings.hide_user_profiles_from_public && !this.currentUser) {throw new RouteException({status: 403,- desc: I18n.t("user.login_to_view_profile"),+ desc: i18n("user.login_to_view_profile"),});}}diff --git a/app/assets/javascripts/discourse/app/routes/users.js b/app/assets/javascripts/discourse/app/routes/users.jsindex 3670b47cc7e..27310831193 100644--- a/app/assets/javascripts/discourse/app/routes/users.js+++ b/app/assets/javascripts/discourse/app/routes/users.js@@ -3,7 +3,7 @@ import { Promise } from "rsvp";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class Users extends DiscourseRoute {@service router;@@ -21,7 +21,7 @@ export default class Users extends DiscourseRoute {};titleToken() {- return I18n.t("directory.title");+ return i18n("directory.title");}resetController(controller, isExiting) {diff --git a/app/assets/javascripts/discourse/app/services/client-error-handler.js b/app/assets/javascripts/discourse/app/services/client-error-handler.jsindex 801a08149d2..51f5307ef2c 100644--- a/app/assets/javascripts/discourse/app/services/client-error-handler.js+++ b/app/assets/javascripts/discourse/app/services/client-error-handler.js@@ -10,7 +10,7 @@ import identifySource, {import escape from "discourse-common/lib/escape";import getURL from "discourse-common/lib/get-url";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const showingErrors = new Set();@@ -58,14 +58,14 @@ export default class ClientErrorHandlerService extends Service {reportToConsole(error, source);reportToLogster(source.name, error);- const message = I18n.t("themes.broken_theme_alert");+ const message = i18n("themes.broken_theme_alert");this.displayErrorNotice(message, source);}reportGenericError(e) {const { messageKey, error } = e.detail;- const message = I18n.t(messageKey);+ const message = i18n(messageKey);const source = identifySource(error);reportToConsole(error, source);@@ -84,17 +84,17 @@ export default class ClientErrorHandlerService extends Service {let html = `⚠️ ${escape(message)}`;if (source?.type === "theme") {- html += `<br/>${I18n.t("themes.error_caused_by", {+ html += `<br/>${i18n("themes.error_caused_by", {name: escape(source.name),path: source.path,})}`;} else if (source?.type === "plugin") {- html += `<br/>${I18n.t("broken_plugin_alert", {+ html += `<br/>${i18n("broken_plugin_alert", {name: escape(source.name),})}`;}- html += `<br/><span class='theme-error-suffix'>${I18n.t(+ html += `<br/><span class='theme-error-suffix'>${i18n("themes.only_admins")}</span>`;diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.jsindex d3575d416c9..93f92d5bb14 100644--- a/app/assets/javascripts/discourse/app/services/composer.js+++ b/app/assets/javascripts/discourse/app/services/composer.js@@ -46,7 +46,7 @@ import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";async function loadDraft(store, opts = {}) {let { draft, draftKey, draftSequence } = opts;@@ -208,8 +208,8 @@ export default class ComposerService extends Service {@discourseComputed("showPreview")toggleText(showPreview) {return showPreview- ? I18n.t("composer.hide_preview")- : I18n.t("composer.show_preview");+ ? i18n("composer.hide_preview")+ : i18n("composer.show_preview");}@observes("showPreview")@@ -506,33 +506,33 @@ export default class ComposerService extends Service {ariaLabel(modelAction, isWhispering, privateMessage, postUsername) {switch (modelAction) {case "createSharedDraft":- return I18n.t("composer.create_shared_draft");+ return i18n("composer.create_shared_draft");case "editSharedDraft":- return I18n.t("composer.edit_shared_draft");+ return i18n("composer.edit_shared_draft");case "createTopic":- return I18n.t("composer.composer_actions.create_topic.label");+ return i18n("composer.composer_actions.create_topic.label");case "privateMessage":- return I18n.t("user.new_private_message");+ return i18n("user.new_private_message");case "edit":- return I18n.t("composer.composer_actions.edit");+ return i18n("composer.composer_actions.edit");case "reply":if (isWhispering) {- return `${I18n.t("composer.create_whisper")} ${this.site.get(+ return `${i18n("composer.create_whisper")} ${this.site.get("whispers_allowed_groups_names")}`;}if (privateMessage) {- return I18n.t("composer.create_pm");+ return i18n("composer.create_pm");}if (postUsername) {- return I18n.t("composer.composer_actions.reply_to_post.label", {+ return i18n("composer.composer_actions.reply_to_post.label", {postUsername,});} else {- return I18n.t("composer.composer_actions.reply_to_topic.label");+ return i18n("composer.composer_actions.reply_to_topic.label");}default:- return I18n.t("keyboard_shortcuts_help.composing.title");+ return i18n("keyboard_shortcuts_help.composing.title");}}@@ -765,7 +765,7 @@ export default class ComposerService extends Service {this.appEvents.trigger("composer-messages:create", {extraClass: "custom-body",templateName: "education",- body: I18n.t("composer.duplicate_link_same_user", {+ body: i18n("composer.duplicate_link_same_user", {domain: linkInfo.domain,post_url: topic.urlForPostNumber(linkInfo.post_number),ago: shortDate(linkInfo.posted_at),@@ -775,7 +775,7 @@ export default class ComposerService extends Service {this.appEvents.trigger("composer-messages:create", {extraClass: "custom-body duplicate-link-message",templateName: "education",- body: I18n.t("composer.duplicate_link", {+ body: i18n("composer.duplicate_link", {domain: linkInfo.domain,username: linkInfo.username,post_url: topic.urlForPostNumber(linkInfo.post_number),@@ -932,7 +932,7 @@ export default class ComposerService extends Service {const groupLink = getURL(`/g/${name}/members`);if (userCount > maxMentions) {- body = I18n.t("composer.group_mentioned_limit", {+ body = i18n("composer.group_mentioned_limit", {group: `@${name}`,count: maxMentions,group_link: groupLink,@@ -943,7 +943,7 @@ export default class ComposerService extends Service {userCount >= 5? "composer.larger_group_mentioned": "composer.group_mentioned";- body = I18n.t(translationKey, {+ body = i18n(translationKey, {group: `@${name}`,count: userCount,group_link: groupLink,@@ -965,12 +965,12 @@ export default class ComposerService extends Service {let body;if (isGroup) {- body = I18n.t(`composer.cannot_see_group_mention.${reason}`, {+ body = i18n(`composer.cannot_see_group_mention.${reason}`, {group: name,count: notifiedCount,});} else {- body = I18n.t(`composer.cannot_see_mention.${reason}`, {+ body = i18n(`composer.cannot_see_mention.${reason}`, {username: name,});}@@ -987,7 +987,7 @@ export default class ComposerService extends Service {this.appEvents.trigger("composer-messages:create", {extraClass: "custom-body",templateName: "education",- body: I18n.t("composer.here_mention", {+ body: i18n("composer.here_mention", {here: this.siteSettings.here_mention,count,}),@@ -1068,7 +1068,7 @@ export default class ComposerService extends Service {"seconds");const timeLeft = moment().diff(canPostAt, "seconds");- const message = I18n.t("composer.slow_mode.error", {+ const message = i18n("composer.slow_mode.error", {timeLeft: durationTextFromSeconds(timeLeft),});@@ -1133,7 +1133,7 @@ export default class ComposerService extends Service {(this.isStaffUser || !currentTopic.closed)) {this.dialog.alert({- title: I18n.t("composer.posting_not_on_topic"),+ title: i18n("composer.posting_not_on_topic"),buttons: [{label: topicLabelContent(originalTopic),@@ -1149,7 +1149,7 @@ export default class ComposerService extends Service {},},{- label: I18n.t("composer.cancel"),+ label: i18n("composer.cancel"),class: "btn-flat btn-text btn-reply-where__cancel",},],@@ -1641,10 +1641,10 @@ export default class ComposerService extends Service {return new Promise((resolve) => {this.dialog.alert({- message: I18n.t("drafts.abandon.confirm"),+ message: i18n("drafts.abandon.confirm"),buttons: [{- label: I18n.t("drafts.abandon.yes_value"),+ label: i18n("drafts.abandon.yes_value"),class: "btn-danger",icon: "trash-can",action: () => {@@ -1655,7 +1655,7 @@ export default class ComposerService extends Service {},},{- label: I18n.t("drafts.abandon.no_value"),+ label: i18n("drafts.abandon.no_value"),class: "btn-resume-editing",action: () => resolve(data),},@@ -1793,7 +1793,7 @@ export default class ComposerService extends Service {if (!this.siteSettings.allow_uncategorized_topics && !categoryId) {return EmberObject.create({failed: true,- reason: I18n.t("composer.error.category_missing"),+ reason: i18n("composer.error.category_missing"),lastShownAt: lastValidatedAt,});}@@ -1807,7 +1807,7 @@ export default class ComposerService extends Service {if (category.minimumRequiredTags > tagsArray.length) {return EmberObject.create({failed: true,- reason: I18n.t("composer.error.tags_missing", {+ reason: i18n("composer.error.tags_missing", {count: category.minimumRequiredTags,}),lastShownAt: lastValidatedAt,diff --git a/app/assets/javascripts/discourse/app/services/deprecation-warning-handler.js b/app/assets/javascripts/discourse/app/services/deprecation-warning-handler.jsindex e6817452976..d9c494d1496 100644--- a/app/assets/javascripts/discourse/app/services/deprecation-warning-handler.js+++ b/app/assets/javascripts/discourse/app/services/deprecation-warning-handler.js@@ -6,7 +6,7 @@ import { escapeExpression } from "discourse/lib/utilities";import DEPRECATION_WORKFLOW from "discourse-common/deprecation-workflow";import { registerDeprecationHandler as registerDiscourseDeprecationHandler } from "discourse-common/lib/deprecated";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Deprecations matching patterns on this list will trigger warnings for admins.// To avoid 'crying wolf', we should only add values here when we're sure they're@@ -95,15 +95,15 @@ export default class DeprecationWarningHandler extends Service {notifyAdmin({ id, url }, source) {this.#adminWarned = true;- let notice = I18n.t("critical_deprecation.notice") + " ";+ let notice = i18n("critical_deprecation.notice") + " ";if (url) {- notice += I18n.t("critical_deprecation.linked_id", {+ notice += i18n("critical_deprecation.linked_id", {id: escapeExpression(id),url: escapeExpression(url),});} else {- notice += I18n.t("critical_deprecation.id", {+ notice += i18n("critical_deprecation.id", {id: escapeExpression(id),});}@@ -115,14 +115,14 @@ export default class DeprecationWarningHandler extends Service {if (source?.type === "theme") {notice +=" " +- I18n.t("critical_deprecation.theme_source", {+ i18n("critical_deprecation.theme_source", {name: escapeExpression(source.name),path: source.path,});} else if (source?.type === "plugin") {notice +=" " +- I18n.t("critical_deprecation.plugin_source", {+ i18n("critical_deprecation.plugin_source", {name: escapeExpression(source.name),});}diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.jsindex d366d5dbafc..87a8162acf7 100644--- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.js+++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.js@@ -8,7 +8,7 @@ import DropTarget from "@uppy/drop-target";import XHRUpload from "@uppy/xhr-upload";import getUrl from "discourse-common/lib/get-url";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import imagePreviews from "./image-previews";@classNames("wizard-container__image-upload")@@ -54,7 +54,7 @@ export default class Image extends Component {});this._uppyInstance.on("upload-error", (file, error, response) => {- let message = I18n.t("wizard.upload_error");+ let message = i18n("wizard.upload_error");if (response.body.errors) {message = response.body.errors.join("\n");}diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.js b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.jsindex 0de1ba77a31..e0b80cf57ad 100644--- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.js+++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import { observes } from "@ember-decorators/object";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { chooseDarker, darkLightDiff } from "../../../lib/preview";import HomepagePreview from "./-homepage-preview";import PreviewBaseComponent from "./-preview-base";@@ -139,7 +139,7 @@ export default class Index extends PreviewBaseComponent {ctx.beginPath();ctx.fillStyle = colors.primary;ctx.font = `bold ${titleFontSize}em '${headingFont}'`;- ctx.fillText(I18n.t("wizard.previews.topic_title"), margin, height * 0.3);+ ctx.fillText(i18n("wizard.previews.topic_title"), margin, height * 0.3);const bodyFontSize = height / 330.0;ctx.font = `${bodyFontSize}em '${font}'`;@@ -152,7 +152,7 @@ export default class Index extends PreviewBaseComponent {}// Share Button- const shareButtonWidth = I18n.t("wizard.previews.share_button").length * 11;+ const shareButtonWidth = i18n("wizard.previews.share_button").length * 11;ctx.beginPath();ctx.rect(margin, line + lineHeight, shareButtonWidth, height * 0.1);@@ -163,13 +163,13 @@ export default class Index extends PreviewBaseComponent {ctx.fillStyle = chooseDarker(colors.primary, colors.secondary);ctx.font = `${bodyFontSize}em '${font}'`;ctx.fillText(- I18n.t("wizard.previews.share_button"),+ i18n("wizard.previews.share_button"),margin + 10,line + lineHeight * 1.9);// Reply Button- const replyButtonWidth = I18n.t("wizard.previews.reply_button").length * 11;+ const replyButtonWidth = i18n("wizard.previews.reply_button").length * 11;ctx.beginPath();ctx.rect(@@ -183,7 +183,7 @@ export default class Index extends PreviewBaseComponent {ctx.fillStyle = colors.secondary;ctx.font = `${bodyFontSize}em '${font}'`;ctx.fillText(- I18n.t("wizard.previews.reply_button"),+ i18n("wizard.previews.reply_button"),shareButtonWidth + margin + 20,line + lineHeight * 1.9);diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjsindex 90311a65288..861238a4df7 100644--- a/app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjs+++ b/app/assets/javascripts/discourse/app/static/wizard/components/wizard-step.gjs@@ -7,7 +7,7 @@ import didUpdate from "@ember/render-modifiers/modifiers/did-update";import { schedule } from "@ember/runloop";import { htmlSafe } from "@ember/template";import emoji from "discourse/helpers/emoji";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import WizardField from "./wizard-field";export default class WizardStepComponent extends Component {diff --git a/app/assets/javascripts/discourse/app/templates/activate-account.gjs b/app/assets/javascripts/discourse/app/templates/activate-account.gjsindex 11ae1d99ee3..173c21cdb15 100644--- a/app/assets/javascripts/discourse/app/templates/activate-account.gjs+++ b/app/assets/javascripts/discourse/app/templates/activate-account.gjs@@ -11,8 +11,8 @@ import hideApplicationHeaderButtons from "discourse/helpers/hide-application-heaimport hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";+import { i18n } from "discourse-i18n";export default RouteTemplate(class extends Component {diff --git a/app/assets/javascripts/discourse/app/widgets/button.js b/app/assets/javascripts/discourse/app/widgets/button.jsindex 831b0087a7f..4624e80c78d 100644--- a/app/assets/javascripts/discourse/app/widgets/button.js+++ b/app/assets/javascripts/discourse/app/widgets/button.js@@ -3,7 +3,7 @@ import { h } from "virtual-dom";import DiscourseURL from "discourse/lib/url";import { createWidget } from "discourse/widgets/widget";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const ButtonClass = {tagName: "button.widget-button.btn",@@ -35,7 +35,7 @@ export const ButtonClass = {let title = attrs.translatedTitle;if (!title && attrs.title) {- title = I18n.t(attrs.title, attrs.titleOptions);+ title = i18n(attrs.title, attrs.titleOptions);}if (title) {@@ -108,7 +108,7 @@ export const ButtonClass = {}if (attrs.label) {contents.push(- h("span.d-button-label", I18n.t(attrs.label, attrs.labelOptions))+ h("span.d-button-label", i18n(attrs.label, attrs.labelOptions)));}if (attrs.translatedLabel) {diff --git a/app/assets/javascripts/discourse/app/widgets/link.js b/app/assets/javascripts/discourse/app/widgets/link.jsindex 1d4c89fa920..3000729944e 100644--- a/app/assets/javascripts/discourse/app/widgets/link.js+++ b/app/assets/javascripts/discourse/app/widgets/link.js@@ -4,7 +4,7 @@ import DiscourseURL from "discourse/lib/url";import { createWidget } from "discourse/widgets/widget";import getURL from "discourse-common/lib/get-url";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default createWidget("link", {tagName: "a",@@ -36,7 +36,7 @@ export default createWidget("link", {const ret = {href: this.href(attrs),title: attrs.title- ? I18n.t(attrs.title, attrs.titleOptions)+ ? i18n(attrs.title, attrs.titleOptions): this.label(attrs),};if (attrs.attributes) {@@ -49,9 +49,9 @@ export default createWidget("link", {label(attrs) {if (attrs.labelCount && attrs.count) {- return I18n.t(attrs.labelCount, { count: attrs.count });+ return i18n(attrs.labelCount, { count: attrs.count });}- return attrs.rawLabel || (attrs.label ? I18n.t(attrs.label) : "");+ return attrs.rawLabel || (attrs.label ? i18n(attrs.label) : "");},html(attrs) {@@ -64,7 +64,7 @@ export default createWidget("link", {if (attrs["aria-label"]) {let icon = iconNode(attrs.icon);- icon.properties.attributes["aria-label"] = I18n.t(+ icon.properties.attributes["aria-label"] = i18n(attrs["aria-label"],attrs.ariaLabelOptions);@@ -92,7 +92,7 @@ export default createWidget("link", {if (currentUser && attrs.badgeCount) {const val = parseInt(currentUser.get(attrs.badgeCount), 10);if (val > 0) {- const title = attrs.badgeTitle ? I18n.t(attrs.badgeTitle) : "";+ const title = attrs.badgeTitle ? i18n(attrs.badgeTitle) : "";result.push(" ");result.push(h(diff --git a/app/assets/javascripts/discourse/app/widgets/post-cooked.js b/app/assets/javascripts/discourse/app/widgets/post-cooked.jsindex fde295c8347..e4cdb7d0a70 100644--- a/app/assets/javascripts/discourse/app/widgets/post-cooked.js+++ b/app/assets/javascripts/discourse/app/widgets/post-cooked.js@@ -13,7 +13,7 @@ import escape from "discourse-common/lib/escape";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import getURL from "discourse-common/lib/get-url";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _beforeAdoptDecorators = [];let _afterAdoptDecorators = [];@@ -162,7 +162,7 @@ export default class PostCooked {bestElements.get(onebox) === link) {link.setAttribute("data-clicks", number(lc.clicks));- const ariaLabel = `${link.textContent.trim()} ${I18n.t(+ const ariaLabel = `${link.textContent.trim()} ${i18n("post.link_clicked",{count: lc.clicks,@@ -255,7 +255,7 @@ export default class PostCooked {}_updateQuoteElements(aside, desc) {- const quoteTitle = I18n.t("post.follow_quote");+ const quoteTitle = i18n("post.follow_quote");const postNumber = aside.dataset.post;const topicNumber = aside.dataset.topic;@@ -365,7 +365,7 @@ export default class PostCooked {this.ignoredUsers?.includes?.(this.attrs.username)) {cookedDiv.classList.add("post-ignored");- cookedDiv.innerHTML = I18n.t("post.ignored");+ cookedDiv.innerHTML = i18n("post.ignored");} else {cookedDiv.innerHTML = this.attrs.cooked;}diff --git a/app/assets/javascripts/discourse/app/widgets/post-edits-indicator.js b/app/assets/javascripts/discourse/app/widgets/post-edits-indicator.jsindex 30d221faa15..b50ded2ba11 100644--- a/app/assets/javascripts/discourse/app/widgets/post-edits-indicator.js+++ b/app/assets/javascripts/discourse/app/widgets/post-edits-indicator.js@@ -1,6 +1,6 @@import { longDate } from "discourse/lib/formatter";import { createWidget } from "discourse/widgets/widget";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function mult(val) {return 60 * 50 * 1000 * val;@@ -43,12 +43,12 @@ export default createWidget("post-edits-indicator", {className = `${className || ""} wiki`.trim();if (attrs.version > 1) {- title = I18n.t("post.wiki_last_edited_on", { dateTime: date });+ title = i18n("post.wiki_last_edited_on", { dateTime: date });} else {- title = I18n.t("post.wiki.about");+ title = i18n("post.wiki.about");}} else {- title = I18n.t("post.last_edited_on", { dateTime: date });+ title = i18n("post.last_edited_on", { dateTime: date });}return this.attach("flat-button", {@@ -56,7 +56,7 @@ export default createWidget("post-edits-indicator", {translatedTitle: title,className,action: "onPostEditsIndicatorClick",- translatedAriaLabel: I18n.t("post.edit_history"),+ translatedAriaLabel: i18n("post.edit_history"),translatedLabel: attrs.version > 1 ? attrs.version - 1 : "",});},diff --git a/app/assets/javascripts/discourse/app/widgets/post-gap.js b/app/assets/javascripts/discourse/app/widgets/post-gap.jsindex c8d74417215..1e3a6ade96e 100644--- a/app/assets/javascripts/discourse/app/widgets/post-gap.js+++ b/app/assets/javascripts/discourse/app/widgets/post-gap.js@@ -1,5 +1,5 @@import { createWidget } from "discourse/widgets/widget";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default createWidget("post-gap", {tagName: "div.gap",@@ -11,8 +11,8 @@ export default createWidget("post-gap", {html(attrs, state) {return state.loading- ? I18n.t("loading")- : I18n.t("post.gap", { count: attrs.gap.length });+ ? i18n("loading")+ : i18n("post.gap", { count: attrs.gap.length });},click() {diff --git a/app/assets/javascripts/discourse/app/widgets/post-menu.js b/app/assets/javascripts/discourse/app/widgets/post-menu.jsindex 3909853a06d..dc662c020e6 100644--- a/app/assets/javascripts/discourse/app/widgets/post-menu.js+++ b/app/assets/javascripts/discourse/app/widgets/post-menu.js@@ -16,7 +16,7 @@ import RenderGlimmer, {} from "discourse/widgets/render-glimmer";import { applyDecorators, createWidget } from "discourse/widgets/widget";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const LIKE_ACTION = 2;const VIBRATE_DURATION = 5;@@ -110,7 +110,7 @@ registerButton("read-count", (attrs, state) => {contents: count,iconRight: true,addContainer: false,- translatedAriaLabel: I18n.t("post.sr_post_read_count_button", {+ translatedAriaLabel: i18n("post.sr_post_read_count_button", {count,}),ariaPressed,@@ -161,7 +161,7 @@ function likeCount(attrs, state) {iconRight: true,addContainer,titleOptions: { count: attrs.liked ? count - 1 : count },- translatedAriaLabel: I18n.t("post.sr_post_like_count_button", { count }),+ translatedAriaLabel: i18n("post.sr_post_like_count_button", { count }),ariaPressed,};}@@ -258,7 +258,7 @@ registerButton("reply-small", (attrs) => {title: "post.controls.reply",icon: "reply",className: "reply",- translatedAriaLabel: I18n.t("post.sr_reply_to", {+ translatedAriaLabel: i18n("post.sr_reply_to", {post_number: attrs.post_number,username: attrs.username,}),@@ -328,7 +328,7 @@ registerButton("replies", (attrs, state, siteSettings) => {label: attrs.mobileView ? "post.has_replies_count" : "post.has_replies",iconRight: !siteSettings.enable_filtered_replies_view || attrs.mobileView,disabled: !!attrs.deleted,- translatedAriaLabel: I18n.t("post.sr_expand_replies", { count }),+ translatedAriaLabel: i18n("post.sr_expand_replies", { count }),ariaExpanded,ariaPressed,ariaControls: `embedded-posts__bottom--${attrs.post_number}`,@@ -360,7 +360,7 @@ registerButton("reply", (attrs, state, siteSettings, postMenuSettings) => {title: "post.controls.reply",icon: "reply",className: "reply create fade-out",- translatedAriaLabel: I18n.t("post.sr_reply_to", {+ translatedAriaLabel: i18n("post.sr_reply_to", {post_number: attrs.post_number,username: attrs.username,}),@@ -786,7 +786,7 @@ export default createWidget("post-menu", {listClassName: "who-read",description,count,- ariaLabel: I18n.t(+ ariaLabel: i18n("post.actions.people.sr_post_readers_list_description"),})@@ -808,7 +808,7 @@ export default createWidget("post-menu", {listClassName: "who-liked",description,count,- ariaLabel: I18n.t(+ ariaLabel: i18n("post.actions.people.sr_post_likers_list_description"),})diff --git a/app/assets/javascripts/discourse/app/widgets/post-small-action.js b/app/assets/javascripts/discourse/app/widgets/post-small-action.jsindex 3c6788ec35e..2beca250dd1 100644--- a/app/assets/javascripts/discourse/app/widgets/post-small-action.js+++ b/app/assets/javascripts/discourse/app/widgets/post-small-action.js@@ -9,7 +9,7 @@ import PostCooked from "discourse/widgets/post-cooked";import RawHtml from "discourse/widgets/raw-html";import { createWidget } from "discourse/widgets/widget";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export function actionDescriptionHtml(actionCode, createdAt, username, path) {const dt = new Date(createdAt);@@ -25,7 +25,7 @@ export function actionDescriptionHtml(actionCode, createdAt, username, path) {who = `<a class="mention" href="${userPath(username)}">@${username}</a>`;}}- return htmlSafe(I18n.t(`action_codes.${actionCode}`, { who, when, path }));+ return htmlSafe(i18n(`action_codes.${actionCode}`, { who, when, path }));}export function actionDescription(@@ -99,7 +99,7 @@ export default createWidget("post-small-action", {buildAttributes(attrs) {return {- "aria-label": I18n.t("share.post", {+ "aria-label": i18n("share.post", {postNumber: attrs.post_number,username: attrs.username,}),diff --git a/app/assets/javascripts/discourse/app/widgets/post-stream.js b/app/assets/javascripts/discourse/app/widgets/post-stream.jsindex b6d72280b63..062db8006f6 100644--- a/app/assets/javascripts/discourse/app/widgets/post-stream.js+++ b/app/assets/javascripts/discourse/app/widgets/post-stream.js@@ -10,7 +10,7 @@ import RenderGlimmer from "discourse/widgets/render-glimmer";import { createWidget } from "discourse/widgets/widget";import discourseDebounce from "discourse-common/lib/debounce";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let transformCallbacks = null;@@ -85,7 +85,7 @@ createWidget("posts-filtered-notice", {return [h("span.filtered-replies-viewing",- I18n.t("post.filtered_replies.viewing_subset")+ i18n("post.filtered_replies.viewing_subset")),this.attach("filter-show-all", attrs),];@@ -98,7 +98,7 @@ createWidget("posts-filtered-notice", {return [h("span.filtered-replies-viewing",- I18n.t("post.filtered_replies_viewing", {+ i18n("post.filtered_replies_viewing", {count: sourcePost.reply_count,})),@@ -122,7 +122,7 @@ createWidget("posts-filtered-notice", {return [h("span.filtered-replies-viewing",- I18n.t("post.filtered_replies.viewing_summary")+ i18n("post.filtered_replies.viewing_summary")),this.attach("filter-show-all", attrs),];@@ -132,7 +132,7 @@ createWidget("posts-filtered-notice", {return [h("span.filtered-replies-viewing",- I18n.t("post.filtered_replies.viewing_posts_by", {+ i18n("post.filtered_replies.viewing_posts_by", {post_count: userPostsCount,})),@@ -158,7 +158,7 @@ createWidget("filter-jump-to-post", {buildKey: (attrs) => `jump-to-post-${attrs.id}`,html(attrs) {- return I18n.t("post.filtered_replies.post_number", {+ return i18n("post.filtered_replies.post_number", {username: attrs.username,post_number: attrs.postNumber,});@@ -178,7 +178,7 @@ createWidget("filter-show-all", {},html() {- return [iconNode("up-down"), I18n.t("post.filtered_replies.show_all")];+ return [iconNode("up-down"), i18n("post.filtered_replies.show_all")];},click() {diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.jsindex 988175d6fd2..ddb819d2ca1 100644--- a/app/assets/javascripts/discourse/app/widgets/post.js+++ b/app/assets/javascripts/discourse/app/widgets/post.js@@ -31,7 +31,7 @@ import getURL, {getURLWithCDN,} from "discourse-common/lib/get-url";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function transformWithCallbacks(post, topicUrl, store) {let transformed = transformBasicPost(post);@@ -72,7 +72,7 @@ export function avatarImg(wanted, attrs) {let alt = "";if (attrs.alt) {- alt = I18n.t(attrs.alt);+ alt = i18n(attrs.alt);}let className =@@ -105,7 +105,7 @@ export function avatarFor(wanted, attrs, linkAttrs) {// making them redundant for screen readers// so we hide the avatar from screen readers by defaultif (attrs.ariaHidden === false) {- attributes["aria-label"] = I18n.t("user.profile_possessive", {+ attributes["aria-label"] = i18n("user.profile_possessive", {username: attrs.username,});} else {@@ -284,7 +284,7 @@ createWidget("post-avatar", {createWidget("post-locked-indicator", {tagName: "div.post-info.post-locked",template: widgetHbs`{{d-icon "lock"}}`,- title: () => I18n.t("post.locked"),+ title: () => i18n("post.locked"),});createWidget("post-email-indicator", {@@ -292,8 +292,8 @@ createWidget("post-email-indicator", {title(attrs) {return attrs.isAutoGenerated- ? I18n.t("post.via_auto_generated_email")- : I18n.t("post.via_email");+ ? i18n("post.via_auto_generated_email")+ : i18n("post.via_email");},buildClasses(attrs) {@@ -342,11 +342,11 @@ createWidget("post-meta-data", {let title = "";if (groups?.length > 0) {- title = I18n.t("post.whisper_groups", {+ title = i18n("post.whisper_groups", {groupNames: groups.join(", "),});} else {- title = I18n.t("post.whisper");+ title = i18n("post.whisper");}postInfo.push(@@ -388,7 +388,7 @@ createWidget("post-meta-data", {{className: attrs.read ? "read" : null,attributes: {- title: I18n.t("post.unread"),+ title: i18n("post.unread"),},},iconNode("circle")@@ -409,7 +409,7 @@ createWidget("expand-hidden", {tagName: "a.expand-hidden",html() {- return I18n.t("post.show_hidden");+ return i18n("post.show_hidden");},click() {@@ -461,9 +461,9 @@ createWidget("expand-post-button", {html(attrs, state) {if (state.loadingExpanded) {- return I18n.t("loading");+ return i18n("loading");} else {- return [I18n.t("post.show_full"), "..."];+ return [i18n("post.show_full"), "..."];}},@@ -485,7 +485,7 @@ createWidget("post-group-request", {"/g/" + attrs.requestedGroupName + "/requests?filter=" + attrs.username);- return h("a", { attributes: { href } }, I18n.t("groups.requests.handle"));+ return h("a", { attributes: { href } }, i18n("groups.requests.handle"));},});@@ -646,7 +646,7 @@ createWidget("post-contents", {model: p.asPost,state: {role: "region",- "aria-label": I18n.t("post.sr_embedded_reply_description", {+ "aria-label": i18n("post.sr_embedded_reply_description", {post_number: attrs.post_number,username: p.username,}),@@ -662,7 +662,7 @@ createWidget("post-contents", {action: "toggleRepliesBelow",actionParam: true,className: "btn collapse-up",- translatedAriaLabel: I18n.t("post.sr_collapse_replies"),+ translatedAriaLabel: i18n("post.sr_collapse_replies"),}));@@ -828,7 +828,7 @@ createWidget("post-notice", {if (attrs.notice.type === "new_user") {return [iconNode("handshake-angle"),- h("p", I18n.t("post.notice.new_user", { user })),+ h("p", i18n("post.notice.new_user", { user })),];}@@ -837,7 +837,7 @@ createWidget("post-notice", {const time = relativeAgeMediumSpan(timeAgo, true);return [iconNode("far-face-smile"),- h("p", I18n.t("post.notice.returning_user", { user, time })),+ h("p", i18n("post.notice.returning_user", { user, time })),];}},@@ -888,7 +888,7 @@ createWidget("post-article", {buildAttributes(attrs) {return {- "aria-label": I18n.t("share.post", {+ "aria-label": i18n("share.post", {postNumber: attrs.post_number,username: attrs.username,}),@@ -1157,7 +1157,7 @@ export default createWidget("post", {const { remaining, max } = result;const threshold = Math.ceil(max * 0.1);if (remaining === threshold) {- this.dialog.alert(I18n.t("post.few_likes_left"));+ this.dialog.alert(i18n("post.few_likes_left"));kvs.set({ key: "lastWarnedLikes", value: Date.now() });}},diff --git a/app/assets/javascripts/discourse/app/widgets/poster-name.js b/app/assets/javascripts/discourse/app/widgets/poster-name.jsindex 640a6353f76..b3ed5346963 100644--- a/app/assets/javascripts/discourse/app/widgets/poster-name.js+++ b/app/assets/javascripts/discourse/app/widgets/poster-name.js@@ -4,7 +4,7 @@ import { formatUsername } from "discourse/lib/utilities";import { applyDecorators, createWidget } from "discourse/widgets/widget";import getURL from "discourse-common/lib/get-url";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let sanitizeName = function (name) {return name.toLowerCase().replace(/[\s\._-]/g, "");@@ -77,7 +77,7 @@ export default createWidget("poster-name", {posterGlyph(attrs) {if (attrs.moderator || attrs.groupModerator) {return iconNode("shield-halved", {- title: I18n.t("user.moderator_tooltip"),+ title: i18n("user.moderator_tooltip"),});}},diff --git a/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js b/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.jsindex 152099d9c89..5011b23855f 100644--- a/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js+++ b/app/assets/javascripts/discourse/app/widgets/topic-post-visited-line.js@@ -1,6 +1,6 @@import { h } from "virtual-dom";import { createWidget } from "discourse/widgets/widget";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default createWidget("topic-post-visited-line", {tagName: "div.small-action.topic-post-visited",@@ -8,7 +8,7 @@ export default createWidget("topic-post-visited-line", {html(attrs) {return h(`div.topic-post-visited-line.post-${attrs.post_number}}`,- h("span.topic-post-visited-message", I18n.t("topics.new_messages_marker"))+ h("span.topic-post-visited-message", i18n("topics.new_messages_marker")));},});diff --git a/app/assets/javascripts/discourse/app/widgets/topic-status.js b/app/assets/javascripts/discourse/app/widgets/topic-status.jsindex 3db9429434b..d16de816b97 100644--- a/app/assets/javascripts/discourse/app/widgets/topic-status.js+++ b/app/assets/javascripts/discourse/app/widgets/topic-status.js@@ -3,7 +3,7 @@ import TopicStatusIcons from "discourse/helpers/topic-status-icons";import { escapeExpression } from "discourse/lib/utilities";import { createWidget } from "discourse/widgets/widget";import { iconNode } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default createWidget("topic-status", {tagName: "span.topic-statuses",@@ -19,7 +19,7 @@ export default createWidget("topic-status", {const icon = iconNode(name, iconArgs);const attributes = {- title: escapeExpression(I18n.t(`topic_statuses.${key}.help`)),+ title: escapeExpression(i18n(`topic_statuses.${key}.help`)),};let klass = "topic-status";if (key === "unpinned" || key === "pinned") {diff --git a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.jsindex ce0c0c4d5ab..8c1d36fbf5f 100644--- a/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js+++ b/app/assets/javascripts/discourse/app/widgets/widget-dropdown.js@@ -2,7 +2,7 @@ import { schedule } from "@ember/runloop";import { createPopper } from "@popperjs/core";import hbs from "discourse/widgets/hbs-compiler";import { createWidget } from "discourse/widgets/widget";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";/*@@ -93,7 +93,7 @@ export const WidgetDropdownHeaderClass = {`,_buildLabel(attrs) {- return attrs.translatedLabel ? attrs.translatedLabel : I18n.t(attrs.label);+ return attrs.translatedLabel ? attrs.translatedLabel : i18n(attrs.label);},};@@ -111,7 +111,7 @@ export const WidgetDropdownItemClass = {? attrs.item.html: attrs.item.translatedLabel? attrs.item.translatedLabel- : I18n.t(attrs.item.label),+ : i18n(attrs.item.label),};},diff --git a/app/assets/javascripts/discourse/app/widgets/widget.js b/app/assets/javascripts/discourse/app/widgets/widget.jsindex 84ae9858a13..941891d9c92 100644--- a/app/assets/javascripts/discourse/app/widgets/widget.js+++ b/app/assets/javascripts/discourse/app/widgets/widget.js@@ -26,7 +26,7 @@ import {} from "discourse/widgets/hooks";import { isProduction } from "discourse-common/config/environment";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const _registry = {};@@ -508,7 +508,7 @@ export default class Widget {if (typeof this.title === "function") {attributes.title = this.title(attrs, state);} else {- attributes.title = I18n.t(this.title);+ attributes.title = i18n(this.title);}}diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-badges-award-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-badges-award-test.jsindex 464d8e09b6e..18bae12f2f6 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-badges-award-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-badges-award-test.js@@ -1,7 +1,7 @@import { click, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Admin - Badges - Mass Award", function (needs) {needs.user();@@ -12,7 +12,7 @@ acceptance("Admin - Badges - Mass Award", function (needs) {);assert.strictEqual(query("label.grant-existing-holders").textContent.trim(),- I18n.t("admin.badges.mass_award.grant_existing_holders"),+ i18n("admin.badges.mass_award.grant_existing_holders"),"checkbox for granting existing holders is displayed");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-install-theme-modal-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-install-theme-modal-test.jsindex 87c3bde3dce..d84f3c1f59b 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-install-theme-modal-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-install-theme-modal-test.js@@ -1,7 +1,7 @@import { click, currentURL, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Admin - Themes - Install modal", function (needs) {needs.user();@@ -106,7 +106,7 @@ acceptance("Admin - Themes - Install modal", function (needs) {query('.popular-theme-item[data-name="Graceful"] .popular-theme-buttons').textContent.trim(),- I18n.t("admin.customize.theme.installed")+ i18n("admin.customize.theme.installed"));assert.ok(diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-penalize-user-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-penalize-user-test.jsindex 33551319324..e0ddd011c39 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-penalize-user-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-penalize-user-test.js@@ -8,7 +8,7 @@ import {queryAll,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Admin - Suspend User", function (needs) {needs.user();@@ -124,19 +124,19 @@ acceptance("Admin - Suspend User - timeframe choosing", function (needs) {).map((el) => el.innerText.trim());const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.later_this_week"),- I18n.t("time_shortcut.start_of_next_business_week_alt"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.two_months"),- I18n.t("time_shortcut.three_months"),- I18n.t("time_shortcut.four_months"),- I18n.t("time_shortcut.six_months"),- I18n.t("time_shortcut.one_year"),- I18n.t("time_shortcut.forever"),- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.later_this_week"),+ i18n("time_shortcut.start_of_next_business_week_alt"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.two_months"),+ i18n("time_shortcut.three_months"),+ i18n("time_shortcut.four_months"),+ i18n("time_shortcut.six_months"),+ i18n("time_shortcut.one_year"),+ i18n("time_shortcut.forever"),+ i18n("time_shortcut.custom"),];assert.deepEqual(options, expected, "options are correct");@@ -168,19 +168,19 @@ acceptance("Admin - Silence User", function (needs) {);const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.later_this_week"),- I18n.t("time_shortcut.start_of_next_business_week_alt"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.two_months"),- I18n.t("time_shortcut.three_months"),- I18n.t("time_shortcut.four_months"),- I18n.t("time_shortcut.six_months"),- I18n.t("time_shortcut.one_year"),- I18n.t("time_shortcut.forever"),- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.later_this_week"),+ i18n("time_shortcut.start_of_next_business_week_alt"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.two_months"),+ i18n("time_shortcut.three_months"),+ i18n("time_shortcut.four_months"),+ i18n("time_shortcut.six_months"),+ i18n("time_shortcut.one_year"),+ i18n("time_shortcut.forever"),+ i18n("time_shortcut.custom"),];assert.deepEqual(options, expected, "options are correct");diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-user-emails-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-user-emails-test.jsindex 00930f82ca5..7358c04b4a8 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-user-emails-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-user-emails-test.js@@ -1,7 +1,7 @@import { click, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function assertNoSecondary(assert) {assert.strictEqual(@@ -12,7 +12,7 @@ function assertNoSecondary(assert) {assert.strictEqual(query(".display-row.secondary-emails .value").innerText.trim(),- I18n.t("user.email.no_secondary"),+ i18n("user.email.no_secondary"),"it should not display secondary emails");}diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-user-index-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-user-index-test.jsindex 20e77426647..c1d9383fe99 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-user-index-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-user-index-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const { TOTP, BACKUP_CODE, SECURITY_KEY } = SECOND_FACTOR_METHODS;let deleteAndBlock = null;@@ -250,7 +250,7 @@ acceptance("Admin - User Index", function (needs) {await click(".grant-admin");assert.dom(".dialog-content").exists();assert.strictEqual(- I18n.t("admin.user.grant_admin_confirm"),+ i18n("admin.user.grant_admin_confirm"),query(".dialog-body").textContent.trim());@@ -282,7 +282,7 @@ acceptance("Admin - User Index", function (needs) {await click(".disable-second-factor");assert.dom(".dialog-content").exists();assert.strictEqual(- I18n.t("admin.user.disable_second_factor_confirm"),+ i18n("admin.user.disable_second_factor_confirm"),query(".dialog-body").textContent.trim());@@ -295,7 +295,7 @@ acceptance("Admin - User Index", function (needs) {assert.equal(query("#dialog-title").textContent,- I18n.t("admin.user.delete_confirm_title"),+ i18n("admin.user.delete_confirm_title"),"dialog has a title");diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-users-list-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-users-list-test.jsindex 57083ad7920..d41cca1c6dd 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-users-list-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-users-list-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Admin - Users List", function (needs) {needs.user();@@ -20,7 +20,7 @@ acceptance("Admin - Users List", function (needs) {await fillIn(".controls.username input", "doesntexist");- assert.dom(".users-list-container").hasText(I18n.t("search.no_results"));+ assert.dom(".users-list-container").hasText(i18n("search.no_results"));});test("sorts users", async function (assert) {@@ -71,8 +71,8 @@ acceptance("Admin - Users List", function (needs) {test("switching tabs", async function (assert) {const activeUser = "eviltrout";const suspectUser = "sam";- const activeTitle = I18n.t("admin.users.titles.active");- const suspectTitle = I18n.t("admin.users.titles.new");+ const activeTitle = i18n("admin.users.titles.active");+ const suspectTitle = i18n("admin.users.titles.new");await visit("/admin/users/list/active");diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.jsindex 6c17c7f69bb..a912a346364 100644--- a/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-watched-words-test.js@@ -5,7 +5,7 @@ import {query,queryAll,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Admin - Watched Words", function (needs) {needs.user();@@ -103,7 +103,7 @@ acceptance("Admin - Watched Words", function (needs) {.hasText("Discourse");assert.dom(".watched-words-list .watched-word .case-sensitive")- .hasText(I18n.t("admin.watched_words.case_sensitive"));+ .hasText(i18n("admin.watched_words.case_sensitive"));await click(".select-kit-header.multi-select-header");await fillIn(".select-kit-filter input", "discourse");@@ -116,7 +116,7 @@ acceptance("Admin - Watched Words", function (needs) {.hasText("discourse");assert.dom(".watched-words-list .watched-word .case-sensitive")- .hasText(I18n.t("admin.watched_words.case_sensitive"));+ .hasText(i18n("admin.watched_words.case_sensitive"));});test("remove words", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/acceptance/category-edit-security-test.js b/app/assets/javascripts/discourse/tests/acceptance/category-edit-security-test.jsindex 0ce78999d29..73e171abeee 100644--- a/app/assets/javascripts/discourse/tests/acceptance/category-edit-security-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/category-edit-security-test.js@@ -6,7 +6,7 @@ import {queryAll,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Category Edit - Security", function (needs) {needs.user();@@ -42,7 +42,7 @@ acceptance("Category Edit - Security", function (needs) {assert.dom(".row-empty").hasText(- I18n.t("category.permissions.no_groups_selected"),+ i18n("category.permissions.no_groups_selected"),"shows message when no groups are selected");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/category-edit-test.js b/app/assets/javascripts/discourse/tests/acceptance/category-edit-test.jsindex 895ae5bf49a..659df571f03 100644--- a/app/assets/javascripts/discourse/tests/acceptance/category-edit-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/category-edit-test.js@@ -5,7 +5,7 @@ import DiscourseURL from "discourse/lib/url";import pretender from "discourse/tests/helpers/create-pretender";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Category Edit", function (needs) {needs.user();@@ -186,7 +186,7 @@ acceptance("Category Edit", function (needs) {assert.strictEqual(query(".dialog-body").textContent.trim(),- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: "duplicate email",}));@@ -206,7 +206,7 @@ acceptance("Category Edit", function (needs) {assert.strictEqual(query(".dialog-body").textContent.trim(),- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error: "subcategory nested under another subcategory",}));diff --git a/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js b/app/assets/javascripts/discourse/tests/acceptance/category-new-test.jsindex 01d7e923497..43217dd2576 100644--- a/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/category-new-test.js@@ -4,7 +4,7 @@ import sinon from "sinon";import DiscourseURL from "discourse/lib/url";import { acceptance } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("New category access for moderators", function (needs) {needs.user({ moderator: true, admin: false, trust_level: 1 });@@ -74,7 +74,7 @@ acceptance("Category New", function (needs) {.exists("shows saved required tag group");assert.dom(".edit-category-title h2").hasText(- I18n.t("category.edit_dialog_title", {+ i18n("category.edit_dialog_title", {categoryName: "testing",}));diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.jsindex 32ab9434718..2b3ee3531c1 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-actions-test.js@@ -12,7 +12,7 @@ import {} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Composer Actions", function (needs) {needs.user({@@ -127,7 +127,7 @@ acceptance("Composer Actions", function (needs) {await composerActions.selectRowByValue("reply_as_new_topic");assert.strictEqual(categoryChooserReplyArea.header().name(), "faq");- assert.dom(".action-title").hasText(I18n.t("topic.create_long"));+ assert.dom(".action-title").hasText(i18n("topic.create_long"));assert.ok(query(".d-editor-input").value.includes(quote));});@@ -210,7 +210,7 @@ acceptance("Composer Actions", function (needs) {await composerActions.selectRowByValue("reply_as_new_topic");await composerActions.expand();- assert.dom(".action-title").hasText(I18n.t("topic.create_long"));+ assert.dom(".action-title").hasText(i18n("topic.create_long"));assert.ok(query(".d-editor-input").value.includes(quote));assert.strictEqual(composerActions.rowByIndex(0).value(), "reply_to_post");assert.strictEqual(composerActions.rowByIndex(1).value(), "reply_to_topic");@@ -226,7 +226,7 @@ acceptance("Composer Actions", function (needs) {await click(".usercard-controls .compose-pm .btn-primary");await composerActions.expand();- assert.dom(".action-title").hasText(I18n.t("topic.private_message"));+ assert.dom(".action-title").hasText(i18n("topic.private_message"));assert.strictEqual(composerActions.rowByIndex(0).value(), "create_topic");assert.strictEqual(composerActions.rows().length, 1);});@@ -416,7 +416,7 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {assert.dom("#reply-control .btn-primary.create .d-button-label")- .hasText(I18n.t("composer.create_shared_draft"));+ .hasText(i18n("composer.create_shared_draft"));assert.dom(".composer-actions svg.d-icon-far-clipboard").exists("shared draft icon is visible");@@ -434,7 +434,7 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {assert.dom(".dialog-body")- .hasText(I18n.t("composer.composer_actions.reply_as_new_topic.confirm"));+ .hasText(i18n("composer.composer_actions.reply_as_new_topic.confirm"));await click(".dialog-footer .btn-primary");assert.ok(diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-draft-saving-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-draft-saving-test.jsindex 18b10e6e6fd..2ddde147ce8 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-draft-saving-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-draft-saving-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Composer - Draft saving", function (needs) {needs.user();@@ -32,7 +32,7 @@ acceptance("Composer - Draft saving", function (needs) {assert.dom("div#draft-status span").hasText(- I18n.t("composer.drafts_offline"),+ i18n("composer.drafts_offline"),"the draft wasn't saved, a warning is rendered");assertdiff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-messages-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-messages-test.jsindex b0bfee3bf69..e9c7dcc8910 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-messages-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-messages-test.js@@ -8,7 +8,7 @@ import {import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import pretender, { response } from "../helpers/create-pretender";acceptance("Composer - Messages", function (needs) {@@ -45,7 +45,7 @@ acceptance("Composer - Messages", function (needs) {assert.dom(".composer-popup").exists("shows composer warning message");assert.dom(".composer-popup").includesHtml(- I18n.t("composer.user_not_seen_in_a_while.single", {+ i18n("composer.user_not_seen_in_a_while.single", {usernames: ['<a class="mention" href="/u/charlie">@charlie</a>'],time_ago: "1 year ago",}),@@ -95,7 +95,7 @@ acceptance("Composer - Messages - Cannot see group", function (needs) {await fillIn(".d-editor-input", "Mention @staff");assert.dom(".composer-popup").exists("shows composer warning message");assert.dom(".composer-popup").includesHtml(- I18n.t("composer.cannot_see_group_mention.not_allowed", {+ i18n("composer.cannot_see_group_mention.not_allowed", {group: "staff",}),"warning message has correct body"@@ -112,7 +112,7 @@ acceptance("Composer - Messages - Cannot see group", function (needs) {await fillIn(".d-editor-input", "Mention @staff2");assert.dom(".composer-popup").exists("shows composer warning message");assert.dom(".composer-popup").includesHtml(- I18n.t("composer.cannot_see_group_mention.some_not_allowed", {+ i18n("composer.cannot_see_group_mention.some_not_allowed", {group: "staff2",count: 10,}),@@ -234,13 +234,13 @@ acceptance("Composer - Messages - Private Messages", function (needs) {assert.dom(".composer-popup").includesHtml(- I18n.t("composer.yourself_confirm.title"),+ i18n("composer.yourself_confirm.title"),"warning message has correct title");assert.dom(".composer-popup").includesHtml(- I18n.t("composer.yourself_confirm.body"),+ i18n("composer.yourself_confirm.body"),"warning message has correct body");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-tags-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-tags-test.jsindex 587d5a6b786..bd21a3ad1d3 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-tags-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-tags-test.js@@ -6,7 +6,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Composer - Tags", function (needs) {needs.user();@@ -55,7 +55,7 @@ acceptance("Composer - Tags", function (needs) {assert.dom(".popup-tip.bad").hasText(- I18n.t("composer.error.tags_missing", { count: 1 }),+ i18n("composer.error.tags_missing", { count: 1 }),"it should display the right alert");@@ -89,7 +89,7 @@ acceptance("Composer - Tags", function (needs) {assert.dom(".popup-tip.bad").hasText(- I18n.t("composer.error.tags_missing", { count: 1 }),+ i18n("composer.error.tags_missing", { count: 1 }),"it should display the right alert");diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-test.jsindex 9902f4da1c3..b7fb332ee91 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js@@ -30,7 +30,7 @@ import {} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Composer", function (needs) {needs.user({@@ -211,7 +211,7 @@ acceptance("Composer", function (needs) {await triggerKeyEvent(textarea, "keydown", "B", metaModifier);- const example = I18n.t(`composer.bold_text`);+ const example = i18n(`composer.bold_text`);assert.strictEqual(query("#reply-control .d-editor-input").value.trim(),`this is the *content* of a post**${example}**`,@@ -710,7 +710,7 @@ acceptance("Composer", function (needs) {assert.ok(query(".reply-details .unlist").innerText.includes(- I18n.t("composer.unlist")+ i18n("composer.unlist")),"it sets the topic to unlisted");@@ -764,7 +764,7 @@ acceptance("Composer", function (needs) {assert.dom(".d-modal__footer button.keep-editing").hasText(- I18n.t("post.cancel_composer.keep_editing"),+ i18n("post.cancel_composer.keep_editing"),"has keep editing button");await click(".d-modal__footer button.discard-draft");@@ -789,13 +789,13 @@ acceptance("Composer", function (needs) {assert.dom(".d-modal__footer button.save-draft").hasText(- I18n.t("post.cancel_composer.save_draft"),+ i18n("post.cancel_composer.save_draft"),"has save draft button");assert.dom(".d-modal__footer button.keep-editing").hasText(- I18n.t("post.cancel_composer.keep_editing"),+ i18n("post.cancel_composer.keep_editing"),"has keep editing button");await click(".d-modal__footer button.save-draft");@@ -814,7 +814,7 @@ acceptance("Composer", function (needs) {await click(".topic-post:nth-of-type(1) button.show-more-actions");await click(".topic-post:nth-of-type(1) button.edit");- assert.dom(".dialog-body").hasText(I18n.t("drafts.abandon.confirm"));+ assert.dom(".dialog-body").hasText(i18n("drafts.abandon.confirm"));await click(".dialog-footer .btn-resume-editing");});@@ -885,7 +885,7 @@ acceptance("Composer", function (needs) {});await visit("/latest");- assert.dom("#create-topic").hasText(I18n.t("topic.open_draft"));+ assert.dom("#create-topic").hasText(i18n("topic.open_draft"));await click("#create-topic");assert.strictEqual(selectKit(".category-chooser").header().value(), "2");@@ -906,7 +906,7 @@ acceptance("Composer", function (needs) {.dom(".d-editor-container textarea").hasAttribute("placeholder",- I18n.t("composer.reply_placeholder"),+ i18n("composer.reply_placeholder"),"it should not block because of missing category");});@@ -916,7 +916,7 @@ acceptance("Composer", function (needs) {await click("article#post_3 button.reply");assert.dom(".save-or-cancel button.create")- .hasText(I18n.t("composer.create_pm"), "reply button says Message");+ .hasText(i18n("composer.create_pm"), "reply button says Message");assert.dom(".save-or-cancel button.create svg.d-icon-envelope").exists("reply button has envelope icon");@@ -929,7 +929,7 @@ acceptance("Composer", function (needs) {assert.dom(".save-or-cancel button.create")- .hasText(I18n.t("composer.save_edit"), "save button says Save Edit");+ .hasText(i18n("composer.save_edit"), "save button says Save Edit");assert.dom(".save-or-cancel button.create svg.d-icon-pencil").exists("save button has pencil icon");@@ -1053,15 +1053,13 @@ acceptance("Composer - Customizations", function (needs) {test("Supports text customization", async function (assert) {await visit("/");await click("#create-topic");- assert.dom(".action-title").hasText(I18n.t("topic.create_long"));- assert- .dom(".save-or-cancel button")- .hasText(I18n.t("composer.create_topic"));+ assert.dom(".action-title").hasText(i18n("topic.create_long"));+ assert.dom(".save-or-cancel button").hasText(i18n("composer.create_topic"));const tags = selectKit(".mini-tag-chooser");await tags.expand();await tags.selectRowByValue("monkey");assert.dom(".action-title").hasText("custom text");- assert.dom(".save-or-cancel button").hasText(I18n.t("composer.emoji"));+ assert.dom(".save-or-cancel button").hasText(i18n("composer.emoji"));});});@@ -1375,14 +1373,14 @@ acceptance("composer buttons API", function (needs) {.dom(row).hasAttribute("title",- I18n.t("some_title") ++ i18n("some_title") +` (${translateModKey(PLATFORM_KEY_MODIFIER + "+alt+b")})`,"it shows the title with shortcut");assert.dom(row).hasText(- I18n.t("some_label") ++ i18n("some_label") +` ${translateModKey(PLATFORM_KEY_MODIFIER + "+alt+b")}`,"it shows the label with shortcut");diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.jsindex b31f8e8431b..55cf0b015bb 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js@@ -12,7 +12,7 @@ import {paste,query,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let uploadNumber = 1;@@ -196,7 +196,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {await settled();assert.strictEqual(query(".dialog-body").textContent.trim(),- I18n.t("post.errors.too_many_dragged_and_dropped_files", {+ i18n("post.errors.too_many_dragged_and_dropped_files", {count: 2,}),"it should warn about too many files added"@@ -221,7 +221,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {await settled();assert.strictEqual(query(".dialog-body").textContent.trim(),- I18n.t("post.errors.upload_not_authorized", {+ i18n("post.errors.upload_not_authorized", {authorized_extensions: authorizedExtensions(false,this.siteSettingsdiff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-test.jsindex c29a476cc62..f24b1007df9 100644--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js@@ -7,7 +7,7 @@ import pretender, {response,} from "discourse/tests/helpers/create-pretender";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Create Account", function () {test("create an account", async function (assert) {@@ -63,7 +63,7 @@ acceptance("Create Account", function () {assert.dom("#username-validation")- .hasText(I18n.t("user.username.required"), "shows signup error");+ .hasText(i18n("user.username.required"), "shows signup error");});test("can sign in using a third-party auth", async function (assert) {@@ -103,7 +103,7 @@ acceptance("Create Account - full_name_required", function (needs) {await fillIn("#new-account-password", "cool password bro");await click(".d-modal__footer .btn-primary");- assert.dom("#fullname-validation").hasText(I18n.t("user.name.required"));+ assert.dom("#fullname-validation").hasText(i18n("user.name.required"));await fillIn("#new-account-name", "Full Name");diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.jsindex 04f2c90ee6d..ff6095a81dc 100644--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js@@ -3,7 +3,7 @@ import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";import { test } from "qunit";import { withPluginApi } from "discourse/lib/plugin-api";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const CUSTOM_VALIDATION_REASON = "bad choice";@@ -61,7 +61,7 @@ acceptance("Create Account - User Fields", function (needs) {await click(".d-modal__footer .btn-primary");assert.dom("#account-email-validation")- .hasText(I18n.t("user.email.required"));+ .hasText(i18n("user.email.required"));await fillIn("#new-account-name", "Dr. Good Tuna");await fillIn("#new-account-password", "cool password bro");@@ -88,7 +88,7 @@ acceptance("Create Account - User Fields", function (needs) {assert.dom("#account-email-validation")- .hasText(I18n.t("user.email.required"), "hitting Enter triggers action");+ .hasText(i18n("user.email.required"), "hitting Enter triggers action");});test("shows validation error for user fields", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js b/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.jsindex adf9e3b5439..1e718439d53 100644--- a/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/email-notice-test.js@@ -4,7 +4,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Email Disabled Banner", function (needs) {needs.user();@@ -25,7 +25,7 @@ acceptance("Email Disabled Banner", function (needs) {.exists("alert is displayed when email disabled");assert.dom(".alert-emails-disabled .text")- .hasText(I18n.t("emails_are_disabled"), "alert uses the correct text");+ .hasText(i18n("emails_are_disabled"), "alert uses the correct text");});test("when non-staff", async function (assert) {@@ -37,7 +37,7 @@ acceptance("Email Disabled Banner", function (needs) {assert.dom(".alert-emails-disabled .text").hasText(- I18n.t("emails_are_disabled_non_staff"),+ i18n("emails_are_disabled_non_staff"),"alert uses the correct text");@@ -49,7 +49,7 @@ acceptance("Email Disabled Banner", function (needs) {assert.dom(".alert-emails-disabled .text").hasText(- I18n.t("emails_are_disabled_non_staff"),+ i18n("emails_are_disabled_non_staff"),"alert uses the correct text");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/forgot-password-test.js b/app/assets/javascripts/discourse/tests/acceptance/forgot-password-test.jsindex 1f5f81a5c21..9569cd0a73b 100644--- a/app/assets/javascripts/discourse/tests/acceptance/forgot-password-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/forgot-password-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let userFound = false;@@ -27,7 +27,7 @@ acceptance("Forgot password", function (needs) {await click(".forgot-password-reset");assert.dom(".alert-error").hasHtml(- I18n.t("forgot_password.complete_username_not_found", {+ i18n("forgot_password.complete_username_not_found", {username: "someuser",}),"displays an error for an invalid username"@@ -37,7 +37,7 @@ acceptance("Forgot password", function (needs) {await click(".forgot-password-reset");assert.dom(".alert-error").hasHtml(- I18n.t("forgot_password.complete_email_not_found", {+ i18n("forgot_password.complete_email_not_found", {email: "[email protected]",}),"displays an error for an invalid email"@@ -54,7 +54,7 @@ acceptance("Forgot password", function (needs) {.doesNotExist("it should remove the flash error when succeeding");assert.dom(".d-modal__body").hasHtml(- I18n.t("forgot_password.complete_username_found", {+ i18n("forgot_password.complete_username_found", {username: "someuser",}),"displays a success message for a valid username"@@ -67,7 +67,7 @@ acceptance("Forgot password", function (needs) {await click(".forgot-password-reset");assert.dom(".d-modal__body").hasHtml(- I18n.t("forgot_password.complete_email_found", {+ i18n("forgot_password.complete_email_found", {email: "[email protected]",}),"displays a success message for a valid email"@@ -97,7 +97,7 @@ acceptance(await click(".forgot-password-reset");assert.dom(".d-modal__body").hasHtml(- I18n.t("forgot_password.complete_username", {+ i18n("forgot_password.complete_username", {username: "someuser",}),"displays a success message"diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-index-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-index-test.jsindex 1f6ee0c47d4..7ef469ef694 100644--- a/app/assets/javascripts/discourse/tests/acceptance/group-index-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/group-index-test.js@@ -6,7 +6,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Group Members - Anonymous", function () {test("Viewing Members as anon user", async function (assert) {@@ -25,7 +25,7 @@ acceptance("Group Members - Anonymous", function () {.dom(".group-username-filter").hasAttribute("placeholder",- I18n.t("groups.members.filter_placeholder"),+ i18n("groups.members.filter_placeholder"),"it should display the right filter placeholder");});@@ -60,7 +60,7 @@ acceptance("Group Members", function (needs) {.dom(".group-username-filter").hasAttribute("placeholder",- I18n.t("groups.members.filter_placeholder_admin"),+ i18n("groups.members.filter_placeholder_admin"),"it should display the right filter placeholder");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.jsindex 1d2047f131c..b330acb94ad 100644--- a/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/group-manage-email-settings-test.js@@ -4,7 +4,7 @@ import { GROUP_SMTP_SSL_MODES } from "discourse/lib/constants";import formKit from "discourse/tests/helpers/form-kit-helper";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Managing Group Email Settings - SMTP Disabled", function (needs) {needs.user();@@ -99,8 +99,8 @@ acceptance(await formKit().submit();assert.form().hasErrors({- [I18n.t("groups.manage.email.credentials.username")]: "Required",- [I18n.t("groups.manage.email.credentials.password")]: "Required",+ [i18n("groups.manage.email.credentials.username")]: "Required",+ [i18n("groups.manage.email.credentials.password")]: "Required",},"does not allow testing settings if not all fields are filled");@@ -126,7 +126,7 @@ acceptance(await click("#enable_smtp");assert.strictEqual(query(".dialog-body").innerText.trim(),- I18n.t("groups.manage.email.smtp_disable_confirm"),+ i18n("groups.manage.email.smtp_disable_confirm"),"shows a confirm dialogue warning SMTP settings will be wiped");@@ -199,7 +199,7 @@ acceptance(await click("#enable_imap");assert.strictEqual(query(".dialog-body").innerText.trim(),- I18n.t("groups.manage.email.imap_disable_confirm"),+ i18n("groups.manage.email.imap_disable_confirm"),"shows a confirm dialogue warning IMAP settings will be wiped");await click(".dialog-footer .btn-primary");@@ -355,7 +355,7 @@ acceptance(assert.strictEqual(query(".dialog-body").innerText.trim(),- I18n.t("generic_error_with_reason", {+ i18n("generic_error_with_reason", {error:"There was an issue with the SMTP credentials provided, check the username and password and try again.",})diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-test.jsindex 2ff8878c054..341f6d7d8d6 100644--- a/app/assets/javascripts/discourse/tests/acceptance/group-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/group-test.js@@ -2,7 +2,7 @@ import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function setupGroupPretender(server, helper) {server.post("/groups/Macdonald/request_membership.json", () => {@@ -54,7 +54,7 @@ acceptance("Group - Anonymous", function (needs) {assert.strictEqual(groupDropdown.rowByIndex(0).name(),- I18n.t("groups.index.all")+ i18n("groups.index.all"));this.siteSettings.enable_group_directory = false;@@ -183,7 +183,7 @@ acceptance("Group - Authenticated", function (needs) {assert.dom(".d-modal__header .d-modal__title-text").hasText(- I18n.t("groups.membership_request.title", { group_name: "Macdonald" })+ i18n("groups.membership_request.title", { group_name: "Macdonald" }));assert.strictEqual(@@ -217,7 +217,7 @@ acceptance("Group - Authenticated", function (needs) {assert.dom("span.empty-state-title").hasText(- I18n.t("no_group_messages_title"),+ i18n("no_group_messages_title"),"it should display the right text");});@@ -260,7 +260,7 @@ acceptance("Group - Authenticated", function (needs) {assert.strictEqual(query(".dialog-body p:nth-of-type(2)").textContent.trim(),- I18n.t("admin.groups.delete_with_messages_confirm", {+ i18n("admin.groups.delete_with_messages_confirm", {count: 2,}),"it should warn about orphan messages"@@ -296,11 +296,11 @@ acceptance("Group - Authenticated", function (needs) {assert.strictEqual(memberDropdown.rowByIndex(0).name(),- I18n.t("groups.members.remove_member")+ i18n("groups.members.remove_member"));assert.strictEqual(memberDropdown.rowByIndex(1).name(),- I18n.t("groups.members.make_owner")+ i18n("groups.members.make_owner"));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/groups-new-test.js b/app/assets/javascripts/discourse/tests/acceptance/groups-new-test.jsindex 60921d6b436..1663d2e095f 100644--- a/app/assets/javascripts/discourse/tests/acceptance/groups-new-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/groups-new-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("New Group - Anonymous", function () {test("As an anon user", async function (assert) {@@ -27,7 +27,7 @@ acceptance("New Group - Authenticated", function (needs) {assert.dom(".tip.bad").hasText(- I18n.t("admin.groups.new.name.too_short"),+ i18n("admin.groups.new.name.too_short"),"it should show the right validation tooltip");@@ -41,7 +41,7 @@ acceptance("New Group - Authenticated", function (needs) {assert.dom(".tip.bad").hasText(- I18n.t("admin.groups.new.name.too_long"),+ i18n("admin.groups.new.name.too_long"),"it should show the right validation tooltip");@@ -50,7 +50,7 @@ acceptance("New Group - Authenticated", function (needs) {assert.dom(".tip.bad").hasText(- I18n.t("admin.groups.new.name.blank"),+ i18n("admin.groups.new.name.blank"),"it should show the right validation tooltip");@@ -59,7 +59,7 @@ acceptance("New Group - Authenticated", function (needs) {assert.dom(".tip.good").hasText(- I18n.t("admin.groups.new.name.available"),+ i18n("admin.groups.new.name.available"),"it should show the right validation tooltip");@@ -73,7 +73,7 @@ acceptance("New Group - Authenticated", function (needs) {query(".groups-form-default-notification-level .selected-name .name").innerText.trim(),- I18n.t("groups.notifications.watching.title"),+ i18n("groups.notifications.watching.title"),"it has a default selection for notification level");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.jsindex 52dafa35191..78ccc2b0231 100644--- a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import PreloadStore from "discourse/lib/preload-store";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function setAuthenticationData(hooks, json) {hooks.beforeEach(() => {@@ -72,7 +72,7 @@ acceptance("Invite accept", function (needs) {assert.dom(".col-form").includesText(- I18n.t("invites.social_login_available"),+ i18n("invites.social_login_available"),"shows social login hint");@@ -282,7 +282,7 @@ acceptance("Invite link with authentication data", function (needs) {assert.dom("#account-email-validation")- .hasText(I18n.t("user.email.authenticated", { provider: "Facebook" }));+ .hasText(i18n("user.email.authenticated", { provider: "Facebook" }));assert.dom("#new-account-username")@@ -311,7 +311,7 @@ acceptance("Email Invite link with authentication data", function (needs) {assert.dom("#account-email-validation").hasText(- I18n.t("user.email.invite_auth_email_invalid", { provider: "Facebook" })+ i18n("user.email.invite_auth_email_invalid", { provider: "Facebook" }));assert.dom("form").doesNotExist("does not display the form");@@ -349,7 +349,7 @@ acceptance(assert.dom("#account-email-validation")- .hasText(I18n.t("user.email.authenticated", { provider: "Facebook" }));+ .hasText(i18n("user.email.authenticated", { provider: "Facebook" }));assert.dom("#new-account-username")@@ -411,7 +411,7 @@ acceptance(assert.dom("#account-email-validation")- .hasText(I18n.t("user.email.authenticated_by_invite"));+ .hasText(i18n("user.email.authenticated_by_invite"));});});@@ -438,7 +438,7 @@ acceptance(.dom("#new-account-email").doesNotExist("does not show email field");- assert.dom("#account-email-validation").hasText(I18n.t("user.email.ok"));+ assert.dom("#account-email-validation").hasText(i18n("user.email.ok"));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js b/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.jsindex d4824596205..dbaa8ebe0f6 100644--- a/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/keyboard-shortcuts-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import DiscoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";import { acceptance, chromeTest } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Keyboard Shortcuts - Anonymous Users", function (needs) {needs.pretender((server, helper) => {@@ -150,7 +150,7 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {.exists("confirmation modal to dismiss unread is present");assert.dom(".d-modal__body")- .hasText(I18n.t("topics.bulk.also_dismiss_topics"));+ .hasText(i18n("topics.bulk.also_dismiss_topics"));await click("#dismiss-read-confirm");assert.strictEqual(markReadCalled,@@ -259,14 +259,14 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {.exists("post-specific share modal is open");assert.dom("#discourse-modal-title")- .hasText(I18n.t("post.share.title", { post_number: 2 }));+ .hasText(i18n("post.share.title", { post_number: 2 }));await click(".modal-close");await triggerKeyEvent(document, "keydown", "S", { shiftKey: true });assert.dom(".d-modal.share-topic-modal").exists("topic level share modal is open");- assert.dom("#discourse-modal-title").hasText(I18n.t("topic.share.title"));+ assert.dom("#discourse-modal-title").hasText(i18n("topic.share.title"));await click(".modal-close");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.jsindex 587697a0de5..0a0cf72e32d 100644--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js@@ -2,7 +2,7 @@ import { click, fillIn, tab, visit } from "@ember/test-helpers";import { test } from "qunit";import sinon from "sinon";import { acceptance, chromeTest } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Modal - Login", function () {chromeTest("You can tab to the login button", async function (assert) {@@ -24,7 +24,7 @@ acceptance("Modal - Login - With 2FA", function (needs) {needs.pretender((server, helper) => {server.post(`/session`, () =>helper.response({- error: I18n.t("login.invalid_second_factor_code"),+ error: i18n("login.invalid_second_factor_code"),multiple_second_factor_methods: false,security_key_enabled: false,totp_enabled: true,diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-2fa-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-2fa-test.jsindex ef719e9d1c6..59f3728f61c 100644--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-2fa-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-2fa-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const TOKEN = "sometoken";@@ -37,8 +37,6 @@ acceptance("Login with email and 2FA", function (needs) {await visit(`/session/email-login/${TOKEN}`);await click(".toggle-second-factor-method");- assert- .dom("#second-factor")- .containsText(I18n.t("user.second_factor.title"));+ assert.dom("#second-factor").containsText(i18n("user.second_factor.title"));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-hide-email-address-taken-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-hide-email-address-taken-test.jsindex 5b8a967809a..44d9b5dbf6d 100644--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-hide-email-address-taken-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-hide-email-address-taken-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Login with email - hide email address taken", function (needs) {needs.settings({@@ -22,7 +22,7 @@ acceptance("Login with email - hide email address taken", function (needs) {await click("#email-login-link");assert.dom(".alert-success").hasHtml(- I18n.t("email_login.complete_email_found", {+ i18n("email_login.complete_email_found", {email: "[email protected]",}),"displays the success message for any email address"diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.jsindex dd5f3a8b629..131210f90ea 100644--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import sinon from "sinon";import DiscourseURL from "discourse/lib/url";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const TOKEN = "sometoken";@@ -50,7 +50,7 @@ acceptance("Login with email", function (needs) {await click("#email-login-link");assert.dom("#modal-alert").hasHtml(- I18n.t("email_login.complete_username_not_found", {+ i18n("email_login.complete_username_not_found", {username: "someuser",}),"displays an error for an invalid username"@@ -60,7 +60,7 @@ acceptance("Login with email", function (needs) {await click("#email-login-link");assert.dom("#modal-alert").hasHtml(- I18n.t("email_login.complete_email_not_found", {+ i18n("email_login.complete_email_not_found", {email: "[email protected]",}),"displays an error for an invalid email"@@ -75,7 +75,7 @@ acceptance("Login with email", function (needs) {assert.dom(".alert-success").hasHtml(- I18n.t("email_login.complete_username_found", { username: "someuser" }),+ i18n("email_login.complete_username_found", { username: "someuser" }),"displays a success message for a valid username");@@ -85,7 +85,7 @@ acceptance("Login with email", function (needs) {await click("#email-login-link");assert.dom(".alert-success").hasHtml(- I18n.t("email_login.complete_email_found", {+ i18n("email_login.complete_email_found", {email: "[email protected]",}),"displays a success message for a valid email"diff --git a/app/assets/javascripts/discourse/tests/acceptance/new-topics-test.js b/app/assets/javascripts/discourse/tests/acceptance/new-topics-test.jsindex 891cb218738..ba876b80aea 100644--- a/app/assets/javascripts/discourse/tests/acceptance/new-topics-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/new-topics-test.js@@ -1,7 +1,7 @@import { visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("New Topics - New new view enabled", function (needs) {needs.user({@@ -20,7 +20,7 @@ acceptance("New Topics - New new view enabled", function (needs) {await visit("/new");const text = new DOMParser().parseFromString(- I18n.t("topics.none.educate.new_new", {+ i18n("topics.none.educate.new_new", {userPrefsUrl: "/u/eviltrout/preferences/tracking",}),"text/html"diff --git a/app/assets/javascripts/discourse/tests/acceptance/password-reset-test.js b/app/assets/javascripts/discourse/tests/acceptance/password-reset-test.jsindex 6262284c672..61f1a72622b 100644--- a/app/assets/javascripts/discourse/tests/acceptance/password-reset-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/password-reset-test.js@@ -5,7 +5,7 @@ import PreloadStore from "discourse/lib/preload-store";import DiscourseURL from "discourse/lib/url";import { parsePostData } from "discourse/tests/helpers/create-pretender";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Password Reset", function (needs) {needs.pretender((server, helper) => {@@ -73,7 +73,7 @@ acceptance("Password Reset", function (needs) {await fillIn(".password-reset input", "123");assert.dom(".password-reset .tip.bad").exists("input is not valid");assert.dom(".password-reset .tip.bad").includesHtml(- I18n.t("user.password.too_short", {+ i18n("user.password.too_short", {count: this.siteSettings.min_password_length,}),"password too short"diff --git a/app/assets/javascripts/discourse/tests/acceptance/personal-message-test.js b/app/assets/javascripts/discourse/tests/acceptance/personal-message-test.jsindex acdadbe390e..2b15249b503 100644--- a/app/assets/javascripts/discourse/tests/acceptance/personal-message-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/personal-message-test.js@@ -11,7 +11,7 @@ import {acceptance,publishToMessageBus,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import selectKit from "../helpers/select-kit-helper";acceptance("Personal Message", function (needs) {@@ -22,7 +22,7 @@ acceptance("Personal Message", function (needs) {assert.dom("#suggested-topics-title")- .hasText(I18n.t("suggested_topics.pm_title"));+ .hasText(i18n("suggested_topics.pm_title"));});test("redirects to inbox after topic is archived and clears topicList cache", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/acceptance/post-controls-test.js b/app/assets/javascripts/discourse/tests/acceptance/post-controls-test.jsindex 411f3638cd5..6b90712499c 100644--- a/app/assets/javascripts/discourse/tests/acceptance/post-controls-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/post-controls-test.js@@ -1,7 +1,7 @@import { click, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Post controls", function () {test("accessibility of the likes list below the post", async function (assert) {@@ -14,7 +14,7 @@ acceptance("Post controls", function () {.dom("#post_2 button.like-count").hasAria("label",- I18n.t("post.sr_post_like_count_button", { count: 4 }),+ i18n("post.sr_post_like_count_button", { count: 4 }),"show likes button has aria-label");@@ -30,7 +30,7 @@ acceptance("Post controls", function () {.dom("#post_2 .small-user-list.who-liked .small-user-list-content").hasAria("label",- I18n.t("post.actions.people.sr_post_likers_list_description"),+ i18n("post.actions.people.sr_post_likers_list_description"),"likes container has aria-label");assert@@ -59,7 +59,7 @@ acceptance("Post controls", function () {.dom("#post_1 button.show-replies").hasAria("label",- I18n.t("post.sr_expand_replies", { count: 1 }),+ i18n("post.sr_expand_replies", { count: 1 }),"show replies button has aria-label");@@ -78,7 +78,7 @@ acceptance("Post controls", function () {.hasAttribute("role", "region", "replies have region role");assert.dom("#post_1 .embedded-posts .reply").hasAria("label",- I18n.t("post.sr_embedded_reply_description", {+ i18n("post.sr_embedded_reply_description", {post_number: 1,username: "somebody",}),@@ -88,7 +88,7 @@ acceptance("Post controls", function () {.dom("#post_1 .embedded-posts .btn.collapse-up").hasAria("label",- I18n.t("post.sr_collapse_replies"),+ i18n("post.sr_collapse_replies"),"collapse button has aria-label");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/review-test.js b/app/assets/javascripts/discourse/tests/acceptance/review-test.jsindex 274f9599b73..6954402f4de 100644--- a/app/assets/javascripts/discourse/tests/acceptance/review-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/review-test.js@@ -7,7 +7,7 @@ import {query,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Review", function (needs) {needs.user();@@ -65,7 +65,7 @@ acceptance("Review", function (needs) {assert.dom(".reject-reason-reviewable-modal .d-modal__title").includesHtml(- I18n.t("review.reject_reason.title"),+ i18n("review.reject_reason.title"),"opens reject reason modal when user is rejected");@@ -77,7 +77,7 @@ acceptance("Review", function (needs) {assert.dom(".reject-reason-reviewable-modal .d-modal__title").includesHtml(- I18n.t("review.reject_reason.title"),+ i18n("review.reject_reason.title"),"opens reject reason modal when user is rejected and blocked");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/search-test.js b/app/assets/javascripts/discourse/tests/acceptance/search-test.jsindex 0e72fd4f3cc..966849dfd20 100644--- a/app/assets/javascripts/discourse/tests/acceptance/search-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/search-test.js@@ -16,7 +16,7 @@ import {queryAll,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const clickOutside = () =>triggerEvent(document.querySelector("header.d-header"), "pointerdown");@@ -132,7 +132,7 @@ acceptance("Search - Anonymous", function (needs) {query(".search-menu .results ul.search-menu-initial-options li:first-child .search-item-slug").innerText.trim(),- I18n.t("search.in_topics_posts"),+ i18n("search.in_topics_posts"),"first dropdown item includes correct suffix");@@ -152,7 +152,7 @@ acceptance("Search - Anonymous", function (needs) {assert.strictEqual(query(".search-link .label-suffix").textContent.trim(),- I18n.t("search.in"),+ i18n("search.in"),"first option includes suffix");@@ -173,7 +173,7 @@ acceptance("Search - Anonymous", function (needs) {assert.strictEqual(secondOption.querySelector(".label-suffix").textContent.trim(),- I18n.t("search.in"),+ i18n("search.in"),"second option includes suffix");@@ -199,7 +199,7 @@ acceptance("Search - Anonymous", function (needs) {assert.strictEqual(secondOption.querySelector(".label-suffix").textContent.trim(),- I18n.t("search.in"),+ i18n("search.in"),"second option includes suffix");@@ -229,7 +229,7 @@ acceptance("Search - Anonymous", function (needs) {assert.strictEqual(secondOption.querySelector(".label-suffix").textContent.trim(),- I18n.t("search.in_this_topic"),+ i18n("search.in_this_topic"),"second option includes suffix");});@@ -290,7 +290,7 @@ acceptance("Search - Anonymous", function (needs) {query(".search-menu-assistant-item:first-child .search-item-slug .label-suffix").textContent.trim(),- I18n.t("search.in_topics_posts"),+ i18n("search.in_topics_posts"),"first result hints at global search");@@ -298,7 +298,7 @@ acceptance("Search - Anonymous", function (needs) {query(".search-menu-assistant-item:nth-child(2) .search-item-slug .label-suffix").textContent.trim(),- I18n.t("search.in_this_topic"),+ i18n("search.in_this_topic"),"second result hints at search within current topic");});@@ -318,7 +318,7 @@ acceptance("Search - Anonymous", function (needs) {assert.strictEqual(secondOption.querySelector(".label-suffix").textContent.trim(),- I18n.t("search.in_posts_by", { username: "eviltrout" }),+ i18n("search.in_posts_by", { username: "eviltrout" }),"second option includes suffix for user-scoped search");});@@ -521,7 +521,7 @@ acceptance("Search - Authenticated", function (needs) {assert.dom(".search-menu .results .no-results").exists({ count: 1 });assert.dom(".search-menu .results .no-results")- .hasText(I18n.t("search.no_results"));+ .hasText(i18n("search.no_results"));});test("topic results - topic search scope - clicking a search result navigates to topic url", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.jsindex f205c9ca3d4..163ad0c6ebf 100644--- a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import CategoryFixtures from "discourse/tests/fixtures/category-fixtures";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Share and Invite modal", function (needs) {needs.user();@@ -85,7 +85,7 @@ acceptance("Share and Invite modal", function (needs) {.dom("#modal-alert.alert-warning").exists("it shows restricted warning");assert.dom("#modal-alert.alert-warning").hasText(- I18n.t("topic.share.restricted_groups", {+ i18n("topic.share.restricted_groups", {count: 2,groupNames: "group_name_1, group_name_2",}),diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-anonymous-community-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-anonymous-community-section-test.jsindex 646fec455bf..c55c7bbcf1a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-anonymous-community-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-anonymous-community-section-test.js@@ -1,7 +1,7 @@import { click, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Anonymous user - Community Section", function (needs) {needs.settings({@@ -20,7 +20,7 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {assert.strictEqual(sectionLinks[0].textContent.trim(),- I18n.t("sidebar.sections.community.links.topics.content"),+ i18n("sidebar.sections.community.links.topics.content"),"displays the topics section link first");});@@ -50,31 +50,31 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {assert.strictEqual(sectionLinks[0].textContent.trim(),- I18n.t("sidebar.sections.community.links.users.content"),+ i18n("sidebar.sections.community.links.users.content"),"displays the users section link second");assert.strictEqual(sectionLinks[1].textContent.trim(),- I18n.t("sidebar.sections.community.links.about.content"),+ i18n("sidebar.sections.community.links.about.content"),"displays the about section link third");assert.strictEqual(sectionLinks[2].textContent.trim(),- I18n.t("sidebar.sections.community.links.faq.content"),+ i18n("sidebar.sections.community.links.faq.content"),"displays the FAQ section link last");assert.strictEqual(sectionLinks[3].textContent.trim(),- I18n.t("sidebar.sections.community.links.groups.content"),+ i18n("sidebar.sections.community.links.groups.content"),"displays the groups section link first");assert.strictEqual(sectionLinks[4].textContent.trim(),- I18n.t("sidebar.sections.community.links.badges.content"),+ i18n("sidebar.sections.community.links.badges.content"),"displays the badges section link second");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-plugin-api-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-plugin-api-test.jsindex 054daf16b8f..a9818abd6f7 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-plugin-api-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-plugin-api-test.js@@ -11,7 +11,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Plugin API", function (needs) {let linkDidInsert, linkDestroy, sectionDestroy;@@ -417,7 +417,7 @@ acceptance("Sidebar - Plugin API", function (needs) {`.sidebar-section-link-wrapper[data-category-id="${category1.id}"] .sidebar-section-link-content-badge`).hasText(- I18n.t("sidebar.unread_count", { count: 1 }),+ i18n("sidebar.unread_count", { count: 1 }),"displays the right badge text in section link when unread is present and custom countable is not prioritised over unread");diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-categories-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-categories-section-test.jsindex cd33f29816e..4002280122d 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-categories-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-categories-section-test.js@@ -13,7 +13,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Logged on user - Categories Section - allow_uncategorized_topics disabled",@@ -894,7 +894,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {query(`.sidebar-section-link-wrapper[data-category-id="${category1.id}"] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.unread_count", { count: 1 }),+ i18n("sidebar.unread_count", { count: 1 }),`displays 1 unread count for ${category1.slug} section link`);@@ -902,7 +902,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {query(`.sidebar-section-link-wrapper[data-category-id="${category2.id}"] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.unread_count", { count: 2 }),+ i18n("sidebar.unread_count", { count: 2 }),`displays 2 unread count for ${category2.slug} section link`);@@ -919,7 +919,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {query(`.sidebar-section-link-wrapper[data-category-id="${category1.id}"] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.new_count", { count: 1 }),+ i18n("sidebar.new_count", { count: 1 }),`displays 1 new count for ${category1.slug} section link`);@@ -953,7 +953,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {query(`.sidebar-section-link-wrapper[data-category-id="${category2.id}"] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.unread_count", { count: 1 }),+ i18n("sidebar.unread_count", { count: 1 }),`displays 1 unread count for ${category2.slug} section link`);});diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-community-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-community-section-test.jsindex 5b046753ec6..412e1da7ce4 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-community-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-community-section-test.js@@ -16,7 +16,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Logged on user - Community Section", function (needs) {needs.user({@@ -282,7 +282,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {query(".sidebar-section[data-section-name='community'] .sidebar-more-section-links-details-summary .sidebar-section-link-content-text").textContent.trim(),- I18n.t("sidebar.more"),+ i18n("sidebar.more"),"displays the right count as users link is currently active");@@ -386,7 +386,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {query(".sidebar-section[data-section-name='community'] .sidebar-more-section-links-details-summary .sidebar-section-link-content-text").textContent.trim(),- I18n.t("sidebar.more"),+ i18n("sidebar.more"),"displays the right count as groups link is currently active");@@ -582,7 +582,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {.dom(".sidebar-section-link[data-link-name='my-posts']").hasAttribute("title",- I18n.t("sidebar.sections.community.links.my_posts.title"),+ i18n("sidebar.sections.community.links.my_posts.title"),"displays the default title when no drafts are present");@@ -594,7 +594,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {.dom(".sidebar-section-link[data-link-name='my-posts']").hasAttribute("title",- I18n.t("sidebar.sections.community.links.my_posts.title_drafts"),+ i18n("sidebar.sections.community.links.my_posts.title_drafts"),"displays the draft title when drafts are present");});@@ -612,7 +612,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {query(".sidebar-section-link[data-link-name='my-posts']").textContent.trim(),- I18n.t("sidebar.sections.community.links.my_posts.content"),+ i18n("sidebar.sections.community.links.my_posts.content"),"displays the default text when no drafts are present");@@ -624,7 +624,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {query(".sidebar-section-link[data-link-name='my-posts'] .sidebar-section-link-content-text").textContent.trim(),- I18n.t("sidebar.sections.community.links.my_posts.content_drafts"),+ i18n("sidebar.sections.community.links.my_posts.content_drafts"),"displays the text that's appropriate for when drafts are present");assert.strictEqual(diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.jsindex 1f33d3c3560..845328b83c1 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js@@ -8,7 +8,7 @@ import {queryAll,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Logged on user - Messages Section - user does not have can_send_private_messages permission",@@ -417,7 +417,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='group-messages-unread'].group1").textContent.trim(),- I18n.t("sidebar.sections.messages.links.unread_with_count", {+ i18n("sidebar.sections.messages.links.unread_with_count", {count: 1,}),"displays 1 count for group1 unread inbox filter link"@@ -427,7 +427,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='group-messages-new'].group1").textContent.trim(),- I18n.t("sidebar.sections.messages.links.new_with_count", {+ i18n("sidebar.sections.messages.links.new_with_count", {count: 1,}),"displays 1 count for group1 new inbox filter link"@@ -448,7 +448,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='group-messages-new'].group1").textContent.trim(),- I18n.t("sidebar.sections.messages.links.new"),+ i18n("sidebar.sections.messages.links.new"),"removes count for group1 new inbox filter link");});@@ -479,7 +479,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='personal-messages-unread']").textContent.trim(),- I18n.t("sidebar.sections.messages.links.unread_with_count", {+ i18n("sidebar.sections.messages.links.unread_with_count", {count: 1,}),"displays 1 count for the unread inbox filter link"@@ -500,7 +500,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='personal-messages-unread']").textContent.trim(),- I18n.t("sidebar.sections.messages.links.unread_with_count", {+ i18n("sidebar.sections.messages.links.unread_with_count", {count: 2,}),"displays 2 count for the unread inbox filter link"@@ -521,7 +521,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='personal-messages-new']").textContent.trim(),- I18n.t("sidebar.sections.messages.links.new_with_count", {+ i18n("sidebar.sections.messages.links.new_with_count", {count: 1,}),"displays 1 count for the new inbox filter link"@@ -542,7 +542,7 @@ acceptance(query(".sidebar-section[data-section-name='messages'] .sidebar-section-link[data-link-name='personal-messages-new']").textContent.trim(),- I18n.t("sidebar.sections.messages.links.new"),+ i18n("sidebar.sections.messages.links.new"),"removes the count from the new inbox filter link");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-tags-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-tags-section-test.jsindex 5d9027ce365..5271c18261b 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-tags-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-tags-section-test.js@@ -9,7 +9,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Logged on user - Tags section", function (needs) {needs.settings({@@ -466,7 +466,7 @@ acceptance("Sidebar - Logged on user - Tags section", function (needs) {query(`.sidebar-section-link-wrapper[data-tag-name=tag1] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.unread_count", { count: 1 }),+ i18n("sidebar.unread_count", { count: 1 }),`displays 1 unread count for tag1 section link`);@@ -474,7 +474,7 @@ acceptance("Sidebar - Logged on user - Tags section", function (needs) {query(`.sidebar-section-link-wrapper[data-tag-name=tag2] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.unread_count", { count: 1 }),+ i18n("sidebar.unread_count", { count: 1 }),`displays 1 unread count for tag2 section link`);@@ -497,7 +497,7 @@ acceptance("Sidebar - Logged on user - Tags section", function (needs) {query(`.sidebar-section-link-wrapper[data-tag-name=tag1] .sidebar-section-link-content-badge`).textContent.trim(),- I18n.t("sidebar.new_count", { count: 1 }),+ i18n("sidebar.new_count", { count: 1 }),`displays 1 new count for tag1 section link`);diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.jsindex 65cacd35bdd..1ace36ff022 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-test.js@@ -5,7 +5,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Sidebar - Logged on user - Mobile view - Header dropdown navigation menu enabled",@@ -90,7 +90,7 @@ acceptance(test("viewing keyboard shortcuts using sidebar", async function (assert) {await visit("/");await click(- `.sidebar-footer-actions-keyboard-shortcuts[title="${I18n.t(+ `.sidebar-footer-actions-keyboard-shortcuts[title="${i18n("keyboard_shortcuts_help.title")}"]`);@@ -143,7 +143,7 @@ acceptance(assert.dom(- `.sidebar-footer-actions-toggle-mobile-view[title="${I18n.t(+ `.sidebar-footer-actions-toggle-mobile-view[title="${i18n("mobile_view")}"]`)@@ -215,7 +215,7 @@ acceptance(.dom(".btn-sidebar-toggle").hasAttribute("title",- I18n.t("sidebar.title"),+ i18n("sidebar.title"),"has the right title attribute when sidebar is expanded");@@ -233,7 +233,7 @@ acceptance(.dom(".btn-sidebar-toggle").hasAttribute("title",- I18n.t("sidebar.title"),+ i18n("sidebar.title"),"has the right title attribute when sidebar is collapsed");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/tags-test.js b/app/assets/javascripts/discourse/tests/acceptance/tags-test.jsindex 7e1326d0a4c..a3bb2cb19f1 100644--- a/app/assets/javascripts/discourse/tests/acceptance/tags-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/tags-test.js@@ -7,7 +7,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Tags", function (needs) {needs.user();@@ -542,7 +542,7 @@ acceptance("Tag info", function (needs) {await visit("/tag/planters");assert.strictEqual(document.title,- I18n.t("tagging.filters.without_category", {+ i18n("tagging.filters.without_category", {filter: "Latest",tag: "planters",}) + ` - ${this.siteSettings.title}`@@ -553,7 +553,7 @@ acceptance("Tag info", function (needs) {assert.strictEqual(currentURL(), "/tags/c/feature/2/planters");assert.strictEqual(document.title,- I18n.t("tagging.filters.with_category", {+ i18n("tagging.filters.with_category", {filter: "Latest",tag: "planters",category: "feature",@@ -565,7 +565,7 @@ acceptance("Tag info", function (needs) {assert.strictEqual(currentURL(), "/tags/c/feature/2/none");assert.strictEqual(document.title,- I18n.t("tagging.filters.untagged_with_category", {+ i18n("tagging.filters.untagged_with_category", {filter: "Latest",category: "feature",}) + ` - ${this.siteSettings.title}`diff --git a/app/assets/javascripts/discourse/tests/acceptance/themes-test.js b/app/assets/javascripts/discourse/tests/acceptance/themes-test.jsindex ddfcb55f7d7..2970d0a9dfc 100644--- a/app/assets/javascripts/discourse/tests/acceptance/themes-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/themes-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Theme", function (needs) {needs.user();@@ -205,7 +205,7 @@ acceptance("Theme", function (needs) {await click(".themes-list-container__item .info");assert.ok(query(".control-unit .status-message").innerText.includes(- I18n.t("admin.customize.theme.last_attempt")+ i18n("admin.customize.theme.last_attempt")),"it says that theme is not completely installed");@@ -218,7 +218,7 @@ acceptance("Theme", function (needs) {assert.notOk(query(".metadata.control-unit").innerText.includes(- I18n.t("admin.customize.theme.last_attempt")+ i18n("admin.customize.theme.last_attempt")),"it does not say that theme is not completely installed");diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-admin-menu-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-admin-menu-test.jsindex 4c22ee93645..26f5661cc69 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-admin-menu-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-admin-menu-test.js@@ -5,7 +5,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic - Admin Menu Anonymous Users", function () {test("Enter as a regular user", async function (assert) {@@ -67,7 +67,7 @@ acceptance("Topic - Admin Menu", function (needs) {.exists("The icon was rendered");assert.dom(".extra-button .d-button-label")- .hasText(I18n.t("yes_value"), "The label was rendered");+ .hasText(i18n("yes_value"), "The label was rendered");await click(".extra-button");assert.ok(this.actionCalled, "The action was called");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-discovery-tracked-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-discovery-tracked-test.jsindex 90ba525e438..a4dadae75c9 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-discovery-tracked-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-discovery-tracked-test.js@@ -9,7 +9,7 @@ import {query,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic Discovery Tracked", function (needs) {needs.user({@@ -185,13 +185,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title_with_count", { count: 4 }),+ i18n("filters.unread.title_with_count", { count: 4 }),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title_with_count", { count: 2 }),+ i18n("filters.new.title_with_count", { count: 2 }),"displays the right content on new link");@@ -199,13 +199,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title_with_count", { count: 3 }),+ i18n("filters.unread.title_with_count", { count: 3 }),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title_with_count", { count: 1 }),+ i18n("filters.new.title_with_count", { count: 1 }),"displays the right content on new link");@@ -231,13 +231,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title_with_count", { count: 2 }),+ i18n("filters.unread.title_with_count", { count: 2 }),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title"),+ i18n("filters.new.title"),"displays the right content on new link");});@@ -261,13 +261,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title"),+ i18n("filters.unread.title"),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title_with_count", { count: 1 }),+ i18n("filters.new.title_with_count", { count: 1 }),"displays the right content on new link");@@ -275,13 +275,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title"),+ i18n("filters.unread.title"),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title"),+ i18n("filters.new.title"),"displays the right content on new link");});@@ -339,13 +339,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title_with_count", { count: 1 }),+ i18n("filters.unread.title_with_count", { count: 1 }),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title"),+ i18n("filters.new.title"),"displays the right content on new link");@@ -353,13 +353,13 @@ acceptance("Topic Discovery Tracked", function (needs) {assert.strictEqual(query("#navigation-bar li.unread").textContent.trim(),- I18n.t("filters.unread.title"),+ i18n("filters.unread.title"),"displays the right content on unread link");assert.strictEqual(query("#navigation-bar li.new").textContent.trim(),- I18n.t("filters.new.title"),+ i18n("filters.new.title"),"displays the right content on new link");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.jsindex 196939366bd..c74193d14c4 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js@@ -11,7 +11,7 @@ import {} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic - Edit timer", function (needs) {needs.user();@@ -166,14 +166,11 @@ acceptance("Topic - Edit timer", function (needs) {// this needs to be done because there is no simple way to get the// plain text version of a translation with HTMLlet el = document.createElement("p");- el.innerHTML = I18n.t(- "topic.status_update_notice.auto_publish_to_category",- {- categoryUrl: "/c/dev/7",- categoryName: "dev",- timeLeft: "in 6 days",- }- );+ el.innerHTML = i18n("topic.status_update_notice.auto_publish_to_category", {+ categoryUrl: "/c/dev/7",+ categoryName: "dev",+ timeLeft: "in 6 days",+ });assert.strictEqual(text, el.innerText);});@@ -206,14 +203,11 @@ acceptance("Topic - Edit timer", function (needs) {// this needs to be done because there is no simple way to get the// plain text version of a translation with HTMLlet el = document.createElement("p");- el.innerHTML = I18n.t(- "topic.status_update_notice.auto_publish_to_category",- {- categoryUrl: "/c/dev/7",- categoryName: "dev",- timeLeft: "in 6 days",- }- );+ el.innerHTML = i18n("topic.status_update_notice.auto_publish_to_category", {+ categoryUrl: "/c/dev/7",+ categoryName: "dev",+ timeLeft: "in 6 days",+ });assert.strictEqual(text, el.innerText);});@@ -250,14 +244,11 @@ acceptance("Topic - Edit timer", function (needs) {// this needs to be done because there is no simple way to get the// plain text version of a translation with HTMLlet el = document.createElement("p");- el.innerHTML = I18n.t(- "topic.status_update_notice.auto_publish_to_category",- {- categoryUrl: "/c/dev/7",- categoryName: "dev",- timeLeft: "in 6 days",- }- );+ el.innerHTML = i18n("topic.status_update_notice.auto_publish_to_category", {+ categoryUrl: "/c/dev/7",+ categoryName: "dev",+ timeLeft: "in 6 days",+ });assert.strictEqual(text, el.innerText);});@@ -411,13 +402,13 @@ acceptance("Topic - Edit timer", function (needs) {el.innerText.trim()),[- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.this_weekend"),- I18n.t("time_shortcut.start_of_next_business_week"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.six_months"),- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.this_weekend"),+ i18n("time_shortcut.start_of_next_business_week"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.six_months"),+ i18n("time_shortcut.custom"),]);});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-move-posts-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-move-posts-test.jsindex 9dbafca348f..17ee98add36 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-move-posts-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-move-posts-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic move posts", function (needs) {needs.user();@@ -22,7 +22,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".selected-posts .move-to-topic").hasText(- I18n.t("topic.move_to.action"),+ i18n("topic.move_to.action"),"it should show the move to button");@@ -30,26 +30,26 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .d-modal__title")- .includesHtml(I18n.t("topic.move_to.title"), "opens move to modal");+ .includesHtml(i18n("topic.move_to.title"), "opens move to modal");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.split_topic.radio_label"),+ i18n("topic.split_topic.radio_label"),"shows an option to move to new topic");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.merge_topic.radio_label"),+ i18n("topic.merge_topic.radio_label"),"shows an option to move to existing topic");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.move_to_new_message.radio_label"),+ i18n("topic.move_to_new_message.radio_label"),"shows an option to move to new message");});@@ -62,7 +62,7 @@ acceptance("Topic move posts", function (needs) {await click(".selected-posts .move-to-topic");await fillIn(".choose-topic-modal #split-topic-name", "Existing topic");await click(".choose-topic-modal .d-modal__footer .btn-primary");- assert.dom("#modal-alert").hasText(I18n.t("topic.move_to.error"));+ assert.dom("#modal-alert").hasText(i18n("topic.move_to.error"));});test("moving all posts", async function (assert) {@@ -74,26 +74,26 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .d-modal__title")- .includesHtml(I18n.t("topic.move_to.title"), "opens move to modal");+ .includesHtml(i18n("topic.move_to.title"), "opens move to modal");assert.dom(".choose-topic-modal .radios").doesNotIncludeHtml(- I18n.t("topic.split_topic.radio_label"),+ i18n("topic.split_topic.radio_label"),"does not show an option to move to new topic");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.merge_topic.radio_label"),+ i18n("topic.merge_topic.radio_label"),"shows an option to move to existing topic");assert.dom(".choose-topic-modal .radios").doesNotIncludeHtml(- I18n.t("topic.move_to_new_message.radio_label"),+ i18n("topic.move_to_new_message.radio_label"),"does not show an option to move to new message");});@@ -109,7 +109,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.merge_topic.radio_label"),+ i18n("topic.merge_topic.radio_label"),"shows an option to move to an existing topic");@@ -128,7 +128,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .checkbox-label").includesHtml(- I18n.t("topic.merge_topic.chronological_order"),+ i18n("topic.merge_topic.chronological_order"),"shows a checkbox to merge posts in chronological order");});@@ -142,7 +142,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".selected-posts .move-to-topic").hasText(- I18n.t("topic.move_to.action"),+ i18n("topic.move_to.action"),"it should show the move to button");@@ -150,19 +150,19 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .d-modal__title")- .includesHtml(I18n.t("topic.move_to.title"), "opens move to modal");+ .includesHtml(i18n("topic.move_to.title"), "opens move to modal");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.move_to_new_message.radio_label"),+ i18n("topic.move_to_new_message.radio_label"),"shows an option to move to new message");assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.move_to_existing_message.radio_label"),+ i18n("topic.move_to_existing_message.radio_label"),"shows an option to move to existing message");});@@ -176,7 +176,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".selected-posts .move-to-topic").hasText(- I18n.t("topic.move_to.action"),+ i18n("topic.move_to.action"),"it should show the move to button");@@ -184,7 +184,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .d-modal__title")- .includesHtml(I18n.t("topic.move_to.title"), "opens move to modal");+ .includesHtml(i18n("topic.move_to.title"), "opens move to modal");});test("moving posts from personal message to existing message", async function (assert) {@@ -198,7 +198,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .radios").includesHtml(- I18n.t("topic.move_to_existing_message.radio_label"),+ i18n("topic.move_to_existing_message.radio_label"),"shows an option to move to an existing message");@@ -217,7 +217,7 @@ acceptance("Topic move posts", function (needs) {assert.dom(".choose-topic-modal .checkbox-label").includesHtml(- I18n.t("topic.merge_topic.chronological_order"),+ i18n("topic.merge_topic.chronological_order"),"shows a checkbox to merge posts in chronological order");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.jsindex 8b9cd259e88..e2fb66b51c5 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-quote-button-test.js@@ -8,7 +8,7 @@ import {selectText,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic - Quote button - logged in", function (needs) {needs.user();@@ -45,10 +45,10 @@ acceptance("Topic - Quote button - logged in", function (needs) {assert.dom(".quote-sharing").exists("shows the quote sharing options");assert- .dom(`.quote-sharing .btn[title='${I18n.t("share.twitter")}']`)+ .dom(`.quote-sharing .btn[title='${i18n("share.twitter")}']`).exists("it includes the twitter share button");assert- .dom(`.quote-sharing .btn[title='${I18n.t("share.email")}']`)+ .dom(`.quote-sharing .btn[title='${i18n("share.email")}']`).exists("it includes the email share button");});@@ -103,10 +103,10 @@ acceptance("Topic - Quote button - anonymous", function (needs) {assert.ok(queryAll(".quote-sharing"), "it shows the quote sharing options");assert- .dom(`.quote-sharing .btn[title='${I18n.t("share.twitter")}']`)+ .dom(`.quote-sharing .btn[title='${i18n("share.twitter")}']`).exists("it includes the twitter share button");assert- .dom(`.quote-sharing .btn[title='${I18n.t("share.email")}']`)+ .dom(`.quote-sharing .btn[title='${i18n("share.email")}']`).exists("it includes the email share button");assert.dom(".insert-quote")@@ -121,7 +121,7 @@ acceptance("Topic - Quote button - anonymous", function (needs) {assert.dom(".quote-sharing").exists("shows the quote sharing options");assert- .dom(`.quote-sharing .btn[title='${I18n.t("share.twitter")}']`)+ .dom(`.quote-sharing .btn[title='${i18n("share.twitter")}']`).exists("it includes the twitter share button");assert.dom(".quote-share-label")diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-set-slow-mode-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-set-slow-mode-test.jsindex 7b46a3f02ab..61204456109 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-set-slow-mode-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-set-slow-mode-test.js@@ -7,7 +7,7 @@ import {queryAll,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic - Set Slow Mode", function (needs) {let clock = null;@@ -52,14 +52,14 @@ acceptance("Topic - Set Slow Mode", function (needs) {);const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.two_days"),- I18n.t("time_shortcut.next_week"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.two_months"),- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.two_days"),+ i18n("time_shortcut.next_week"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.two_months"),+ i18n("time_shortcut.custom"),];assert.deepEqual(options, expected, "options are correct");diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-slow-mode-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-slow-mode-test.jsindex 3ea1bc47dd7..74ae8d3867e 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-slow-mode-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-slow-mode-test.js@@ -7,7 +7,7 @@ import {} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic - Slow Mode - enabled", function (needs) {needs.user();@@ -40,7 +40,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {const slowModeType = selectKit(".slow-mode-type");assert.strictEqual(slowModeType.header().name(),- I18n.t("topic.slow_mode_update.durations.10_minutes"),+ i18n("topic.slow_mode_update.durations.10_minutes"),"slow mode interval is rendered");@@ -51,7 +51,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {assert.dom("div.enabled-until span.name").hasText(- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.custom"),"enabled until combobox is switched to the option Pick Date and Time");@@ -68,7 +68,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {assert.dom("div.d-modal__footer button.btn-primary span").hasText(- I18n.t("topic.slow_mode_update.enable"),+ i18n("topic.slow_mode_update.enable"),"shows 'Enable' button when slow mode is disabled");@@ -80,7 +80,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {assert.dom("div.d-modal__footer button.btn-primary span").hasText(- I18n.t("topic.slow_mode_update.update"),+ i18n("topic.slow_mode_update.update"),"shows 'Update' button when slow mode is enabled");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.jsindex 046f7e7f7f5..1ba6489d105 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js@@ -19,7 +19,7 @@ import {import selectKit from "discourse/tests/helpers/select-kit-helper";import { withSilencedDeprecations } from "discourse-common/lib/deprecated";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Topic", function (needs) {needs.user();@@ -208,7 +208,7 @@ acceptance("Topic", function (needs) {assert.dom("#suggested-topics-title")- .hasText(I18n.t("suggested_topics.title"));+ .hasText(i18n("suggested_topics.title"));});test("Deleting a topic", async function (assert) {@@ -347,7 +347,7 @@ acceptance("Topic featured links", function (needs) {assert.dom(".selected-posts").includesHtml(- I18n.t("topic.multi_select.description", { count: 18 }),+ i18n("topic.multi_select.description", { count: 18 }),"selects the right number of posts");@@ -356,7 +356,7 @@ acceptance("Topic featured links", function (needs) {assert.dom(".selected-posts").includesHtml(- I18n.t("topic.multi_select.description", { count: 19 }),+ i18n("topic.multi_select.description", { count: 19 }),"selects the right number of posts");});@@ -569,7 +569,7 @@ acceptance("Topic filter replies to post number", function (needs) {.dom("#post_3 .show-replies").hasAttribute("title",- I18n.t("post.filtered_replies_hint", { count: 3 }),+ i18n("post.filtered_replies_hint", { count: 3 }),"displays the right title for filtering by replies");@@ -580,7 +580,7 @@ acceptance("Topic filter replies to post number", function (needs) {.dom("#post_3 .show-replies").hasAttribute("title",- I18n.t("post.view_all_posts"),+ i18n("post.view_all_posts"),"displays the right title when filtered by replies");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-activity-all-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-activity-all-test.jsindex cc63750ba85..7f4c150d1be 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-activity-all-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-activity-all-test.js@@ -1,6 +1,6 @@import { visit } from "@ember/test-helpers";import { test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { acceptance, query } from "../helpers/qunit-helpers";acceptance("User Activity / All - empty state", function (needs) {@@ -20,7 +20,7 @@ acceptance("User Activity / All - empty state", function (needs) {await visit(`/u/${currentUser}/activity`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_activity_title")+ i18n("user_activity.no_activity_title"));});@@ -28,7 +28,7 @@ acceptance("User Activity / All - empty state", function (needs) {await visit(`/u/${anotherUser}/activity`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_activity_title")+ i18n("user_activity.no_activity_title")); // the same title as when looking at own page});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-activity-likes-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-activity-likes-test.jsindex 3aada3af4a8..b5f5a654285 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-activity-likes-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-activity-likes-test.js@@ -1,6 +1,6 @@import { visit } from "@ember/test-helpers";import { test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { acceptance, query } from "../helpers/qunit-helpers";acceptance("User Activity / Likes - empty state", function (needs) {@@ -20,7 +20,7 @@ acceptance("User Activity / Likes - empty state", function (needs) {await visit(`/u/${currentUser}/activity/likes-given`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_likes_title")+ i18n("user_activity.no_likes_title"));});@@ -28,7 +28,7 @@ acceptance("User Activity / Likes - empty state", function (needs) {await visit(`/u/${anotherUser}/activity/likes-given`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_likes_title_others", { username: anotherUser })+ i18n("user_activity.no_likes_title_others", { username: anotherUser }));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-activity-replies-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-activity-replies-test.jsindex 05e5d48e251..a84771523ac 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-activity-replies-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-activity-replies-test.js@@ -1,6 +1,6 @@import { visit } from "@ember/test-helpers";import { test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { acceptance, query } from "../helpers/qunit-helpers";acceptance("User Activity / Replies - empty state", function (needs) {@@ -21,7 +21,7 @@ acceptance("User Activity / Replies - empty state", function (needs) {await visit(`/u/${currentUser}/activity/replies`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_replies_title")+ i18n("user_activity.no_replies_title"));});@@ -29,7 +29,7 @@ acceptance("User Activity / Replies - empty state", function (needs) {await visit(`/u/${anotherUser}/activity/replies`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_replies_title_others", { username: anotherUser })+ i18n("user_activity.no_replies_title_others", { username: anotherUser }));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-activity-topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-activity-topic-test.jsindex 8e464a4d5b0..1380f51241a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-activity-topic-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-activity-topic-test.js@@ -1,6 +1,6 @@import { click, visit } from "@ember/test-helpers";import { test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import userFixtures from "../fixtures/user-fixtures";import { acceptance, query, queryAll } from "../helpers/qunit-helpers";@@ -60,7 +60,7 @@ acceptance("User Activity / Topics - empty state", function (needs) {await visit(`/u/${currentUser}/activity/topics`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_topics_title")+ i18n("user_activity.no_topics_title"));});@@ -68,7 +68,7 @@ acceptance("User Activity / Topics - empty state", function (needs) {await visit(`/u/${anotherUser}/activity/topics`);assert.equal(query("div.empty-state span.empty-state-title").innerText,- I18n.t("user_activity.no_topics_title_others", { username: anotherUser })+ i18n("user_activity.no_topics_title_others", { username: anotherUser }));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-bookmark-bulk-actions-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-bookmark-bulk-actions-test.jsindex 1f07cc985c3..267a214770a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-bookmark-bulk-actions-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-bookmark-bulk-actions-test.js@@ -2,7 +2,7 @@ import { click, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("Bookmark - Bulk Actions", function (needs) {needs.user();@@ -23,7 +23,7 @@ acceptance("Bookmark - Bulk Actions", function (needs) {assert.dom(".dialog-container").exists("shows the modal");assert.dom(".dialog-container .dialog-body").includesText(- I18n.t("js.bookmark_bulk_actions.clear_reminders.description", {+ i18n("js.bookmark_bulk_actions.clear_reminders.description", {count: 2,}).replaceAll(/\<.*?>/g, ""));@@ -46,7 +46,7 @@ acceptance("Bookmark - Bulk Actions", function (needs) {assert.dom(".dialog-container").exists("shows the modal");assert.dom(".dialog-container .dialog-body").includesText(- I18n.t("js.bookmark_bulk_actions.delete_bookmarks.description", {+ i18n("js.bookmark_bulk_actions.delete_bookmarks.description", {count: 2,}).replaceAll(/\<.*?>/g, ""));diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-card-test.jsindex 7091dbd55f4..eab823a2fe2 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js@@ -4,7 +4,7 @@ import { test } from "qunit";import userFixtures from "discourse/tests/fixtures/user-fixtures";import { acceptance } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Card", function (needs) {needs.user();@@ -144,7 +144,7 @@ acceptance("User Card - Hidden Profile", function (needs) {assert.dom(".user-card .name-username-wrapper").hasText("eviltrout");assert.dom(".user-card .profile-hidden")- .hasText(I18n.t("user.profile_hidden"));+ .hasText(i18n("user.profile_hidden"));});});@@ -169,8 +169,6 @@ acceptance("User Card - Inactive user", function (needs) {await click('a[data-user-card="eviltrout"]');assert.dom(".user-card .name-username-wrapper").hasText("eviltrout");- assert- .dom(".user-card .inactive-user")- .hasText(I18n.t("user.inactive_user"));+ assert.dom(".user-card .inactive-user").hasText(i18n("user.inactive_user"));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-menu-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-menu-test.jsindex 80ab927f9b2..21c8c7df503 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-menu-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-menu-test.js@@ -24,7 +24,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User menu", function (needs) {needs.user({@@ -193,24 +193,24 @@ acceptance("User menu", function (needs) {});const expectedTitles = {- "user-menu-button-all-notifications": I18n.t(+ "user-menu-button-all-notifications": i18n("user_menu.tabs.all_notifications"),- "user-menu-button-replies": I18n.t("user_menu.tabs.replies_with_unread", {+ "user-menu-button-replies": i18n("user_menu.tabs.replies_with_unread", {count: 2,}),- "user-menu-button-likes": I18n.t("user_menu.tabs.likes"),- "user-menu-button-messages": I18n.t("user_menu.tabs.messages"),- "user-menu-button-bookmarks": I18n.t("user_menu.tabs.bookmarks"),+ "user-menu-button-likes": i18n("user_menu.tabs.likes"),+ "user-menu-button-messages": i18n("user_menu.tabs.messages"),+ "user-menu-button-bookmarks": i18n("user_menu.tabs.bookmarks"),"user-menu-button-tiny-tab-1": "Custom title: 73",- "user-menu-button-review-queue": I18n.t(+ "user-menu-button-review-queue": i18n("user_menu.tabs.review_queue_with_unread",{ count: 1 }),- "user-menu-button-other-notifications": I18n.t(+ "user-menu-button-other-notifications": i18n("user_menu.tabs.other_notifications"),- "user-menu-button-profile": I18n.t("user_menu.tabs.profile"),+ "user-menu-button-profile": i18n("user_menu.tabs.profile"),};await visit("/");await click(".d-header-icons .current-user button");@@ -450,7 +450,7 @@ acceptance("User menu", function (needs) {);assert.strictEqual(summaryLink.textContent.trim(),- I18n.t("user.summary.title"),+ i18n("user.summary.title"),"summary link has the right label");assert.ok(@@ -465,7 +465,7 @@ acceptance("User menu", function (needs) {);assert.strictEqual(activityLink.textContent.trim(),- I18n.t("user.activity_stream"),+ i18n("user.activity_stream"),"activity link has the right label");assert.ok(@@ -480,7 +480,7 @@ acceptance("User menu", function (needs) {);assert.strictEqual(invitesLink.textContent.trim(),- I18n.t("user.invited.title"),+ i18n("user.invited.title"),"invites link has the right label");assert.ok(@@ -505,7 +505,7 @@ acceptance("User menu", function (needs) {);assert.strictEqual(draftsLink.textContent.trim(),- I18n.t("drafts.label_with_count", { count: 13 }),+ i18n("drafts.label_with_count", { count: 13 }),"drafts link has the right label with count of the user's drafts");assert.ok(@@ -520,7 +520,7 @@ acceptance("User menu", function (needs) {);assert.strictEqual(preferencesLink.textContent.trim(),- I18n.t("user.preferences.title"),+ i18n("user.preferences.title"),"preferences link has the right label");assert.ok(@@ -536,7 +536,7 @@ acceptance("User menu", function (needs) {.replaceAll(/\s+/g, " ").replaceAll(/\u200B/g, "").trim(),- I18n.t("pause_notifications.label"),+ i18n("pause_notifications.label"),"Do Not Disturb button has the right label");assert.ok(@@ -559,7 +559,7 @@ acceptance("User menu", function (needs) {.replaceAll(/\s+/g, " ").replaceAll(/\u200B/g, "").trim(),- `${I18n.t("pause_notifications.label")} 2h`,+ `${i18n("pause_notifications.label")} 2h`,"Do Not Disturb button has the right label when Do Not Disturb is enabled");assert.ok(@@ -578,7 +578,7 @@ acceptance("User menu", function (needs) {.replaceAll(/\s+/g, " ").replaceAll(/\u200B/g, "").trim(),- I18n.t("switch_to_anon"),+ i18n("switch_to_anon"),"toggle anonymous button has the right label when the user isn't anonymous");assert.ok(@@ -599,7 +599,7 @@ acceptance("User menu", function (needs) {.replaceAll(/\s+/g, " ").replaceAll(/\u200B/g, "").trim(),- I18n.t("switch_from_anon"),+ i18n("switch_from_anon"),"toggle anonymous button has the right label when the user is anonymous");assert.ok(@@ -698,7 +698,7 @@ acceptance("User menu", function (needs) {.replaceAll(/\s+/g, " ").replaceAll(/\u200B/g, "").trim(),- I18n.t("user.log_out"),+ i18n("user.log_out"),"logout button has the right label");assert.ok(@@ -953,7 +953,7 @@ acceptance("User menu - Dismiss button", function (needs) {query(".dismiss-notification-confirmation .d-modal__body").textContent.trim(),- I18n.t("notifications.dismiss_confirmation.body.default", { count: 10 }),+ i18n("notifications.dismiss_confirmation.body.default", { count: 10 }),"confirmation modal is shown when there are unread high pri notifications");@@ -989,7 +989,7 @@ acceptance("User menu - Dismiss button", function (needs) {query(".dismiss-notification-confirmation .d-modal__body").textContent.trim(),- I18n.t("notifications.dismiss_confirmation.body.bookmarks", {+ i18n("notifications.dismiss_confirmation.body.bookmarks", {count: 103,}),"confirmation modal is shown when there are unread bookmark reminder notifications"@@ -1040,7 +1040,7 @@ acceptance("User menu - Dismiss button", function (needs) {query(".dismiss-notification-confirmation .d-modal__body").textContent.trim(),- I18n.t("notifications.dismiss_confirmation.body.messages", {+ i18n("notifications.dismiss_confirmation.body.messages", {count: 89,}),"confirmation modal is shown when there are unread messages notifications"diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.jsindex af6d7ebc72f..c5d6ac0125a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-account-test.js@@ -8,7 +8,7 @@ import pretender, {} from "discourse/tests/helpers/create-pretender";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Preferences - Account", function (needs) {needs.user({ can_upload_avatar: true });@@ -102,7 +102,7 @@ acceptance("User Preferences - Account", function (needs) {assert.strictEqual(query(".dialog-body").textContent.trim(),- I18n.t("user.deleted_yourself"),+ i18n("user.deleted_yourself"),"confirmation dialog is shown");@@ -301,7 +301,7 @@ acceptance("User Preferences — Account - Download Archive", function (needs) {await click(".btn-request-archive");await click("#dialog-holder .btn-primary");- assert.dom(".dialog-body").hasText(I18n.t("user.download_archive.success"));+ assert.dom(".dialog-body").hasText(i18n("user.download_archive.success"));await click("#dialog-holder .btn-primary");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-email-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-email-test.jsindex 87c3da97fac..525443bcfe4 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-email-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-email-test.js@@ -1,7 +1,7 @@import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Preferences - Email", function (needs) {needs.user();@@ -24,7 +24,7 @@ acceptance("User Preferences - Email", function (needs) {assert.dom(".tip.bad").hasText(- I18n.t("user.email.invalid"),+ i18n("user.email.invalid"),"it should display invalid email tip");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-interface-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-interface-test.jsindex 7d0d988d802..daa0a46a2c9 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-interface-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-interface-test.js@@ -6,7 +6,7 @@ import Site from "discourse/models/site";import userFixtures from "discourse/tests/fixtures/user-fixtures";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Preferences - Interface", function (needs) {needs.user();@@ -99,7 +99,7 @@ acceptance("User Preferences - Interface", function (needs) {);assert.strictEqual(selectKit(".light-color-scheme .select-kit").header().label(),- I18n.t("user.color_schemes.default_description")+ i18n("user.color_schemes.default_description"));});@@ -240,7 +240,7 @@ acceptance(assert.strictEqual(dropdownObject.header().value(), null);assert.strictEqual(dropdownObject.header().label(),- I18n.t("user.color_schemes.default_description")+ i18n("user.color_schemes.default_description"));await dropdownObject.expand();diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-navigation-menu-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-navigation-menu-test.jsindex 286f719f53a..60db050155e 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-navigation-menu-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-navigation-menu-test.js@@ -5,7 +5,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Preferences - Navigation Menu", function (needs) {needs.user();@@ -76,7 +76,7 @@ acceptance("User Preferences - Navigation Menu", function (needs) {`.sidebar-section-link[data-link-name="everything"] .sidebar-section-link-content-badge`).hasText(- I18n.t("sidebar.new_count", { count: 1 }),+ i18n("sidebar.new_count", { count: 1 }),"everything link now has badge text after the preference is enabled");@@ -92,7 +92,7 @@ acceptance("User Preferences - Navigation Menu", function (needs) {`.sidebar-section-link-wrapper[data-category-id="${category1.id}"] .sidebar-section-link-content-badge`).hasText(- I18n.t("sidebar.new_count", { count: 1 }),+ i18n("sidebar.new_count", { count: 1 }),"category1 now has badge text after the preference is enabled");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-notifications-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-notifications-test.jsindex 33c28aaab32..12e1c44c2ae 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-notifications-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-notifications-test.js@@ -7,7 +7,7 @@ import {queryAll,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User notification schedule", function (needs) {needs.user();@@ -132,19 +132,19 @@ acceptance("User Notifications - Users - Ignore User", function (needs) {);const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.later_this_week"),- I18n.t("time_shortcut.this_weekend"),- I18n.t("time_shortcut.start_of_next_business_week_alt"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.two_months"),- I18n.t("time_shortcut.three_months"),- I18n.t("time_shortcut.four_months"),- I18n.t("time_shortcut.six_months"),- I18n.t("time_shortcut.one_year"),- I18n.t("time_shortcut.forever"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.later_this_week"),+ i18n("time_shortcut.this_weekend"),+ i18n("time_shortcut.start_of_next_business_week_alt"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.two_months"),+ i18n("time_shortcut.three_months"),+ i18n("time_shortcut.four_months"),+ i18n("time_shortcut.six_months"),+ i18n("time_shortcut.one_year"),+ i18n("time_shortcut.forever"),];assert.deepEqual(options, expected, "options are correct");diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.jsindex dd8a82cf19e..4df111984fa 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js@@ -6,7 +6,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Preferences - Security", function (needs) {needs.user();@@ -39,7 +39,7 @@ acceptance("User Preferences - Security", function (needs) {assert.dom(".pref-auth-tokens > a:nth-of-type(1)").hasText(- I18n.t("user.auth_tokens.show_all", { count: 3 }),+ i18n("user.auth_tokens.show_all", { count: 3 }),"it should display two tokens");assertdiff --git a/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.jsindex 0f6d9a8a016..b5aae432155 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js@@ -15,7 +15,7 @@ import {updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import selectKit from "../helpers/select-kit-helper";acceptance(@@ -358,13 +358,13 @@ acceptance(assert.strictEqual(query(".user-nav__messages-new").innerText.trim(),- I18n.t("user.messages.new_with_count", { count: 1 }),+ i18n("user.messages.new_with_count", { count: 1 }),"displays the right count");assert.strictEqual(query(".user-nav__messages-unread").innerText.trim(),- I18n.t("user.messages.unread_with_count", { count: 1 }),+ i18n("user.messages.unread_with_count", { count: 1 }),"displays the right count");});@@ -376,7 +376,7 @@ acceptance(assert.strictEqual(query(".messages-nav .user-nav__messages-new").innerText.trim(),- I18n.t("user.messages.new_with_count", { count: 1 }),+ i18n("user.messages.new_with_count", { count: 1 }),"displays the right count");@@ -386,7 +386,7 @@ acceptance(assert.strictEqual(query(".messages-nav .user-nav__messages-new").innerText.trim(),- I18n.t("user.messages.new_with_count", { count: 2 }),+ i18n("user.messages.new_with_count", { count: 2 }),"displays the right count");@@ -400,7 +400,7 @@ acceptance(assert.strictEqual(query(".messages-nav .user-nav__messages-unread").innerText.trim(),- I18n.t("user.messages.unread_with_count", { count: 1 }),+ i18n("user.messages.unread_with_count", { count: 1 }),"displays the right count");@@ -417,13 +417,13 @@ acceptance(query(".messages-nav .user-nav__messages-group-unread").innerText.trim(),- I18n.t("user.messages.unread_with_count", { count: 1 }),+ i18n("user.messages.unread_with_count", { count: 1 }),"displays the right count");assert.strictEqual(query(".messages-nav .user-nav__messages-group-new").innerText.trim(),- I18n.t("user.messages.new_with_count", { count: 1 }),+ i18n("user.messages.new_with_count", { count: 1 }),"displays the right count");@@ -433,13 +433,13 @@ acceptance(assert.strictEqual(query(".messages-nav .user-nav__messages-unread").innerText.trim(),- I18n.t("user.messages.unread"),+ i18n("user.messages.unread"),"displays the right count");assert.strictEqual(query(".messages-nav .user-nav__messages-new").innerText.trim(),- I18n.t("user.messages.new"),+ i18n("user.messages.new"),"displays the right count");});@@ -473,7 +473,7 @@ acceptance(assert.strictEqual(query(".user-nav__messages-unread").innerText.trim(),- I18n.t("user.messages.unread"),+ i18n("user.messages.unread"),"displays the right count");@@ -527,7 +527,7 @@ acceptance(assert.strictEqual(query(".messages-nav .user-nav__messages-new").innerText.trim(),- I18n.t("user.messages.new"),+ i18n("user.messages.new"),"displays the right count");@@ -611,7 +611,7 @@ acceptance(assert.strictEqual(messagesDropdown.header().name(),- I18n.t("user.messages.inbox"),+ i18n("user.messages.inbox"),"User personal inbox is selected in dropdown");@@ -619,7 +619,7 @@ acceptance(assert.strictEqual(messagesDropdown.header().name(),- I18n.t("user.messages.inbox"),+ i18n("user.messages.inbox"),"User personal inbox is still selected when viewing sent messages");@@ -647,7 +647,7 @@ acceptance();await messagesDropdown.expand();- await messagesDropdown.selectRowByName(I18n.t("user.messages.tags"));+ await messagesDropdown.selectRowByName(i18n("user.messages.tags"));assert.strictEqual(currentURL(),@@ -657,7 +657,7 @@ acceptance(assert.strictEqual(messagesDropdown.header().name(),- I18n.t("user.messages.tags"),+ i18n("user.messages.tags"),"All tags is selected in dropdown");@@ -665,7 +665,7 @@ acceptance(assert.strictEqual(messagesDropdown.header().name(),- I18n.t("user.messages.tags"),+ i18n("user.messages.tags"),"All tags is still selected in dropdown");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-profile-summary-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-profile-summary-test.jsindex 000cae86cf8..f0e4f1e14db 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-profile-summary-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-profile-summary-test.js@@ -3,7 +3,7 @@ import { test } from "qunit";import userFixtures from "discourse/tests/fixtures/user-fixtures";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let deleteAndBlock = null;@@ -111,7 +111,7 @@ acceptance("User Profile - Summary - Stats", function (needs) {.dom(".stats-time-read span").hasAttribute("title",- I18n.t("user.summary.time_read_title", { duration: "1 day" })+ i18n("user.summary.time_read_title", { duration: "1 day" }));assert.equal(query(".stats-recent-read span").textContent.trim(), "17m");@@ -119,7 +119,7 @@ acceptance("User Profile - Summary - Stats", function (needs) {.dom(".stats-recent-read span").hasAttribute("title",- I18n.t("user.summary.recent_time_read_title", { duration: "17 mins" })+ i18n("user.summary.recent_time_read_title", { duration: "17 mins" }));});});@@ -170,7 +170,7 @@ acceptance("User Profile - Summary - Admin", function (needs) {assert.equal(query("#dialog-title").textContent,- I18n.t("admin.user.delete_confirm_title"),+ i18n("admin.user.delete_confirm_title"),"dialog has a title");diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-test.jsindex 8911b57d52d..57fdfbb78a9 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-test.js@@ -16,7 +16,7 @@ import {} from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";/*** Workaround for https://github.com/tildeio/router.js/pull/335@@ -385,7 +385,7 @@ acceptance("User - Logout", function (needs) {.doesNotExist("no cancel button present");assert.dom(".dialog-footer .btn-primary")- .hasText(I18n.t("home"), "primary dialog button is present");+ .hasText(i18n("home"), "primary dialog button is present");await click(".dialog-overlay");});diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-tips-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-tips-test.jsindex 31307ac276b..4fbdc6d2eb0 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-tips-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-tips-test.js@@ -2,7 +2,7 @@ import { visit } from "@ember/test-helpers";import { test } from "qunit";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Tips - first_notification", function (needs) {needs.user({ new_personal_messages_notifications_count: 1 });@@ -26,7 +26,7 @@ acceptance("User Tips - first_notification", function (needs) {await visit("/t/internationalization-localization/280");assert.dom(".user-tip__title")- .hasText(I18n.t("user_tips.first_notification.title"));+ .hasText(i18n("user_tips.first_notification.title"));assert.verifySteps(["endpoint called"],@@ -45,7 +45,7 @@ acceptance("User Tips - topic_timeline", function (needs) {await visit("/t/internationalization-localization/280");assert.dom(".user-tip__title")- .hasText(I18n.t("user_tips.topic_timeline.title"));+ .hasText(i18n("user_tips.topic_timeline.title"));});});@@ -57,7 +57,7 @@ acceptance("User Tips - post_menu", function (needs) {this.siteSettings.enable_user_tips = true;await visit("/t/internationalization-localization/280");- assert.dom(".user-tip__title").hasText(I18n.t("user_tips.post_menu.title"));+ assert.dom(".user-tip__title").hasText(i18n("user_tips.post_menu.title"));});});@@ -72,7 +72,7 @@ acceptance("User Tips - topic_notification_levels", function (needs) {assert.dom(".user-tip__title")- .hasText(I18n.t("user_tips.topic_notification_levels.title"));+ .hasText(i18n("user_tips.topic_notification_levels.title"));});});@@ -86,6 +86,6 @@ acceptance("User Tips - suggested_topics", function (needs) {await visit("/t/internationalization-localization/280");assert.dom(".user-tip__title")- .hasText(I18n.t("user_tips.suggested_topics.title"));+ .hasText(i18n("user_tips.suggested_topics.title"));});});diff --git a/app/assets/javascripts/discourse/tests/acceptance/users-test.js b/app/assets/javascripts/discourse/tests/acceptance/users-test.jsindex d28bc44a60d..17a0e6a983a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/users-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/users-test.js@@ -8,7 +8,7 @@ import {queryAll,} from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";acceptance("User Directory", function () {test("Visit Page", async function (assert) {@@ -125,7 +125,7 @@ acceptance("User Directory", function () {assert.dom(".empty-state-body").hasText(- I18n.t("directory.no_results.body"),+ i18n("directory.no_results.body"),"a JIT message is shown when there are no users");});@@ -145,7 +145,7 @@ acceptance("User Directory", function () {assert.dom(".empty-state-body").hasText(- I18n.t("directory.no_results_with_search"),+ i18n("directory.no_results_with_search"),"a different JIT message is used when there are no results for the search term");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-page-header-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/admin-page-header-test.gjsindex 5cc3b6c59ad..1ccfe12bc02 100644--- a/app/assets/javascripts/discourse/tests/integration/components/admin-page-header-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/admin-page-header-test.gjs@@ -4,7 +4,7 @@ import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import NavItem from "discourse/components/nav-item";import { forceMobile } from "discourse/lib/mobile";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminPageHeader from "admin/components/admin-page-header";const AdminPageHeaderActionsTestComponent = <template>diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-page-subheader-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/admin-page-subheader-test.gjsindex 217ef7ca2cc..f15536dd794 100644--- a/app/assets/javascripts/discourse/tests/integration/components/admin-page-subheader-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/admin-page-subheader-test.gjs@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";import { module, test } from "qunit";import { forceMobile } from "discourse/lib/mobile";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import AdminPageSubheader from "admin/components/admin-page-subheader";module("Integration | Component | AdminPageSubheader", function (hooks) {diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjsindex 0512fe99652..8caa59f9fbe 100644--- a/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/admin-schema-theme-setting/editor-test.gjs@@ -4,7 +4,7 @@ import schemaAndData from "discourse/tests/fixtures/theme-setting-schema-data";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { queryAll } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import AdminSchemaThemeSettingEditor from "admin/components/schema-theme-setting/editor";import ThemeSettings from "admin/models/theme-settings";@@ -309,7 +309,7 @@ module(await click(tree.nodes[1].children[1].element);assert.dom(".--back-btn").hasText(- I18n.t("admin.customize.theme.schema.back_button", {+ i18n("admin.customize.theme.schema.back_button", {name: "item 2",}));@@ -318,7 +318,7 @@ module(await click(tree.nodes[1].children[0].element);assert.dom(".--back-btn").hasText(- I18n.t("admin.customize.theme.schema.back_button", {+ i18n("admin.customize.theme.schema.back_button", {name: "child 2-2",}));@@ -326,7 +326,7 @@ module(await click(".--back-btn");assert.dom(".--back-btn").hasText(- I18n.t("admin.customize.theme.schema.back_button", {+ i18n("admin.customize.theme.schema.back_button", {name: "item 2",}));@@ -464,7 +464,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.id.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.string.too_short", {+ i18n("admin.customize.theme.schema.fields.string.too_short", {count: 2,}));@@ -475,7 +475,7 @@ module(assert.dom(inputFields.fields.id.errorElement)- .hasText(I18n.t("admin.customize.theme.schema.fields.required"));+ .hasText(i18n("admin.customize.theme.schema.fields.required"));});test("input fields of type integer", async function (assert) {@@ -520,7 +520,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.id.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.number.too_large", {+ i18n("admin.customize.theme.schema.fields.number.too_large", {count: 10,}));@@ -530,7 +530,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.id.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.number.too_small", {+ i18n("admin.customize.theme.schema.fields.number.too_small", {count: 5,}));@@ -541,7 +541,7 @@ module(assert.dom(inputFields.fields.id.errorElement)- .hasText(I18n.t("admin.customize.theme.schema.fields.required"));+ .hasText(i18n("admin.customize.theme.schema.fields.required"));});test("input fields of type float", async function (assert) {@@ -586,7 +586,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.id.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.number.too_large", {+ i18n("admin.customize.theme.schema.fields.number.too_large", {count: 10.5,}));@@ -596,7 +596,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.id.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.number.too_small", {+ i18n("admin.customize.theme.schema.fields.number.too_small", {count: 5.5,}));@@ -607,7 +607,7 @@ module(assert.dom(inputFields.fields.id.errorElement)- .hasText(I18n.t("admin.customize.theme.schema.fields.required"));+ .hasText(i18n("admin.customize.theme.schema.fields.required"));});test("input fields of type boolean", async function (assert) {@@ -755,7 +755,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.not_required_category.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.categories.at_least", {+ i18n("admin.customize.theme.schema.fields.categories.at_least", {count: 2,}));@@ -832,7 +832,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.required_category.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.categories.at_least", {+ i18n("admin.customize.theme.schema.fields.categories.at_least", {count: 1,}));@@ -957,7 +957,7 @@ module(assert.dom(inputFields.fields.required_tags_with_validations.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.tags.at_least", {+ i18n("admin.customize.theme.schema.fields.tags.at_least", {count: 2,}));@@ -972,7 +972,7 @@ module(assert.dom(inputFields.fields.required_tags_with_validations.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.tags.at_least", {+ i18n("admin.customize.theme.schema.fields.tags.at_least", {count: 2,}));@@ -988,7 +988,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.required_tags.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.tags.at_least", {+ i18n("admin.customize.theme.schema.fields.tags.at_least", {count: 1,}));@@ -1040,7 +1040,7 @@ module(inputFields.refresh();assert.dom(inputFields.fields.required_groups.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.groups.at_least", {+ i18n("admin.customize.theme.schema.fields.groups.at_least", {count: 1,}));@@ -1066,7 +1066,7 @@ module(assert.dom(inputFields.fields.groups_with_validations.errorElement).hasText(- I18n.t("admin.customize.theme.schema.fields.groups.at_least", {+ i18n("admin.customize.theme.schema.fields.groups.at_least", {count: 2,}));@@ -1209,7 +1209,7 @@ module(inputFields.refresh();assert.dom(".--back-btn").hasText(- I18n.t("admin.customize.theme.schema.back_button", {+ i18n("admin.customize.theme.schema.back_button", {name: "cool section is no longer cool",}));diff --git a/app/assets/javascripts/discourse/tests/integration/components/bookmark-icon-test.js b/app/assets/javascripts/discourse/tests/integration/components/bookmark-icon-test.jsindex 857ba1cdac9..a712ca557f5 100644--- a/app/assets/javascripts/discourse/tests/integration/components/bookmark-icon-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/bookmark-icon-test.js@@ -5,7 +5,7 @@ import { formattedReminderTime } from "discourse/lib/bookmark";import { tomorrow } from "discourse/lib/time-utils";import Bookmark from "discourse/models/bookmark";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | bookmark-icon", function (hooks) {setupRenderingTest(hooks);@@ -26,7 +26,7 @@ module("Integration | Component | bookmark-icon", function (hooks) {.exists();assert.dom(".svg-icon-title").hasAttribute("title",- I18n.t("bookmarks.created_with_reminder_generic", {+ i18n("bookmarks.created_with_reminder_generic", {date: formattedReminderTime(this.bookmark.reminder_at,this.currentUser.user_option.timezone@@ -50,7 +50,7 @@ module("Integration | Component | bookmark-icon", function (hooks) {assert.dom(".d-icon-bookmark.bookmark-icon__bookmarked").exists();assert.dom(".svg-icon-title").hasAttribute("title",- I18n.t("bookmarks.created_generic", {+ i18n("bookmarks.created_generic", {name: "some name",}));@@ -66,6 +66,6 @@ module("Integration | Component | bookmark-icon", function (hooks) {assert.dom(".d-icon-bookmark.bookmark-icon").exists();assert.dom(".svg-icon-title")- .hasAttribute("title", I18n.t("bookmarks.create"));+ .hasAttribute("title", i18n("bookmarks.create"));});});diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-breadcrumbs-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/d-breadcrumbs-test.gjsindex b431544358f..e2f509cb0c0 100644--- a/app/assets/javascripts/discourse/tests/integration/components/d-breadcrumbs-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/d-breadcrumbs-test.gjs@@ -3,7 +3,7 @@ import { module, test } from "qunit";import DBreadcrumbsContainer from "discourse/components/d-breadcrumbs-container";import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";module("Component | DBreadcrumbsContainer and DBreadcrumbsItem",diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-button-test.jsindex 410d36dc0ae..1e807ccbf23 100644--- a/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js@@ -4,7 +4,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { withSilencedDeprecationsAsync } from "discourse-common/lib/deprecated";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";module("Integration | Component | d-button", function (hooks) {setupRenderingTest(hooks);@@ -108,7 +108,7 @@ module("Integration | Component | d-button", function (hooks) {this.set("ariaLabel", "test.fooAriaLabel");- assert.dom("button").hasAria("label", I18n.t("test.fooAriaLabel"));+ assert.dom("button").hasAria("label", i18n("test.fooAriaLabel"));this.setProperties({ariaLabel: null,@@ -126,7 +126,7 @@ module("Integration | Component | d-button", function (hooks) {);this.set("title", "test.fooTitle");- assert.dom("button").hasAttribute("title", I18n.t("test.fooTitle"));+ assert.dom("button").hasAttribute("title", i18n("test.fooTitle"));this.setProperties({title: null,@@ -145,7 +145,7 @@ module("Integration | Component | d-button", function (hooks) {this.set("label", "test.fooLabel");- assert.dom("button .d-button-label").hasText(I18n.t("test.fooLabel"));+ assert.dom("button .d-button-label").hasText(i18n("test.fooLabel"));this.setProperties({label: null,diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.jsindex 31188d31d31..35fec4d4277 100644--- a/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/d-editor-test.js@@ -18,7 +18,7 @@ import {getTextareaSelection,setTextareaSelection,} from "discourse/tests/helpers/textarea-selection-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | d-editor", function (hooks) {setupRenderingTest(hooks);@@ -126,7 +126,7 @@ module("Integration | Component | d-editor", function (hooks) {testCase(`bold button with no selection`, async function (assert, textarea) {await click(`button.bold`);- const example = I18n.t(`composer.bold_text`);+ const example = i18n(`composer.bold_text`);assert.strictEqual(this.value, `hello world.**${example}**`);assert.strictEqual(textarea.selectionStart, 14);assert.strictEqual(textarea.selectionEnd, 14 + example.length);@@ -187,7 +187,7 @@ module("Integration | Component | d-editor", function (hooks) {`italic button with no selection`,async function (assert, textarea) {await click(`button.italic`);- const example = I18n.t(`composer.italic_text`);+ const example = i18n(`composer.italic_text`);assert.strictEqual(this.value, `hello world.*${example}*`);assert.strictEqual(textarea.selectionStart, 13);@@ -270,7 +270,7 @@ function xyz(x, y, z) {const textarea = jumpEnd(query("textarea.d-editor-input"));await click("button.code");- assert.strictEqual(this.value, ` ${I18n.t("composer.code_text")}`);+ assert.strictEqual(this.value, ` ${i18n("composer.code_text")}`);this.set("value", "first line\n\nsecond line\n\nthird line");@@ -281,7 +281,7 @@ function xyz(x, y, z) {assert.strictEqual(this.value,`first line- ${I18n.t("composer.code_text")}+ ${i18n("composer.code_text")}second linethird line`@@ -296,7 +296,7 @@ third line`second line-third line\`${I18n.t("composer.code_title")}\``+third line\`${i18n("composer.code_title")}\``);this.set("value", "first line\n\nsecond line\n\nthird line");@@ -306,7 +306,7 @@ third line\`${I18n.t("composer.code_title")}\``await click("button.code");assert.strictEqual(this.value,- `first\`${I18n.t("composer.code_title")}\` line+ `first\`${i18n("composer.code_title")}\` linesecond line@@ -355,7 +355,7 @@ third line`assert.strictEqual(this.value,`\`\`\`-${I18n.t("composer.paste_code_text")}+${i18n("composer.paste_code_text")}\`\`\``);@@ -391,7 +391,7 @@ third lineassert.strictEqual(this.value,- `\`${I18n.t("composer.code_title")}\`first line+ `\`${i18n("composer.code_title")}\`first linesecond linethird line`);@@ -399,7 +399,7 @@ third line`assert.strictEqual(textarea.selectionStart, 1);assert.strictEqual(textarea.selectionEnd,- I18n.t("composer.code_title").length + 1+ i18n("composer.code_title").length + 1);this.set("value", "first line\nsecond line\nthird line");@@ -522,7 +522,7 @@ third line`testCase(`bullet button with no selection`,async function (assert, textarea) {- const example = I18n.t("composer.list_item");+ const example = i18n("composer.list_item");await click(`button.bullet`);assert.strictEqual(this.value, `hello world.\n\n* ${example}`);@@ -570,7 +570,7 @@ third line`);testCase(`list button with no selection`, async function (assert, textarea) {- const example = I18n.t("composer.list_item");+ const example = i18n("composer.list_item");await click(`button.list`);assert.strictEqual(this.value, `hello world.\n\n1. ${example}`);diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-toggle-switch-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-toggle-switch-test.jsindex dfcea668ce1..f2be9de98d6 100644--- a/app/assets/javascripts/discourse/tests/integration/components/d-toggle-switch-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/d-toggle-switch-test.js@@ -2,7 +2,7 @@ import { render } from "@ember/test-helpers";import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";module("Integration | Component | d-toggle-switch", function (hooks) {setupRenderingTest(hooks);@@ -43,7 +43,7 @@ module("Integration | Component | d-toggle-switch", function (hooks) {assert.dom(".d-toggle-switch__checkbox-label")- .hasText(I18n.t("test.fooLabel"));+ .hasText(i18n("test.fooLabel"));this.setProperties({label: null,diff --git a/app/assets/javascripts/discourse/tests/integration/components/dialog-holder-test.js b/app/assets/javascripts/discourse/tests/integration/components/dialog-holder-test.jsindex ffcfc38af4a..c12eeafcf5e 100644--- a/app/assets/javascripts/discourse/tests/integration/components/dialog-holder-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/dialog-holder-test.js@@ -11,7 +11,7 @@ import GroupDeleteDialogMessage from "discourse/components/dialog-messages/groupimport SecondFactorConfirmPhrase from "discourse/components/dialog-messages/second-factor-confirm-phrase";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | dialog-holder", function (hooks) {setupRenderingTest(hooks);@@ -150,12 +150,12 @@ module("Integration | Component | dialog-holder", function (hooks) {assert.dom(".dialog-footer .btn-primary")- .hasText(I18n.t("ok_value"), "dialog primary button says Ok");+ .hasText(i18n("ok_value"), "dialog primary button says Ok");assert.dom(".dialog-footer .btn-default").hasText(- I18n.t("cancel_value"),+ i18n("cancel_value"),"dialog second button is present and says No");@@ -207,14 +207,11 @@ module("Integration | Component | dialog-holder", function (hooks) {assert.dom(".dialog-footer .btn-primary")- .hasText(I18n.t("yes_value"), "dialog primary button says Yes");+ .hasText(i18n("yes_value"), "dialog primary button says Yes");assert.dom(".dialog-footer .btn-default")- .hasText(- I18n.t("no_value"),- "dialog second button is present and says No"- );+ .hasText(i18n("no_value"), "dialog second button is present and says No");});test("alert with custom buttons", async function (assert) {@@ -318,7 +315,7 @@ module("Integration | Component | dialog-holder", function (hooks) {assert.dom(".dialog-footer .btn-danger").hasText(- I18n.t("delete"),+ i18n("delete"),"dialog primary button use danger class and label is Delete");@@ -357,7 +354,7 @@ module("Integration | Component | dialog-holder", function (hooks) {await settled();assert.dom(".dialog-body p:first-child").hasText(- I18n.t("admin.groups.delete_with_messages_confirm", {+ i18n("admin.groups.delete_with_messages_confirm", {count: message_count,}),"correct message is shown in dialog"diff --git a/app/assets/javascripts/discourse/tests/integration/components/dismiss-new-test.js b/app/assets/javascripts/discourse/tests/integration/components/dismiss-new-test.jsindex c7f9ae42f75..c8d85633c58 100644--- a/app/assets/javascripts/discourse/tests/integration/components/dismiss-new-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/dismiss-new-test.js@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | modal/dismiss-new", function (hooks) {setupRenderingTest(hooks);@@ -18,7 +18,7 @@ module("Integration | Component | modal/dismiss-new", function (hooks) {assert.dom("#discourse-modal-title")- .hasText(I18n.t("topics.bulk.dismiss_new_modal.title"));+ .hasText(i18n("topics.bulk.dismiss_new_modal.title"));});test("default state", async function (assert) {@@ -46,7 +46,7 @@ module("Integration | Component | modal/dismiss-new", function (hooks) {assert.dom(".dismiss-topics").hasText(- I18n.t("topics.bulk.dismiss_new_modal.topics_with_count", { count: 1 })+ i18n("topics.bulk.dismiss_new_modal.topics_with_count", { count: 1 }));});@@ -65,7 +65,7 @@ module("Integration | Component | modal/dismiss-new", function (hooks) {assert.dom(".dismiss-posts").hasText(- I18n.t("topics.bulk.dismiss_new_modal.replies_with_count", { count: 1 })+ i18n("topics.bulk.dismiss_new_modal.replies_with_count", { count: 1 }));});@@ -79,7 +79,7 @@ module("Integration | Component | modal/dismiss-new", function (hooks) {assert.dom(".dismiss-posts").doesNotExist();assert.dom(".dismiss-topics")- .hasText(I18n.t("topics.bulk.dismiss_new_modal.topics"));+ .hasText(i18n("topics.bulk.dismiss_new_modal.topics"));});test("no selected topics with replies subset", async function (assert) {@@ -92,7 +92,7 @@ module("Integration | Component | modal/dismiss-new", function (hooks) {assert.dom(".dismiss-topics").doesNotExist();assert.dom(".dismiss-posts")- .hasText(I18n.t("topics.bulk.dismiss_new_modal.replies"));+ .hasText(i18n("topics.bulk.dismiss_new_modal.replies"));});test("dismissed", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/integration/components/form-kit/layout/submit-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/form-kit/layout/submit-test.gjsindex 364a29033dd..3a276161156 100644--- a/app/assets/javascripts/discourse/tests/integration/components/form-kit/layout/submit-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/form-kit/layout/submit-test.gjs@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";import { module, test } from "qunit";import Form from "discourse/components/form";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | FormKit | Layout | Submit", function (hooks) {setupRenderingTest(hooks);@@ -23,7 +23,7 @@ module("Integration | Component | FormKit | Layout | Submit", function (hooks) {await click("button");- assert.dom(".form-kit__button.btn-primary").hasText(I18n.t("submit"));+ assert.dom(".form-kit__button.btn-primary").hasText(i18n("submit"));assert.deepEqual(value, 1);});@@ -36,7 +36,7 @@ module("Integration | Component | FormKit | Layout | Submit", function (hooks) {assert.dom(".form-kit__button")- .hasText(I18n.t("cancel"), "it allows to override the label");+ .hasText(i18n("cancel"), "it allows to override the label");});test("@isLoading", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/integration/components/search-menu-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/search-menu-test.gjsindex 92fafffe0a7..19784b976a0 100644--- a/app/assets/javascripts/discourse/tests/integration/components/search-menu-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/search-menu-test.gjs@@ -7,7 +7,7 @@ import searchFixtures from "discourse/tests/fixtures/search-fixtures";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";// Note this isn't a full-fledge test of the search menu. Those tests are in// acceptance/search-test.js. This is simply about the rendering of the@@ -48,7 +48,7 @@ module("Integration | Component | search-menu", function (hooks) {assert.strictEqual(query(".label-suffix").textContent.trim(),- I18n.t("search.in_topics_posts"),+ i18n("search.in_topics_posts"),"search label reflects context of search");diff --git a/app/assets/javascripts/discourse/tests/integration/components/secret-value-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/secret-value-list-test.jsindex 56c37345987..e63711aaea9 100644--- a/app/assets/javascripts/discourse/tests/integration/components/secret-value-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/secret-value-list-test.js@@ -3,7 +3,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | secret-value-list", function (hooks) {setupRenderingTest(hooks);@@ -85,7 +85,7 @@ module("Integration | Component | secret-value-list", function (hooks) {assert.strictEqual(this.message,- I18n.t("admin.site_settings.secret_list.invalid_input"),+ i18n("admin.site_settings.secret_list.invalid_input"),"it shows validation error");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/category-drop-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/category-drop-test.jsindex 2c65d0008e2..6212dd359fc 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/category-drop-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/category-drop-test.js@@ -7,7 +7,7 @@ import DiscourseURL from "discourse/lib/url";import Category from "discourse/models/category";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import {ALL_CATEGORIES_ID,NO_CATEGORIES_ID,@@ -68,7 +68,7 @@ module("Integration | Component | select-kit/category-drop", function (hooks) {const text = this.subject.header().label();assert.strictEqual(text,- I18n.t("categories.categories_label"),+ i18n("categories.categories_label"),"it uses the noneLabel");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.jsindex 3314655765a..e587ec45f0d 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { fakeTime, queryAll } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getOptions() {return Array.from(@@ -40,7 +40,7 @@ module(assert.strictEqual(this.subject.header().label(),- I18n.t("time_shortcut.select_timeframe"),+ i18n("time_shortcut.select_timeframe"),"Default text is rendered");@@ -64,19 +64,19 @@ module(await this.subject.expand();const options = getOptions();const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.later_this_week"),- I18n.t("time_shortcut.start_of_next_business_week_alt"),- I18n.t("time_shortcut.two_weeks"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.two_months"),- I18n.t("time_shortcut.three_months"),- I18n.t("time_shortcut.four_months"),- I18n.t("time_shortcut.six_months"),- I18n.t("time_shortcut.one_year"),- I18n.t("time_shortcut.forever"),- I18n.t("time_shortcut.custom"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.later_this_week"),+ i18n("time_shortcut.start_of_next_business_week_alt"),+ i18n("time_shortcut.two_weeks"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.two_months"),+ i18n("time_shortcut.three_months"),+ i18n("time_shortcut.four_months"),+ i18n("time_shortcut.six_months"),+ i18n("time_shortcut.one_year"),+ i18n("time_shortcut.forever"),+ i18n("time_shortcut.custom"),];assert.deepEqual(options, expected);@@ -87,7 +87,7 @@ module(await this.subject.expand();const options = getOptions();- const customDateAndTime = I18n.t("time_shortcut.custom");+ const customDateAndTime = i18n("time_shortcut.custom");assert.ok(options.includes(customDateAndTime));});@@ -101,7 +101,7 @@ module(await this.subject.expand();const options = getOptions();- const customDateAndTime = I18n.t("time_shortcut.custom");+ const customDateAndTime = i18n("time_shortcut.custom");assert.false(options.includes(customDateAndTime));});@@ -115,7 +115,7 @@ module(await this.subject.expand();const options = getOptions();- const now = I18n.t("time_shortcut.now");+ const now = i18n("time_shortcut.now");assert.ok(options.includes(now));});diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/mini-tag-chooser-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/mini-tag-chooser-test.jsindex 94053f71711..0d12ec7c78e 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/mini-tag-chooser-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/mini-tag-chooser-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query, queryAll } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | select-kit/mini-tag-chooser",@@ -61,7 +61,7 @@ module(const error = query(".select-kit-error").innerText;assert.strictEqual(error,- I18n.t("select_kit.max_content_reached", {+ i18n("select_kit.max_content_reached", {count: this.siteSettings.max_tags_per_topic,}));@@ -79,7 +79,7 @@ module(const error = query(".select-kit-error").innerText;assert.strictEqual(error,- I18n.t("select_kit.max_content_reached", {+ i18n("select_kit.max_content_reached", {count: 0,}));@@ -102,7 +102,7 @@ module(assert.strictEqual(query("input[name=filter-input-search]").placeholder,- I18n.t("tagging.choose_for_topic_required_group", {+ i18n("tagging.choose_for_topic_required_group", {count: 1,name: "monkey group",})@@ -112,7 +112,7 @@ module(assert.strictEqual(query("input[name=filter-input-search]").placeholder,- I18n.t("select_kit.filter_placeholder")+ i18n("select_kit.filter_placeholder"));});diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/single-select-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/single-select-test.jsindex 183d6a7b4ee..526d74eba17 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/single-select-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/single-select-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";const DEFAULT_CONTENT = [{ id: 1, name: "foo" },@@ -232,7 +232,7 @@ module("Integration | Component | select-kit/single-select", function (hooks) {const noneRow = this.subject.rowByIndex(0);assert.strictEqual(noneRow.value(), null);- assert.strictEqual(noneRow.name(), I18n.t("test.none"));+ assert.strictEqual(noneRow.name(), i18n("test.none"));});test("none:object", async function (assert) {@@ -283,8 +283,8 @@ module("Integration | Component | select-kit/single-select", function (hooks) {await this.subject.expand();const noneRow = this.subject.rowByIndex(0);- assert.strictEqual(noneRow.value(), I18n.t("test.none"));- assert.strictEqual(noneRow.name(), I18n.t("test.none"));+ assert.strictEqual(noneRow.value(), i18n("test.none"));+ assert.strictEqual(noneRow.name(), i18n("test.none"));assert.strictEqual(this.value, "foo");await this.subject.selectRowByIndex(0);@@ -427,14 +427,14 @@ module("Integration | Component | select-kit/single-select", function (hooks) {assert.dom(this.subject.header().el())- .hasAttribute("name", I18n.t("select_kit.select_to_filter"));+ .hasAttribute("name", i18n("select_kit.select_to_filter"));await this.subject.expand();await this.subject.selectRowByValue(1);assert.dom(this.subject.header().el()).hasAttribute("name",- I18n.t("select_kit.filter_by", {+ i18n("select_kit.filter_by", {name: this.content.firstObject.name,}));diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/tag-drop-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/tag-drop-test.jsindex d3892cefa8b..e821a136eae 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/tag-drop-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/tag-drop-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function initTags(context) {const categories = context.site.categoriesList;@@ -53,12 +53,12 @@ module("Integration | Component | select-kit/tag-drop", function (hooks) {assert.strictEqual(content[0].name,- I18n.t("tagging.selector_remove_filter"),+ i18n("tagging.selector_remove_filter"),"it has the correct label for removing the tag filter");assert.strictEqual(content[1].name,- I18n.t("tagging.selector_no_tags"),+ i18n("tagging.selector_no_tags"),"it has the translated label for no-tags");diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.gjsindex 28bcf1762a8..a571535be93 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.gjs@@ -4,7 +4,7 @@ import { render, settled } from "@ember/test-helpers";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import TopicNotificationsButton from "select-kit/components/topic-notifications-button";class TestClass {@@ -95,7 +95,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.mailing_list_mode"),+ i18n("topic.notifications.reasons.mailing_list_mode"),"mailing_list_mode enabled for the user shows unique text");});@@ -114,7 +114,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.3"),+ i18n("topic.notifications.reasons.3"),"fallback to regular level translation if reason does not exist");});@@ -134,7 +134,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.2_8"),+ i18n("topic.notifications.reasons.2_8"),"use 2_8 notification if user is still tracking category");});@@ -154,7 +154,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.2_8_stale"),+ i18n("topic.notifications.reasons.2_8_stale"),"use _stale notification if user is no longer tracking category");});@@ -174,7 +174,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.3_6"),+ i18n("topic.notifications.reasons.3_6"),"use 3_6 notification if user is still watching category");});@@ -194,7 +194,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.3_6_stale"),+ i18n("topic.notifications.reasons.3_6_stale"),"use _stale notification if user is no longer watching category");});@@ -214,7 +214,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.3_10"),+ i18n("topic.notifications.reasons.3_10"),"use 3_10 notification if user is still watching tag");});@@ -234,7 +234,7 @@ module(assert.dom(".topic-notifications-button .text").hasText(- I18n.t("topic.notifications.reasons.3_10_stale"),+ i18n("topic.notifications.reasons.3_10_stale"),"use _stale notification if user is no longer watching tag");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-options-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-options-test.gjsindex 80edada0611..83e151fef4b 100644--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-options-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-options-test.gjs@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import TopicNotificationsOptions from "select-kit/components/topic-notifications-options";function extractDescriptions(rows) {@@ -12,7 +12,7 @@ function extractDescriptions(rows) {function getTranslations(type = "") {return ["watching", "tracking", "regular", "muted"].map((key) => {- return I18n.t(`topic.notifications.${key}${type}.description`);+ return i18n(`topic.notifications.${key}${type}.description`);});}diff --git a/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js b/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.jsindex 3ed59c8ccf5..b32442ce792 100644--- a/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/site-setting-test.js@@ -4,7 +4,7 @@ import { module, skip, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | site-setting", function (hooks) {setupRenderingTest(hooks);@@ -164,7 +164,7 @@ module(await fillIn(".file-size-input", "5000");assert.dom(".validation-error").hasText(- I18n.t("file_size_input.error.size_too_large", {+ i18n("file_size_input.error.size_too_large", {provided_file_size: "4.9 GB",max_file_size: "4 MB",}),@@ -188,7 +188,7 @@ module(await fillIn(".file-size-input", "100");assert.dom(".validation-error").hasText(- I18n.t("file_size_input.error.size_too_small", {+ i18n("file_size_input.error.size_too_small", {provided_file_size: "100 KB",min_file_size: "512 KB",}),diff --git a/app/assets/javascripts/discourse/tests/integration/components/text-field-test.js b/app/assets/javascripts/discourse/tests/integration/components/text-field-test.jsindex b63b71098b6..49f4c6c124a 100644--- a/app/assets/javascripts/discourse/tests/integration/components/text-field-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/text-field-test.js@@ -1,9 +1,7 @@import { fillIn, render } from "@ember/test-helpers";import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";-import sinon from "sinon";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";module("Integration | Component | text-field", function (hooks) {setupRenderingTest(hooks);@@ -15,12 +13,12 @@ module("Integration | Component | text-field", function (hooks) {});test("support a placeholder", async function (assert) {- sinon.stub(I18n, "t").returnsArg(0);-await render(hbs`<TextField @placeholderKey="placeholder.i18n.key" />`);assert.dom("input[type=text]").exists();- assert.dom("input").hasAttribute("placeholder", "placeholder.i18n.key");+ assert+ .dom("input")+ .hasAttribute("placeholder", "[en.placeholder.i18n.key]");});test("sets the dir attribute to auto when mixed text direction enabled", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/integration/components/themes-list-item-test.js b/app/assets/javascripts/discourse/tests/integration/components/themes-list-item-test.jsindex b2c60f6c186..216249a5d8b 100644--- a/app/assets/javascripts/discourse/tests/integration/components/themes-list-item-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/themes-list-item-test.js@@ -3,7 +3,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Theme from "admin/models/theme";module("Integration | Component | themes-list-item", function (hooks) {@@ -72,7 +72,7 @@ module("Integration | Component | themes-list-item", function (hooks) {);assert.deepEqual(query(".others-count").innerText.trim(),- I18n.t("admin.customize.theme.and_x_more", { count: 1 }),+ i18n("admin.customize.theme.and_x_more", { count: 1 }),"shows count of remaining children");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/themes-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/themes-list-test.jsindex 0d745126078..b308fc83f33 100644--- a/app/assets/javascripts/discourse/tests/integration/components/themes-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/themes-list-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { queryAll } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Theme, { COMPONENTS, THEMES } from "admin/models/theme";function createThemes(itemsCount, customAttributesCallback) {@@ -89,7 +89,7 @@ module("Integration | Component | themes-list", function (hooks) {assert.dom(".themes-list-container__item span.empty").hasText(- I18n.t("admin.customize.theme.empty"),+ i18n("admin.customize.theme.empty"),"displays the right message");});@@ -136,7 +136,7 @@ module("Integration | Component | themes-list", function (hooks) {assert.dom(".themes-list-container__item span.empty").hasText(- I18n.t("admin.customize.theme.empty"),+ i18n("admin.customize.theme.empty"),"displays the right message");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/time-gap-test.js b/app/assets/javascripts/discourse/tests/integration/components/time-gap-test.jsindex 3aa8d09a0bb..3af84054fea 100644--- a/app/assets/javascripts/discourse/tests/integration/components/time-gap-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/time-gap-test.js@@ -2,7 +2,7 @@ import { render } from "@ember/test-helpers";import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | time-gap", function (hooks) {setupRenderingTest(hooks);@@ -12,7 +12,7 @@ module("Integration | Component | time-gap", function (hooks) {await render(hbs`<TimeGap @daysSince={{this.daysSince}} />`);assert.dom(".small-action-desc.timegap")- .hasText(I18n.t("dates.later.x_days", { count: 5 }));+ .hasText(i18n("dates.later.x_days", { count: 5 }));});test("it renders months correctly", async function (assert) {@@ -20,7 +20,7 @@ module("Integration | Component | time-gap", function (hooks) {await render(hbs`<TimeGap @daysSince={{this.daysSince}} />`);assert.dom(".small-action-desc.timegap")- .hasText(I18n.t("dates.later.x_months", { count: 3 }));+ .hasText(i18n("dates.later.x_months", { count: 3 }));});test("it renders years correctly", async function (assert) {@@ -28,7 +28,7 @@ module("Integration | Component | time-gap", function (hooks) {await render(hbs`<TimeGap @daysSince={{this.daysSince}} />`);assert.dom(".small-action-desc.timegap")- .hasText(I18n.t("dates.later.x_years", { count: 2 }));+ .hasText(i18n("dates.later.x_years", { count: 2 }));});test("it renders the correct elements", async function (assert) {diff --git a/app/assets/javascripts/discourse/tests/integration/components/time-shortcut-picker-test.js b/app/assets/javascripts/discourse/tests/integration/components/time-shortcut-picker-test.jsindex 6df1cef8075..ab3506ba481 100644--- a/app/assets/javascripts/discourse/tests/integration/components/time-shortcut-picker-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/time-shortcut-picker-test.js@@ -7,7 +7,7 @@ import {query,queryAll,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | time-shortcut-picker", function (hooks) {setupRenderingTest(hooks);@@ -33,14 +33,14 @@ module("Integration | Component | time-shortcut-picker", function (hooks) {await render(hbs`<TimeShortcutPicker @_itsatrap={{this.itsatrap}} />`);const expected = [- I18n.t("time_shortcut.later_today"),- I18n.t("time_shortcut.tomorrow"),- I18n.t("time_shortcut.later_this_week"),- I18n.t("time_shortcut.this_weekend"),- I18n.t("time_shortcut.start_of_next_business_week"),- I18n.t("time_shortcut.next_month"),- I18n.t("time_shortcut.custom"),- I18n.t("time_shortcut.none"),+ i18n("time_shortcut.later_today"),+ i18n("time_shortcut.tomorrow"),+ i18n("time_shortcut.later_this_week"),+ i18n("time_shortcut.this_weekend"),+ i18n("time_shortcut.start_of_next_business_week"),+ i18n("time_shortcut.next_month"),+ i18n("time_shortcut.custom"),+ i18n("time_shortcut.none"),];const options = Array.from(diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/bookmarks-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/bookmarks-list-test.jsindex 995e27fa78e..bced760f93c 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/bookmarks-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/bookmarks-list-test.js@@ -5,7 +5,7 @@ import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notificatiimport { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query, queryAll } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | user-menu | bookmarks-list",@@ -33,7 +33,7 @@ module(.dom(".panel-body-bottom .show-all").hasAttribute("title",- I18n.t("user_menu.view_all_bookmarks"),+ i18n("user_menu.view_all_bookmarks"),"has the correct title");});@@ -52,7 +52,7 @@ module(.dom(".panel-body-bottom .notifications-dismiss").hasAttribute("title",- I18n.t("user.dismiss_bookmarks_tooltip"),+ i18n("user.dismiss_bookmarks_tooltip"),"dismiss button has a title");@@ -73,12 +73,12 @@ module(await render(template);assert.strictEqual(query(".empty-state-title").textContent.trim(),- I18n.t("user.no_bookmarks_title"),+ i18n("user.no_bookmarks_title"),"empty state title is shown");assert.strictEqual(query(".empty-state-body").textContent.trim(),- I18n.t("user.no_bookmarks_body", { icon: "" }).trim(),+ i18n("user.no_bookmarks_body", { icon: "" }).trim(),"empty state body is shown");assertdiff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/likes-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/likes-list-test.jsindex 0451c9f8a39..d87d917ba5a 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/likes-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/likes-list-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | user-menu | likes-notifications-list",@@ -21,7 +21,7 @@ module(assert.strictEqual(query(".empty-state-title").textContent.trim(),- I18n.t("user.no_likes_title"),+ i18n("user.no_likes_title"),"empty state title for the likes tab is shown");assertdiff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/menu-item-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/menu-item-test.jsindex 5b48b4523da..aa50fab6965 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/menu-item-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/menu-item-test.js@@ -13,7 +13,7 @@ import PrivateMessagesFixture from "discourse/tests/fixtures/private-messages-fiimport { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON, deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(currentUser, siteSettings, site, overrides = {}) {const notification = Notification.create(@@ -154,7 +154,7 @@ module(assert.dom("li a")- .hasAttribute("title", I18n.t("notifications.titles.mentioned"));+ .hasAttribute("title", i18n("notifications.titles.mentioned"));});test("has elements for label and description", async function (assert) {@@ -598,7 +598,7 @@ module();assert.strictEqual(description.textContent.trim(),- I18n.t("user_menu.reviewable.default_item", {+ i18n("user_menu.reviewable.default_item", {reviewable_id: this.item.reviewable.id,}),"displays the description for the reviewable"@@ -616,7 +616,7 @@ module(const label = query("li .item-label");assert.strictEqual(label.textContent.trim(),- I18n.t("user_menu.reviewable.deleted_user")+ i18n("user_menu.reviewable.deleted_user"));});}diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/messages-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/messages-list-test.jsindex f69f96d6d72..07db8ccf70b 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/messages-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/messages-list-test.js@@ -7,7 +7,7 @@ import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query, queryAll } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON, deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getMessage(overrides = {}) {return deepMerge(@@ -215,7 +215,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {assert.strictEqual(items[0].textContent.trim(),- I18n.t("notifications.group_message_summary", {+ i18n("notifications.group_message_summary", {count: 13,group_name: "jokers",})@@ -228,7 +228,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {assert.strictEqual(items[2].textContent.trim(),- I18n.t("notifications.group_message_summary", {+ i18n("notifications.group_message_summary", {count: 12,group_name: "jokers",})@@ -241,7 +241,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {assert.strictEqual(items[4].textContent.trim(),- I18n.t("notifications.group_message_summary", {+ i18n("notifications.group_message_summary", {count: 11,group_name: "jokers",})@@ -259,7 +259,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {.dom(".panel-body-bottom .show-all").hasAttribute("title",- I18n.t("user_menu.view_all_messages"),+ i18n("user_menu.view_all_messages"),"has the correct title");});@@ -279,7 +279,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {.dom(".panel-body-bottom .notifications-dismiss").hasAttribute("title",- I18n.t("user.dismiss_messages_tooltip"),+ i18n("user.dismiss_messages_tooltip"),"dismiss button has a title");@@ -306,7 +306,7 @@ module("Integration | Component | user-menu | messages-list", function (hooks) {assert.strictEqual(query(".empty-state-title").textContent.trim(),- I18n.t("user.no_messages_title"),+ i18n("user.no_messages_title"),"empty state title is shown");assertdiff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/notifications-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/notifications-list-test.jsindex ae15071207c..653d08b2859 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/notifications-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/notifications-list-test.js@@ -7,7 +7,7 @@ import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query, queryAll } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotificationsData() {return cloneJSON(NotificationFixtures["/notifications"].notifications);@@ -71,7 +71,7 @@ module(.dom(".panel-body-bottom .btn.show-all").hasAttribute("title",- I18n.t("user_menu.view_all_notifications"),+ i18n("user_menu.view_all_notifications"),"has the correct title");});@@ -86,14 +86,14 @@ module();assert.strictEqual(dismissButton.textContent.trim(),- I18n.t("user.dismiss"),+ i18n("user.dismiss"),"dismiss button has a label");assert.dom(".panel-body-bottom .btn.notifications-dismiss").hasAttribute("title",- I18n.t("user.dismiss_notifications_tooltip"),+ i18n("user.dismiss_notifications_tooltip"),"dismiss button has title attribute");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/other-notifications-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/other-notifications-list-test.jsindex fbc41a9ca79..7e8faefa911 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/other-notifications-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/other-notifications-list-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | user-menu | other-notifications-list",@@ -24,7 +24,7 @@ module(assert.dom(".empty-state .empty-state-body").exists();assert.strictEqual(query(".empty-state .empty-state-title").textContent.trim(),- I18n.t("user.no_other_notifications_title")+ i18n("user.no_other_notifications_title"));});}diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/replies-notifications-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/replies-notifications-list-test.jsindex 99fac0669c8..fbc80ae288e 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/replies-notifications-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/replies-notifications-list-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | user-menu | replies-notifications-list",@@ -24,7 +24,7 @@ module(assert.dom(".empty-state .empty-state-body").exists();assert.strictEqual(query(".empty-state .empty-state-title").textContent.trim(),- I18n.t("user.no_notifications_title")+ i18n("user.no_notifications_title"));});}diff --git a/app/assets/javascripts/discourse/tests/integration/components/user-menu/reviewables-list-test.js b/app/assets/javascripts/discourse/tests/integration/components/user-menu/reviewables-list-test.jsindex 285abdcfaa2..8a6922698a2 100644--- a/app/assets/javascripts/discourse/tests/integration/components/user-menu/reviewables-list-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/user-menu/reviewables-list-test.js@@ -3,7 +3,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { queryAll } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | user-menu | reviewables-list",@@ -18,7 +18,7 @@ module(.dom(".panel-body-bottom .show-all").hasAttribute("title",- I18n.t("user_menu.reviewable.view_all"),+ i18n("user_menu.reviewable.view_all"),"has the correct title");});diff --git a/app/assets/javascripts/discourse/tests/integration/components/watched-word-uploader-test.js b/app/assets/javascripts/discourse/tests/integration/components/watched-word-uploader-test.jsindex fcbe158b2ca..95fa6f8c605 100644--- a/app/assets/javascripts/discourse/tests/integration/components/watched-word-uploader-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/watched-word-uploader-test.js@@ -6,7 +6,7 @@ import sinon from "sinon";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { createFile } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | watched-word-uploader", function (hooks) {setupRenderingTest(hooks);@@ -32,7 +32,7 @@ module("Integration | Component | watched-word-uploader", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("admin.watched_words.form.upload_successful")+ i18n("admin.watched_words.form.upload_successful")),"alert shown");diff --git a/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test-with-glimmer-post-menu-test.js b/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test-with-glimmer-post-menu-test.jsindex d9571ab238d..550bc71ee22 100644--- a/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test-with-glimmer-post-menu-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test-with-glimmer-post-menu-test.js@@ -10,7 +10,7 @@ import {query,queryAll,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | Widget | post with glimmer-post-menu",@@ -727,7 +727,7 @@ module(assert.strictEqual(query(".post-notice.returning-user:not(.old)").innerText.trim(),- I18n.t("post.notice.returning_user", {+ i18n("post.notice.returning_user", {user: "codinghorror",time: "2 days ago",})@@ -750,7 +750,7 @@ module(assert.strictEqual(query(".post-notice.old.new-user").innerText.trim(),- I18n.t("post.notice.new_user", { user: "Jeff", time: "Jan '10" })+ i18n("post.notice.new_user", { user: "Jeff", time: "Jan '10" }));});@@ -764,10 +764,7 @@ module(<MountWidget @widget="post" @model={{this.post}} @args={{this.args}} />`);const link = query(".group-request a");- assert.strictEqual(- link.innerText.trim(),- I18n.t("groups.requests.handle")- );+ assert.strictEqual(link.innerText.trim(), i18n("groups.requests.handle"));assert.strictEqual(link.getAttribute("href"),"/g/testGroup/requests?filter=foo"diff --git a/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test.js b/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test.jsindex f7f137598fc..b637dba6720 100644--- a/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test.js+++ b/app/assets/javascripts/discourse/tests/integration/components/widgets/post-test.js@@ -7,7 +7,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Integration | Component | Widget | post", function (hooks) {setupRenderingTest(hooks);@@ -302,7 +302,7 @@ module("Integration | Component | Widget | post", function (hooks) {.dom("button.like").hasAttribute("title",- I18n.t("post.controls.like"),+ i18n("post.controls.like"),"shows the right button title for anonymous users");@@ -377,7 +377,7 @@ module("Integration | Component | Widget | post", function (hooks) {.dom("button.delete").hasAttribute("title",- I18n.t("post.controls.delete_topic_disallowed"),+ i18n("post.controls.delete_topic_disallowed"),"shows the right button title for users without permissions");});@@ -1115,7 +1115,7 @@ module("Integration | Component | Widget | post", function (hooks) {<MountWidget @widget="post" @args={{this.args}} />`);assert.dom(".post-notice.returning-user:not(.old)").hasText(- I18n.t("post.notice.returning_user", {+ i18n("post.notice.returning_user", {user: "codinghorror",time: "2 days ago",})@@ -1138,9 +1138,7 @@ module("Integration | Component | Widget | post", function (hooks) {assert.dom(".post-notice.old.new-user")- .hasText(- I18n.t("post.notice.new_user", { user: "Jeff", time: "Jan '10" })- );+ .hasText(i18n("post.notice.new_user", { user: "Jeff", time: "Jan '10" }));});test("show group request in post", async function (assert) {@@ -1153,7 +1151,7 @@ module("Integration | Component | Widget | post", function (hooks) {<MountWidget @widget="post" @args={{this.args}} />`);const link = query(".group-request a");- assert.strictEqual(link.innerText.trim(), I18n.t("groups.requests.handle"));+ assert.strictEqual(link.innerText.trim(), i18n("groups.requests.handle"));assert.dom(".group-request a").hasAttribute("href", "/g/testGroup/requests?filter=foo");diff --git a/app/assets/javascripts/discourse/tests/unit/components/create-account-test.js b/app/assets/javascripts/discourse/tests/unit/components/create-account-test.jsindex dd355e4f575..7de9f4ce77a 100644--- a/app/assets/javascripts/discourse/tests/unit/components/create-account-test.js+++ b/app/assets/javascripts/discourse/tests/unit/components/create-account-test.js@@ -2,7 +2,7 @@ import { getOwner } from "@ember/owner";import { settled } from "@ember/test-helpers";import { setupTest } from "ember-qunit";import { module, test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Unit | Component | create-account", function (hooks) {setupTest(hooks);@@ -23,10 +23,10 @@ module("Unit | Component | create-account", function (hooks) {};testInvalidUsername("", null);- testInvalidUsername("x", I18n.t("user.username.too_short"));+ testInvalidUsername("x", i18n("user.username.too_short"));testInvalidUsername("123456789012345678901",- I18n.t("user.username.too_long")+ i18n("user.username.too_long"));const component = this.owner@@ -38,7 +38,7 @@ module("Unit | Component | create-account", function (hooks) {assert.true(validation.ok, "Prefilled username is valid");assert.strictEqual(validation.reason,- I18n.t("user.username.prefilled"),+ i18n("user.username.prefilled"),"Prefilled username is valid");});@@ -58,7 +58,7 @@ module("Unit | Component | create-account", function (hooks) {assert.true(component.passwordValidation.ok, "Password is ok");assert.strictEqual(component.passwordValidation.reason,- I18n.t("user.password.ok"),+ i18n("user.password.ok"),"Password is valid");@@ -80,18 +80,12 @@ module("Unit | Component | create-account", function (hooks) {testInvalidPassword("", null);testInvalidPassword("x",- I18n.t("user.password.too_short", {+ i18n("user.password.too_short", {count: siteSettings.min_password_length,}));- testInvalidPassword(- "porkchops123",- I18n.t("user.password.same_as_username")- );- testInvalidPassword(- "[email protected]",- I18n.t("user.password.same_as_email")- );+ testInvalidPassword("porkchops123", i18n("user.password.same_as_username"));+ testInvalidPassword("[email protected]", i18n("user.password.same_as_email"));// Wait for username check request to finishawait settled();@@ -104,7 +98,7 @@ module("Unit | Component | create-account", function (hooks) {assert.strictEqual(component.authProviderDisplayName("facebook"),- I18n.t("login.facebook.name"),+ i18n("login.facebook.name"),"provider name is translated correctly");diff --git a/app/assets/javascripts/discourse/tests/unit/lib/computed-test.js b/app/assets/javascripts/discourse/tests/unit/lib/computed-test.jsindex a84dde8ee02..b54240fb8e0 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/computed-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/computed-test.js@@ -2,32 +2,20 @@ import EmberObject from "@ember/object";import { getOwner } from "@ember/owner";import { setupTest } from "ember-qunit";import { module, test } from "qunit";-import sinon from "sinon";import {+ computedI18n,fmt,htmlSafe,- i18n,propertyEqual,propertyNotEqual,setting,url,} from "discourse/lib/computed";import { setPrefix } from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";module("Unit | Utility | computed", function (hooks) {setupTest(hooks);- hooks.beforeEach(function () {- sinon.stub(I18n, "t").callsFake(function (scope) {- return "%@ translated: " + scope;- });- });-- hooks.afterEach(function () {- I18n.t.restore();- });-test("setting", function (assert) {const siteSettings = getOwner(this).lookup("service:site-settings");@@ -116,8 +104,8 @@ module("Unit | Utility | computed", function (hooks) {test("i18n", function (assert) {// eslint-disable-next-line ember/no-classic-classeslet t = EmberObject.extend({- exclaimyUsername: i18n("username", "!!! %@ !!!"),- multiple: i18n("username", "mood", "%@ is %@"),+ exclaimyUsername: computedI18n("username", "!!! %@ !!!"),+ multiple: computedI18n("username", "mood", "%@ is %@"),}).create({username: "eviltrout",mood: "happy",@@ -125,25 +113,25 @@ module("Unit | Utility | computed", function (hooks) {assert.strictEqual(t.exclaimyUsername,- "%@ translated: !!! eviltrout !!!",+ "[en.!!! eviltrout !!!]","it inserts the string and then translates");assert.strictEqual(t.multiple,- "%@ translated: eviltrout is happy",+ "[en.eviltrout is happy]","it inserts multiple strings and then translates");t.set("username", "codinghorror");assert.strictEqual(t.multiple,- "%@ translated: codinghorror is happy",+ "[en.codinghorror is happy]","it supports changing properties");t.set("mood", "ecstatic");assert.strictEqual(t.multiple,- "%@ translated: codinghorror is ecstatic",+ "[en.codinghorror is ecstatic]","it supports changing another property");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/form-kit/validator-test.js b/app/assets/javascripts/discourse/tests/unit/lib/form-kit/validator-test.jsindex 1d594146e29..90e8254b036 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/form-kit/validator-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/form-kit/validator-test.js@@ -1,7 +1,7 @@import { setupTest } from "ember-qunit";import { module, test } from "qunit";import Validator from "discourse/form-kit/lib/validator";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Unit | Lib | FormKit | Validator", function (hooks) {setupTest(hooks);@@ -24,7 +24,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,[- I18n.t("form_kit.errors.too_short", {+ i18n("form_kit.errors.too_short", {count: 1,}),],@@ -37,7 +37,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,[- I18n.t("form_kit.errors.too_long", {+ i18n("form_kit.errors.too_long", {count: 5,}),],@@ -62,7 +62,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,[- I18n.t("form_kit.errors.too_low", {+ i18n("form_kit.errors.too_low", {count: 1,}),],@@ -75,7 +75,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,[- I18n.t("form_kit.errors.too_high", {+ i18n("form_kit.errors.too_high", {count: 5,}),],@@ -99,7 +99,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,- [I18n.t("form_kit.errors.not_an_integer")],+ [i18n("form_kit.errors.not_an_integer")],"it returns an error when the value is not an integer");@@ -118,7 +118,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,- [I18n.t("form_kit.errors.not_a_number")],+ [i18n("form_kit.errors.not_a_number")],"it returns an error when the value is not a number");@@ -137,7 +137,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,- [I18n.t("form_kit.errors.invalid_url")],+ [i18n("form_kit.errors.invalid_url")],"it returns an error when the value is not a valid URL");@@ -157,7 +157,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {}).validate();assert.deepEqual(errors,- [I18n.t("form_kit.errors.not_accepted")],+ [i18n("form_kit.errors.not_accepted")],"it returns an error when the value is not accepted");@@ -204,7 +204,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {assert.deepEqual(errors,- [I18n.t("form_kit.errors.required")],+ [i18n("form_kit.errors.required")],"it returns an error when the value is empty spaces with trim");@@ -223,7 +223,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {}).validate("input-number");assert.deepEqual(errors,- [I18n.t("form_kit.errors.required")],+ [i18n("form_kit.errors.required")],"it returns an error when the value is undefined");@@ -232,7 +232,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {}).validate("input-number");assert.deepEqual(errors,- [I18n.t("form_kit.errors.required")],+ [i18n("form_kit.errors.required")],"it returns an error when the value is not a number");@@ -255,7 +255,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {}).validate("question");assert.deepEqual(errors,- [I18n.t("form_kit.errors.required")],+ [i18n("form_kit.errors.required")],"it returns an error when the value is undefined");@@ -264,7 +264,7 @@ module("Unit | Lib | FormKit | Validator", function (hooks) {}).validate("menu");assert.deepEqual(errors,- [I18n.t("form_kit.errors.required")],+ [i18n("form_kit.errors.required")],"it returns an error when the value is undefined");diff --git a/app/assets/javascripts/discourse/tests/unit/lib/i18n-test.js b/app/assets/javascripts/discourse/tests/unit/lib/i18n-test.jsindex 9f068bef4fe..4c2c22d29da 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/i18n-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/i18n-test.js@@ -1,7 +1,7 @@import { setupTest } from "ember-qunit";import { module, test } from "qunit";import { withSilencedDeprecations } from "discourse-common/lib/deprecated";-import I18n, { I18nMissingInterpolationArgument } from "discourse-i18n";+import I18n, { i18n, I18nMissingInterpolationArgument } from "discourse-i18n";module("Unit | Utility | i18n", function (hooks) {setupTest(hooks);@@ -124,21 +124,21 @@ module("Unit | Utility | i18n", function (hooks) {test("translations", function (assert) {assert.strictEqual(- I18n.t("topic.reply.title"),+ i18n("topic.reply.title"),"Répondre","uses locale translations when they exist");assert.strictEqual(- I18n.t("topic.reply.help"),+ i18n("topic.reply.help"),"begin composing a reply to this topic","fallbacks to English translations");assert.strictEqual(- I18n.t("hello.world"),+ i18n("hello.world"),"Hello World!","doesn't break if a key is overridden in a locale");- assert.strictEqual(I18n.t("hello.universe"), "", "allows empty strings");+ assert.strictEqual(i18n("hello.universe"), "", "allows empty strings");});test("extra translations", function (assert) {@@ -183,86 +183,86 @@ module("Unit | Utility | i18n", function (hooks) {};assert.strictEqual(- I18n.t("admin.dashboard.title"),+ i18n("admin.dashboard.title"),"Raporty","it uses extra translations when they exists");assert.strictEqual(- I18n.t("admin.web_hooks.events.incoming", { count: 2 }),+ i18n("admin.web_hooks.events.incoming", { count: 2 }),"Istnieją 2 nowe wydarzenia.","it uses pluralized extra translation when it exists");assert.strictEqual(- I18n.t("admin.dashboard.backup_count", { count: 2 }),+ i18n("admin.dashboard.backup_count", { count: 2 }),"2 backups","it falls back to English and uses extra translations when they exists");});test("pluralizations", function (assert) {- assert.strictEqual(I18n.t("character_count", { count: 0 }), "0 ZERO");- assert.strictEqual(I18n.t("character_count", { count: 1 }), "1 ONE");- assert.strictEqual(I18n.t("character_count", { count: 2 }), "2 TWO");- assert.strictEqual(I18n.t("character_count", { count: 3 }), "3 FEW");- assert.strictEqual(I18n.t("character_count", { count: 10 }), "10 MANY");- assert.strictEqual(I18n.t("character_count", { count: 100 }), "100 OTHER");-- assert.strictEqual(I18n.t("word_count", { count: 0 }), "0 words");- assert.strictEqual(I18n.t("word_count", { count: 1 }), "1 word");- assert.strictEqual(I18n.t("word_count", { count: 2 }), "2 words");- assert.strictEqual(I18n.t("word_count", { count: 3 }), "3 words");- assert.strictEqual(I18n.t("word_count", { count: 10 }), "10 words");- assert.strictEqual(I18n.t("word_count", { count: 100 }), "100 words");+ assert.strictEqual(i18n("character_count", { count: 0 }), "0 ZERO");+ assert.strictEqual(i18n("character_count", { count: 1 }), "1 ONE");+ assert.strictEqual(i18n("character_count", { count: 2 }), "2 TWO");+ assert.strictEqual(i18n("character_count", { count: 3 }), "3 FEW");+ assert.strictEqual(i18n("character_count", { count: 10 }), "10 MANY");+ assert.strictEqual(i18n("character_count", { count: 100 }), "100 OTHER");++ assert.strictEqual(i18n("word_count", { count: 0 }), "0 words");+ assert.strictEqual(i18n("word_count", { count: 1 }), "1 word");+ assert.strictEqual(i18n("word_count", { count: 2 }), "2 words");+ assert.strictEqual(i18n("word_count", { count: 3 }), "3 words");+ assert.strictEqual(i18n("word_count", { count: 10 }), "10 words");+ assert.strictEqual(i18n("word_count", { count: 100 }), "100 words");I18n.locale = "ja";assert.strictEqual(- I18n.t("topic_stat_sentence_week", { count: 0 }),+ i18n("topic_stat_sentence_week", { count: 0 }),"先週、新しいトピックが 0 件投稿されました。");assert.strictEqual(- I18n.t("topic_stat_sentence_week", { count: 1 }),+ i18n("topic_stat_sentence_week", { count: 1 }),"先週、新しいトピックが 1 件投稿されました。");assert.strictEqual(- I18n.t("topic_stat_sentence_week", { count: 2 }),+ i18n("topic_stat_sentence_week", { count: 2 }),"先週、新しいトピックが 2 件投稿されました。");});test("adds the count to the missing translation strings", function (assert) {assert.strictEqual(- I18n.t("invalid_i18n_string", { count: 1 }),+ i18n("invalid_i18n_string", { count: 1 }),`[fr.invalid_i18n_string count=1]`);assert.strictEqual(- I18n.t("character_count", { count: "0" }),+ i18n("character_count", { count: "0" }),`[fr.character_count count="0"]`);assert.strictEqual(- I18n.t("character_count", { count: null }),+ i18n("character_count", { count: null }),`[fr.character_count count=null]`);assert.strictEqual(- I18n.t("character_count", { count: undefined }),+ i18n("character_count", { count: undefined }),`[fr.character_count count=undefined]`);- assert.strictEqual(I18n.t("character_count"), "[fr.character_count]");+ assert.strictEqual(i18n("character_count"), "[fr.character_count]");});test("fallback", function (assert) {assert.strictEqual(- I18n.t("days", { count: 1 }),+ i18n("days", { count: 1 }),"1 day","uses fallback locale for missing plural key");assert.strictEqual(- I18n.t("days", { count: 200 }),+ i18n("days", { count: 200 }),"200 jours","uses existing French plural key");@@ -271,17 +271,17 @@ module("Unit | Utility | i18n", function (hooks) {I18n.fallbackLocale = "fr";assert.strictEqual(- I18n.t("topic.reply.title"),+ i18n("topic.reply.title"),"Foo","uses locale translations when they exist");assert.strictEqual(- I18n.t("topic.share.title"),+ i18n("topic.share.title"),"Partager","falls back to fallbackLocale translations when they exist");assert.strictEqual(- I18n.t("topic.reply.help"),+ i18n("topic.reply.help"),"begin composing a reply to this topic","falls back to English translations");@@ -289,7 +289,7 @@ module("Unit | Utility | i18n", function (hooks) {test("Dollar signs are properly escaped", function (assert) {assert.strictEqual(- I18n.t("dollar_sign", {+ i18n("dollar_sign", {description: "$& $&",}),"Hi $& $&"@@ -298,7 +298,7 @@ module("Unit | Utility | i18n", function (hooks) {test("Customized missing translation string", function (assert) {assert.strictEqual(- I18n.t("emoji_picker.customtest", {+ i18n("emoji_picker.customtest", {translatedFallback: "customtest",}),"customtest"@@ -314,7 +314,7 @@ module("Unit | Utility | i18n", function (hooks) {test("missing interpolation argument does not throw error when I18n.testing is `false`", function (assert) {assert.strictEqual(- I18n.t("with_multiple_interpolate_arguments", { username: "username" }),+ i18n("with_multiple_interpolate_arguments", { username: "username" }),"Hi username, [missing %{username2} value]");});@@ -324,7 +324,7 @@ module("Unit | Utility | i18n", function (hooks) {I18n.testing = true;assert.throws(function () {- I18n.t("with_multiple_interpolate_arguments", {+ i18n("with_multiple_interpolate_arguments", {username: "username",});}, new I18nMissingInterpolationArgument(diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/bookmark-reminder-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/bookmark-reminder-test.jsindex b087f92687a..80bcf2352d8 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/bookmark-reminder-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/bookmark-reminder-test.js@@ -5,7 +5,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -47,7 +47,7 @@ module("Unit | Notification Types | bookmark-reminder", function (hooks) {);assert.strictEqual(director.linkTitle,- I18n.t("notifications.titles.bookmark_reminder_with_name", {+ i18n("notifications.titles.bookmark_reminder_with_name", {name: "My awesome bookmark",}),"content includes the bookmark name when the bookmark has a name"diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/granted-badge-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/granted-badge-test.jsindex dfaa9301fec..991638928dd 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/granted-badge-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/granted-badge-test.js@@ -4,7 +4,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -54,7 +54,7 @@ module("Unit | Notification Types | granted-badge", function (hooks) {);assert.strictEqual(director.description,- I18n.t("notifications.granted_badge", { description: "Badge 15" }),+ i18n("notifications.granted_badge", { description: "Badge 15" }),"contains the right content");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/group-message-summary-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/group-message-summary-test.jsindex 49bf97d4253..4a6773d6c91 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/group-message-summary-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/group-message-summary-test.js@@ -4,7 +4,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -40,7 +40,7 @@ module("Unit | Notification Types | group-message-summary", function (hooks) {);assert.strictEqual(director.description,- I18n.t("notifications.group_message_summary", {+ i18n("notifications.group_message_summary", {group_name: "drummers",count: 13,}),diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-consolidated-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-consolidated-test.jsindex 410e401b9f4..7a7ea5cc3de 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-consolidated-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-consolidated-test.js@@ -4,7 +4,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -57,7 +57,7 @@ module("Unit | Notification Types | liked-consolidated", function (hooks) {);assert.strictEqual(director.description,- I18n.t("notifications.liked_consolidated_description", { count: 44 }),+ i18n("notifications.liked_consolidated_description", { count: 44 }),"displays the right content");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-test.jsindex 1eefe91f23e..68ca2e6229a 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/liked-test.js@@ -4,7 +4,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -46,7 +46,7 @@ module("Unit | Notification Types | liked", function (hooks) {notification.data.count = 2;assert.strictEqual(director.label,- I18n.t("notifications.liked_by_2_users", {+ i18n("notifications.liked_by_2_users", {username: "osama",username2: "shrek",}),@@ -56,7 +56,7 @@ module("Unit | Notification Types | liked", function (hooks) {notification.data.count = 3;assert.strictEqual(director.label,- I18n.t("notifications.liked_by_multiple_users", {+ i18n("notifications.liked_by_multiple_users", {username: "osama",count: 2,}),diff --git a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/linked-consolidated-test.js b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/linked-consolidated-test.jsindex 6b254536fcc..ff0d7449cea 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/notification-types/linked-consolidated-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/notification-types/linked-consolidated-test.js@@ -4,7 +4,7 @@ import Notification from "discourse/models/notification";import { NOTIFICATION_TYPES } from "discourse/tests/fixtures/concerns/notification-types";import { createRenderDirector } from "discourse/tests/helpers/notification-types-helper";import { deepMerge } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getNotification(overrides = {}) {return Notification.create(@@ -57,7 +57,7 @@ module("Unit | Notification Types | linked-consolidated", function (hooks) {);assert.strictEqual(director.description,- I18n.t("notifications.linked_consolidated_description", { count: 44 }),+ i18n("notifications.linked_consolidated_description", { count: 44 }),"displays the right content");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/flagged-post-test.js b/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/flagged-post-test.jsindex 23ed18a7c52..d9e6f4d270c 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/flagged-post-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/flagged-post-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { emojiUnescape } from "discourse/lib/text";import UserMenuReviewable from "discourse/models/user-menu-reviewable";import { createRenderDirector } from "discourse/tests/helpers/reviewable-types-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getReviewable(overrides = {}) {return UserMenuReviewable.create(@@ -37,7 +37,7 @@ module("Unit | Reviewable Items | flagged-post", function (hooks) {assert.deepEqual(director.description,htmlSafe(- I18n.t("user_menu.reviewable.post_number_with_topic_title", {+ i18n("user_menu.reviewable.post_number_with_topic_title", {title: `This is safe title <a> ${emojiUnescape(":heart:")}`,post_number: 1,})@@ -49,7 +49,7 @@ module("Unit | Reviewable Items | flagged-post", function (hooks) {delete reviewable.post_number;assert.deepEqual(director.description,- I18n.t("user_menu.reviewable.deleted_post"),+ i18n("user_menu.reviewable.deleted_post"),"falls back to generic string when the post/topic is deleted");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/queued-post-test.js b/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/queued-post-test.jsindex 632714c0b33..d6651319ece 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/queued-post-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/reviewable-types/queued-post-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { emojiUnescape } from "discourse/lib/text";import UserMenuReviewable from "discourse/models/user-menu-reviewable";import { createRenderDirector } from "discourse/tests/helpers/reviewable-types-helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function getReviewable(overrides = {}) {return UserMenuReviewable.create(@@ -36,7 +36,7 @@ module("Unit | Reviewable Items | queued-post", function (hooks) {assert.deepEqual(director.description,htmlSafe(- I18n.t("user_menu.reviewable.new_post_in_topic", {+ i18n("user_menu.reviewable.new_post_in_topic", {title: `This is safe title <a> ${emojiUnescape(":heart:")}`,})),@@ -48,7 +48,7 @@ module("Unit | Reviewable Items | queued-post", function (hooks) {assert.deepEqual(director.description,htmlSafe(- I18n.t("user_menu.reviewable.new_post_in_topic", {+ i18n("user_menu.reviewable.new_post_in_topic", {title: `This is unsafe title <a> ${emojiUnescape(":heart:")}`,})),diff --git a/app/assets/javascripts/discourse/tests/unit/lib/uploads-test.js b/app/assets/javascripts/discourse/tests/unit/lib/uploads-test.jsindex df1aabfba34..94133f0ed3c 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/uploads-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/uploads-test.js@@ -12,7 +12,7 @@ import {isImage,validateUploadedFiles,} from "discourse/lib/uploads";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";module("Unit | Utility | uploads", function (hooks) {setupTest(hooks);@@ -43,7 +43,7 @@ module("Unit | Utility | uploads", function (hooks) {assert.false(validateUploadedFiles([1, 2], { siteSettings: this.siteSettings }));- assert.ok(dialog.alert.calledWith(I18n.t("post.errors.too_many_uploads")));+ assert.ok(dialog.alert.calledWith(i18n("post.errors.too_many_uploads")));});test("new user cannot upload images", function (assert) {@@ -59,7 +59,7 @@ module("Unit | Utility | uploads", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("post.errors.image_upload_not_allowed_for_new_user")+ i18n("post.errors.image_upload_not_allowed_for_new_user")),"the alert is called");@@ -102,7 +102,7 @@ module("Unit | Utility | uploads", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("post.errors.attachment_upload_not_allowed_for_new_user")+ i18n("post.errors.attachment_upload_not_allowed_for_new_user")));});@@ -116,7 +116,7 @@ module("Unit | Utility | uploads", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("post.errors.upload_not_authorized", {+ i18n("post.errors.upload_not_authorized", {authorized_extensions: authorizedExtensions(false,this.siteSettings@@ -156,7 +156,7 @@ module("Unit | Utility | uploads", function (hooks) {}));assert.ok(- dialog.alert.calledWith(I18n.t("post.errors.no_uploads_authorized"))+ dialog.alert.calledWith(i18n("post.errors.no_uploads_authorized")));});@@ -172,7 +172,7 @@ module("Unit | Utility | uploads", function (hooks) {}));assert.ok(- dialog.alert.calledWith(I18n.t("post.errors.no_uploads_authorized"))+ dialog.alert.calledWith(i18n("post.errors.no_uploads_authorized")));});@@ -362,7 +362,7 @@ module("Unit | Utility | uploads", function (hooks) {jqXHR: {status: 413,responseJSON: {- message: I18n.t("post.errors.file_too_large_humanized"),+ message: i18n("post.errors.file_too_large_humanized"),},},},@@ -371,7 +371,7 @@ module("Unit | Utility | uploads", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("post.errors.file_too_large_humanized", {+ i18n("post.errors.file_too_large_humanized", {max_size: I18n.toHumanSize(4096 * 1024),})),@@ -385,14 +385,14 @@ module("Unit | Utility | uploads", function (hooks) {{jqXHR: {status: 413,- responseJSON: { message: I18n.t("post.errors.backup_too_large") },+ responseJSON: { message: i18n("post.errors.backup_too_large") },},},{ max_attachment_size_kb: 4096, max_image_size_kb: 4096 },"backup-2023-09-07-092329-v20230728055813.tar.gz");assert.ok(- dialog.alert.calledWith(I18n.t("post.errors.backup_too_large")),+ dialog.alert.calledWith(i18n("post.errors.backup_too_large")),"the alert is called");});@@ -433,7 +433,7 @@ module("Unit | Utility | uploads", function (hooks) {);assert.ok(dialog.alert.calledWith(- I18n.t("post.errors.upload", { file_name: "test.png" })+ i18n("post.errors.upload", { file_name: "test.png" })),"the alert is called");diff --git a/app/assets/javascripts/discourse/tests/unit/localization-test.js b/app/assets/javascripts/discourse/tests/unit/localization-test.jsindex 566f6c1a6b8..023614ec5e7 100644--- a/app/assets/javascripts/discourse/tests/unit/localization-test.js+++ b/app/assets/javascripts/discourse/tests/unit/localization-test.js@@ -1,7 +1,7 @@import { setupTest } from "ember-qunit";import { module, test } from "qunit";import LocalizationInitializer from "discourse/instance-initializers/localization";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";module("initializer:localization", function (hooks) {setupTest(hooks);@@ -78,25 +78,25 @@ module("initializer:localization", function (hooks) {LocalizationInitializer.initialize(this.owner);assert.strictEqual(- I18n.t("composer.both_languages1"),+ i18n("composer.both_languages1"),"composer.both_languages1 (FR override)","overrides existing translation in current locale");assert.strictEqual(- I18n.t("composer.only_english1"),+ i18n("composer.only_english1"),"composer.only_english1 (EN override)","overrides translation in fallback locale");assert.strictEqual(- I18n.t("composer.only_english2"),+ i18n("composer.only_english2"),"composer.only_english2 (FR override)","overrides translation that doesn't exist in current locale");assert.strictEqual(- I18n.t("composer.both_languages2"),+ i18n("composer.both_languages2"),"composer.both_languages2 (FR)","prefers translation in current locale over override in fallback locale");@@ -121,31 +121,31 @@ module("initializer:localization", function (hooks) {LocalizationInitializer.initialize(this.owner);assert.strictEqual(- I18n.t("admin.api.both_languages1"),+ i18n("admin.api.both_languages1"),"admin.api.both_languages1 (FR override)","overrides existing translation in current locale");assert.strictEqual(- I18n.t("admin.api.only_english1"),+ i18n("admin.api.only_english1"),"admin.api.only_english1 (EN override)","overrides translation in fallback locale");assert.strictEqual(- I18n.t("admin.api.only_english2"),+ i18n("admin.api.only_english2"),"admin.api.only_english2 (FR override)","overrides translation that doesn't exist in current locale");assert.strictEqual(- I18n.t("admin.api.both_languages2"),+ i18n("admin.api.both_languages2"),"admin.api.both_languages2 (FR)","prefers translation in current locale over override in fallback locale");assert.strictEqual(- I18n.t("type_to_filter"),+ i18n("type_to_filter"),"type_to_filter (FR override)","correctly changes the translation key by removing `admin_js`");@@ -161,7 +161,7 @@ module("initializer:localization", function (hooks) {LocalizationInitializer.initialize(this.owner);assert.strictEqual(- I18n.t("composer.both_languages1.foo"),+ i18n("composer.both_languages1.foo"),"[fr.composer.both_languages1.foo]");});diff --git a/app/assets/javascripts/discourse/tests/unit/models/user-drafts-test.js b/app/assets/javascripts/discourse/tests/unit/models/user-drafts-test.jsindex 8cdf553d940..9a9e38ad26f 100644--- a/app/assets/javascripts/discourse/tests/unit/models/user-drafts-test.js+++ b/app/assets/javascripts/discourse/tests/unit/models/user-drafts-test.js@@ -2,7 +2,7 @@ import { getOwner } from "@ember/owner";import { setupTest } from "ember-qunit";import { module, test } from "qunit";import { NEW_TOPIC_KEY } from "discourse/models/composer";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";module("Unit | Model | user-draft", function (hooks) {setupTest(hooks);@@ -36,7 +36,7 @@ module("Unit | Model | user-draft", function (hooks) {assert.strictEqual(drafts.length, 2, "drafts count is right");assert.strictEqual(drafts[1].draftType,- I18n.t("drafts.new_topic"),+ i18n("drafts.new_topic"),"loads correct draftType label");});diff --git a/app/assets/javascripts/pretty-text/addon/upload-short-url.js b/app/assets/javascripts/pretty-text/addon/upload-short-url.jsindex 55338061fa7..e8ebc08a24d 100644--- a/app/assets/javascripts/pretty-text/addon/upload-short-url.js+++ b/app/assets/javascripts/pretty-text/addon/upload-short-url.js@@ -1,6 +1,6 @@import { Promise } from "rsvp";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _cache = {};@@ -80,7 +80,7 @@ function retrieveCachedUrl(context.strokeRect(0, 0, canvas.width, canvas.height);let fontSize = 25;- const text = I18n.t("image_removed");+ const text = i18n("image_removed");// Fill text size to fit the canvaslet textSize;diff --git a/app/assets/javascripts/select-kit/addon/components/bulk-select-bookmarks-dropdown.js b/app/assets/javascripts/select-kit/addon/components/bulk-select-bookmarks-dropdown.jsindex da98f1291a7..920c96a4103 100644--- a/app/assets/javascripts/select-kit/addon/components/bulk-select-bookmarks-dropdown.js+++ b/app/assets/javascripts/select-kit/addon/components/bulk-select-bookmarks-dropdown.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";import { popupAjaxError } from "discourse/lib/ajax-error";import Bookmark from "discourse/models/bookmark";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "./select-kit";diff --git a/app/assets/javascripts/select-kit/addon/components/categories-admin-dropdown.js b/app/assets/javascripts/select-kit/addon/components/categories-admin-dropdown.jsindex 8cf9044c711..4408a89b62a 100644--- a/app/assets/javascripts/select-kit/addon/components/categories-admin-dropdown.js+++ b/app/assets/javascripts/select-kit/addon/components/categories-admin-dropdown.js@@ -1,6 +1,6 @@import { computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";@@ -20,16 +20,16 @@ export default class CategoriesAdminDropdown extends DropdownSelectBoxComponentconst items = [{id: "create",- name: I18n.t("category.create"),- description: I18n.t("category.create_long"),+ name: i18n("category.create"),+ description: i18n("category.create_long"),icon: "plus",},];items.push({id: "reorder",- name: I18n.t("categories.reorder.title"),- description: I18n.t("categories.reorder.title_long"),+ name: i18n("categories.reorder.title"),+ description: i18n("categories.reorder.title_long"),icon: "shuffle",});diff --git a/app/assets/javascripts/select-kit/addon/components/category-chooser.js b/app/assets/javascripts/select-kit/addon/components/category-chooser.jsindex 31f75d57cc5..2d16ea3e2a8 100644--- a/app/assets/javascripts/select-kit/addon/components/category-chooser.js+++ b/app/assets/javascripts/select-kit/addon/components/category-chooser.js@@ -6,7 +6,7 @@ import { categoryBadgeHTML } from "discourse/helpers/category-link";import { setting } from "discourse/lib/computed";import Category from "discourse/models/category";import PermissionType from "discourse/models/permission-type";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import CategoryRow from "select-kit/components/category-row";import ComboBoxComponent from "select-kit/components/combo-box";import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";@@ -53,9 +53,7 @@ export default class CategoryChooser extends ComboBoxComponent {const isString = typeof none === "string";return this.defaultItem(null,- htmlSafe(- I18n.t(isString ? this.selectKit.options.none : "category.none")- )+ htmlSafe(i18n(isString ? this.selectKit.options.none : "category.none")));} else if (this.selectKit.options.allowUncategorized) {return Category.findUncategorized();@@ -65,7 +63,7 @@ export default class CategoryChooser extends ComboBoxComponent {10);if (!defaultCategoryId || defaultCategoryId < 0) {- return this.defaultItem(null, htmlSafe(I18n.t("category.choose")));+ return this.defaultItem(null, htmlSafe(i18n("category.choose")));}}}diff --git a/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs b/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjsindex dcc84e42c2f..23ea8868f0d 100644--- a/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs+++ b/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs@@ -3,7 +3,7 @@ import { hash } from "@ember/helper";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import {ALL_CATEGORIES_ID,NO_CATEGORIES_ID,diff --git a/app/assets/javascripts/select-kit/addon/components/category-drop.js b/app/assets/javascripts/select-kit/addon/components/category-drop.jsindex 08f368cd84a..7d0b0f18349 100644--- a/app/assets/javascripts/select-kit/addon/components/category-drop.js+++ b/app/assets/javascripts/select-kit/addon/components/category-drop.js@@ -9,7 +9,7 @@ import DiscourseURL, {getEditCategoryUrl,} from "discourse/lib/url";import Category from "discourse/models/category";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import CategoryDropMoreCollection from "select-kit/components/category-drop-more-collection";import CategoryRow from "select-kit/components/category-row";import ComboBoxComponent from "select-kit/components/combo-box";@@ -50,7 +50,7 @@ export default class CategoryDrop extends ComboBoxComponent {@readOnly("selectKit.options.parentCategory.displayName") parentCategoryName;@setting("allow_uncategorized_topics") allowUncategorized;- noCategoriesLabel = I18n.t("categories.no_subcategories");+ noCategoriesLabel = i18n("categories.no_subcategories");navigateToEdit = false;editingCategory = false;editingCategoryTab = null;@@ -114,7 +114,7 @@ export default class CategoryDrop extends ComboBoxComponent {// If there is a single shortcut, we can have a single "remove filter" optionif (shortcuts.length === 1 && shortcuts[0].id === ALL_CATEGORIES_ID) {- shortcuts[0].name = I18n.t("categories.remove_filter");+ shortcuts[0].name = i18n("categories.remove_filter");}return shortcuts;@@ -130,14 +130,14 @@ export default class CategoryDrop extends ComboBoxComponent {if (this.selectKit.options.noSubcategories) {return this.defaultItem(NO_CATEGORIES_ID,- I18n.t("categories.no_subcategories")+ i18n("categories.no_subcategories"));} else {return this.defaultItem(ALL_CATEGORIES_ID,this.selectKit.options.subCategory- ? I18n.t("categories.subcategories_label")- : I18n.t("categories.categories_label")+ ? i18n("categories.subcategories_label")+ : i18n("categories.categories_label"));}}@@ -165,12 +165,12 @@ export default class CategoryDrop extends ComboBoxComponent {}if (this.selectKit.options.subCategory) {- return I18n.t("categories.remove_filter", {+ return i18n("categories.remove_filter", {categoryName: this.parentCategoryName,});}- return I18n.t("categories.all");+ return i18n("categories.all");}async search(filter) {diff --git a/app/assets/javascripts/select-kit/addon/components/category-notifications-button.js b/app/assets/javascripts/select-kit/addon/components/category-notifications-button.jsindex b26e4c9b51a..d6a2ad55904 100644--- a/app/assets/javascripts/select-kit/addon/components/category-notifications-button.js+++ b/app/assets/javascripts/select-kit/addon/components/category-notifications-button.js@@ -1,13 +1,13 @@import { readOnly } from "@ember/object/computed";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import NotificationOptionsComponent from "select-kit/components/notifications-button";import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";@selectKitOptions({i18nPrefix: "category.notifications",showFullTitle: false,- headerAriaLabel: I18n.t("category.notifications.title"),+ headerAriaLabel: i18n("category.notifications.title"),})@pluginApiIdentifiers(["category-notifications-button"])@classNames("category-notifications-button")diff --git a/app/assets/javascripts/select-kit/addon/components/color-palettes.js b/app/assets/javascripts/select-kit/addon/components/color-palettes.jsindex 7d5c06c62ae..14683ec1a11 100644--- a/app/assets/javascripts/select-kit/addon/components/color-palettes.js+++ b/app/assets/javascripts/select-kit/addon/components/color-palettes.js@@ -1,11 +1,11 @@import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ComboBoxComponent from "select-kit/components/combo-box";import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";@classNames("color-palettes")@selectKitOptions({- translatedNone: I18n.t("admin.customize.theme.default_light_scheme"),+ translatedNone: i18n("admin.customize.theme.default_light_scheme"),})@pluginApiIdentifiers(["color-palettes"])export default class ColorPalettes extends ComboBoxComponent {diff --git a/app/assets/javascripts/select-kit/addon/components/composer-actions.js b/app/assets/javascripts/select-kit/addon/components/composer-actions.jsindex ba780b19c63..6f0e3452213 100644--- a/app/assets/javascripts/select-kit/addon/components/composer-actions.js+++ b/app/assets/javascripts/select-kit/addon/components/composer-actions.js@@ -14,7 +14,7 @@ import {} from "discourse/models/composer";import Draft from "discourse/models/draft";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { pluginApiIdentifiers, selectKitOptions } from "./select-kit";@@ -129,10 +129,10 @@ export default class ComposerActions extends DropdownSelectBoxComponent {_topicSnapshot) {items.push({- name: I18n.t(+ name: i18n("composer.composer_actions.reply_as_new_group_message.label"),- description: I18n.t(+ description: i18n("composer.composer_actions.reply_as_new_group_message.desc"),icon: "plus",@@ -151,10 +151,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {_topicSnapshot) {items.push({- name: I18n.t("composer.composer_actions.reply_as_new_topic.label"),- description: I18n.t(- "composer.composer_actions.reply_as_new_topic.desc"- ),+ name: i18n("composer.composer_actions.reply_as_new_topic.label"),+ description: i18n("composer.composer_actions.reply_as_new_topic.desc"),icon: "plus",id: "reply_as_new_topic",});@@ -167,10 +165,10 @@ export default class ComposerActions extends DropdownSelectBoxComponent {!(this.replyOptions.userAvatar && this.replyOptions.userLink))) {items.push({- name: I18n.t("composer.composer_actions.reply_to_post.label", {+ name: i18n("composer.composer_actions.reply_to_post.label", {postUsername: _postSnapshot.username,}),- description: I18n.t("composer.composer_actions.reply_to_post.desc"),+ description: i18n("composer.composer_actions.reply_to_post.desc"),icon: "share",id: "reply_to_post",});@@ -186,8 +184,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {this.replyOptions.topicLink))) {items.push({- name: I18n.t("composer.composer_actions.reply_to_topic.label"),- description: I18n.t("composer.composer_actions.reply_to_topic.desc"),+ name: i18n("composer.composer_actions.reply_to_topic.label"),+ description: i18n("composer.composer_actions.reply_to_topic.desc"),icon: "share",id: "reply_to_topic",});@@ -201,8 +199,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {_postSnapshot.post_type !== this.site.post_types.whisper)) {items.push({- name: I18n.t("composer.composer_actions.toggle_whisper.label"),- description: I18n.t("composer.composer_actions.toggle_whisper.desc"),+ name: i18n("composer.composer_actions.toggle_whisper.label"),+ description: i18n("composer.composer_actions.toggle_whisper.desc"),icon: "far-eye-slash",id: "toggle_whisper",});@@ -212,8 +210,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {if (this.site.shared_drafts_category_id) {// Shared Drafts Choiceitems.push({- name: I18n.t("composer.composer_actions.shared_draft.label"),- description: I18n.t("composer.composer_actions.shared_draft.desc"),+ name: i18n("composer.composer_actions.shared_draft.label"),+ description: i18n("composer.composer_actions.shared_draft.desc"),icon: "far-clipboard",id: "shared_draft",});@@ -226,8 +224,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {if (this.action === REPLY && showToggleTopicBump) {items.push({- name: I18n.t("composer.composer_actions.toggle_topic_bump.label"),- description: I18n.t("composer.composer_actions.toggle_topic_bump.desc"),+ name: i18n("composer.composer_actions.toggle_topic_bump.label"),+ description: i18n("composer.composer_actions.toggle_topic_bump.desc"),icon: "anchor",id: "toggle_topic_bump",});@@ -235,8 +233,8 @@ export default class ComposerActions extends DropdownSelectBoxComponent {if (items.length === 0 && this.currentUser.can_create_topic) {items.push({- name: I18n.t("composer.composer_actions.create_topic.label"),- description: I18n.t("composer.composer_actions.create_topic.desc"),+ name: i18n("composer.composer_actions.create_topic.label"),+ description: i18n("composer.composer_actions.create_topic.desc"),icon: "share",id: "create_topic",});@@ -255,7 +253,7 @@ export default class ComposerActions extends DropdownSelectBoxComponent {url = `${location.protocol}//${location.host}${url}`;const link = `[${escapeExpression(topicTitle)}](${url})`;- return I18n.t("post.continue_discussion", {+ return i18n("post.continue_discussion", {postLink: link,});}@@ -314,9 +312,7 @@ export default class ComposerActions extends DropdownSelectBoxComponent {Draft.get("new_topic").then((response) => {if (response.draft) {this.dialog.confirm({- message: I18n.t(- "composer.composer_actions.reply_as_new_topic.confirm"- ),+ message: i18n("composer.composer_actions.reply_as_new_topic.confirm"),confirmButtonLabel: "composer.ok_proceed",didConfirm: () => this._replyAsNewTopicSelect(options),});diff --git a/app/assets/javascripts/select-kit/addon/components/filter-for-more.gjs b/app/assets/javascripts/select-kit/addon/components/filter-for-more.gjsindex d003bda0180..e8ffd5bd636 100644--- a/app/assets/javascripts/select-kit/addon/components/filter-for-more.gjs+++ b/app/assets/javascripts/select-kit/addon/components/filter-for-more.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const FilterForMore = <template>{{#if @collection.content.shouldShowMoreTip}}diff --git a/app/assets/javascripts/select-kit/addon/components/group-dropdown.js b/app/assets/javascripts/select-kit/addon/components/group-dropdown.jsindex 5f0913330bc..d037f27dd6b 100644--- a/app/assets/javascripts/select-kit/addon/components/group-dropdown.js+++ b/app/assets/javascripts/select-kit/addon/components/group-dropdown.js@@ -3,7 +3,7 @@ import { gte, reads } from "@ember/object/computed";import { classNames } from "@ember-decorators/component";import { setting } from "discourse/lib/computed";import DiscourseURL from "discourse/lib/url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ComboBoxComponent from "select-kit/components/combo-box";import {pluginApiIdentifiers,@@ -30,7 +30,7 @@ export default class GroupDropdown extends ComboBoxComponent {const shortcuts = [];if (this.enableGroupDirectory || this.get("currentUser.staff")) {- shortcuts.push(I18n.t("groups.index.all"));+ shortcuts.push(i18n("groups.index.all"));}return shortcuts.concat(this.groups);diff --git a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.jsindex ba700b02ee8..18b4bbd984a 100644--- a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js+++ b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser.js@@ -7,7 +7,7 @@ import {} from "@ember-decorators/component";import { setting } from "discourse/lib/computed";import { makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import MultiSelectComponent from "select-kit/components/multi-select";import {pluginApiIdentifiers,@@ -53,12 +53,12 @@ export default class MiniTagChooser extends MultiSelectComponent.extend(if (this.selectKit.options.minimum > 0) {return this.defaultItem(null,- I18n.t("tagging.choose_for_topic_required", {+ i18n("tagging.choose_for_topic_required", {count: this.selectKit.options.minimum,}));} else {- return this.defaultItem(null, I18n.t("tagging.choose_for_topic"));+ return this.defaultItem(null, i18n("tagging.choose_for_topic"));}}@@ -85,7 +85,7 @@ export default class MiniTagChooser extends MultiSelectComponent.extend(const maximum = this.selectKit.options.maximum;if (maximum === 0) {const key = "select_kit.max_content_reached";- this.addError(I18n.t(key, { count: maximum }));+ this.addError(i18n(key, { count: maximum }));return [];}@@ -125,7 +125,7 @@ export default class MiniTagChooser extends MultiSelectComponent.extend(if (json.required_tag_group) {context.set("selectKit.options.translatedFilterPlaceholder",- I18n.t("tagging.choose_for_topic_required_group", {+ i18n("tagging.choose_for_topic_required_group", {count: json.required_tag_group.min_count,name: json.required_tag_group.name,})diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-button.js b/app/assets/javascripts/select-kit/addon/components/notifications-button.jsindex dd75dbf9ac2..cc4311c7bce 100644--- a/app/assets/javascripts/select-kit/addon/components/notifications-button.js+++ b/app/assets/javascripts/select-kit/addon/components/notifications-button.js@@ -1,7 +1,7 @@import { computed, setProperties } from "@ember/object";import { classNames } from "@ember-decorators/component";import { allLevels, buttonDetails } from "discourse/lib/notification-levels";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -22,7 +22,7 @@ export default class NotificationsButton extends DropdownSelectBoxComponent {getTitle(key) {const { i18nPrefix, i18nPostfix } = this.selectKit.options;- return I18n.t(`${i18nPrefix}.${key}${i18nPostfix}.title`);+ return i18n(`${i18nPrefix}.${key}${i18nPostfix}.title`);}modifyComponentForRow(_, content) {diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js b/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.jsindex 4f4e2e71c3a..d68fea1b916 100644--- a/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js+++ b/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js@@ -2,7 +2,7 @@ import { computed } from "@ember/object";import { readOnly } from "@ember/object/computed";import { classNames } from "@ember-decorators/component";import { escapeExpression } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";@classNames("notifications-button-row")@@ -12,7 +12,7 @@ export default class NotificationsButtonRow extends DropdownSelectBoxRowComponen@computed("_start")get label() {- return escapeExpression(I18n.t(`${this._start}.title`));+ return escapeExpression(i18n(`${this._start}.title`));}@computed("item.icon")@@ -26,7 +26,7 @@ export default class NotificationsButtonRow extends DropdownSelectBoxRowComponenreturn null;}- return escapeExpression(I18n.t(`${this._start}.description`));+ return escapeExpression(i18n(`${this._start}.description`));}@computed("i18nPrefix", "i18nPostfix", "rowName")diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-filter.js b/app/assets/javascripts/select-kit/addon/components/notifications-filter.jsindex a7babf8bb57..e48aa72a6e8 100644--- a/app/assets/javascripts/select-kit/addon/components/notifications-filter.js+++ b/app/assets/javascripts/select-kit/addon/components/notifications-filter.js@@ -1,6 +1,6 @@import { computed } from "@ember/object";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -16,15 +16,15 @@ export default class NotificationsFilter extends DropdownSelectBoxComponent {return [{id: "all",- label: I18n.t("user.user_notifications.filters.all"),+ label: i18n("user.user_notifications.filters.all"),},{id: "read",- label: I18n.t("user.user_notifications.filters.read"),+ label: i18n("user.user_notifications.filters.read"),},{id: "unread",- label: I18n.t("user.user_notifications.filters.unread"),+ label: i18n("user.user_notifications.filters.unread"),},];}diff --git a/app/assets/javascripts/select-kit/addon/components/period-chooser.js b/app/assets/javascripts/select-kit/addon/components/period-chooser.jsindex b714079bf55..dc1251a7892 100644--- a/app/assets/javascripts/select-kit/addon/components/period-chooser.js+++ b/app/assets/javascripts/select-kit/addon/components/period-chooser.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import { oneWay, readOnly } from "@ember/object/computed";import { classNameBindings, classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -13,7 +13,7 @@ import { selectKitOptions } from "select-kit/components/select-kit";fullDay: "fullDay",customStyle: true,headerComponent: "period-chooser/period-chooser-header",- headerAriaLabel: I18n.t("period_chooser.aria_label"),+ headerAriaLabel: i18n("period_chooser.aria_label"),})export default class PeriodChooser extends DropdownSelectBoxComponent {@oneWay("site.periods") content;diff --git a/app/assets/javascripts/select-kit/addon/components/period-chooser/period-chooser-row.js b/app/assets/javascripts/select-kit/addon/components/period-chooser/period-chooser-row.jsindex 058474f02d4..094f4c6775f 100644--- a/app/assets/javascripts/select-kit/addon/components/period-chooser/period-chooser-row.js+++ b/app/assets/javascripts/select-kit/addon/components/period-chooser/period-chooser-row.js@@ -1,12 +1,12 @@import { classNames } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxRowComponent from "select-kit/components/dropdown-select-box/dropdown-select-box-row";@classNames("period-chooser-row")export default class PeriodChooserRow extends DropdownSelectBoxRowComponent {@discourseComputed("rowName")title(rowName) {- return I18n.t(`filters.top.${rowName || "this_week"}`).title;+ return i18n(`filters.top.${rowName || "this_week"}`).title;}}diff --git a/app/assets/javascripts/select-kit/addon/components/pinned-button.js b/app/assets/javascripts/select-kit/addon/components/pinned-button.jsindex 55b209772a2..1b82e6110e2 100644--- a/app/assets/javascripts/select-kit/addon/components/pinned-button.js+++ b/app/assets/javascripts/select-kit/addon/components/pinned-button.js@@ -1,7 +1,7 @@import Component from "@ember/component";import { classNameBindings, classNames } from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { pluginApiIdentifiers } from "select-kit/components/select-kit";@classNames("pinned-button")@@ -15,7 +15,7 @@ export default class PinnedButton extends Component {const globally = pinnedGlobally ? "_globally" : "";const pinnedKey = pinned ? `pinned${globally}` : "unpinned";const key = `topic_statuses.${pinnedKey}.help`;- return I18n.t(key);+ return i18n(key);}@discourseComputed("pinned", "topic.deleted", "topic.unpinned")diff --git a/app/assets/javascripts/select-kit/addon/components/pinned-options.js b/app/assets/javascripts/select-kit/addon/components/pinned-options.jsindex 35d7ed098ad..c0ff7be80c1 100644--- a/app/assets/javascripts/select-kit/addon/components/pinned-options.js+++ b/app/assets/javascripts/select-kit/addon/components/pinned-options.js@@ -1,7 +1,7 @@import { action, computed } from "@ember/object";import { htmlSafe } from "@ember/template";import { classNames } from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -22,7 +22,7 @@ export default class PinnedOptions extends DropdownSelectBoxComponent {const pinned = this.value;const globally = pinnedGlobally ? "_globally" : "";const state = pinned ? `pinned${globally}` : UNPINNED;- const title = I18n.t(`topic_statuses.${state}.title`);+ const title = i18n(`topic_statuses.${state}.title`);content.label = htmlSafe(`<span>${title}</span>`);content.title = title;@@ -38,19 +38,19 @@ export default class PinnedOptions extends DropdownSelectBoxComponent {return [{id: PINNED,- name: I18n.t(`topic_statuses.pinned${globally}.title`),+ name: i18n(`topic_statuses.pinned${globally}.title`),description: this.site.mobileView? null- : I18n.t(`topic_statuses.pinned${globally}.help`),+ : i18n(`topic_statuses.pinned${globally}.help`),icon: "thumbtack",},{id: UNPINNED,- name: I18n.t("topic_statuses.unpinned.title"),+ name: i18n("topic_statuses.unpinned.title"),icon: "thumbtack unpinned",description: this.site.mobileView? null- : I18n.t("topic_statuses.unpinned.help"),+ : i18n("topic_statuses.unpinned.help"),},];}diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit.js b/app/assets/javascripts/select-kit/addon/components/select-kit.jsindex 47781705427..bdb72f3151a 100644--- a/app/assets/javascripts/select-kit/addon/components/select-kit.js+++ b/app/assets/javascripts/select-kit/addon/components/select-kit.js@@ -16,7 +16,7 @@ import discourseDebounce from "discourse-common/lib/debounce";import deprecated from "discourse-common/lib/deprecated";import { makeArray } from "discourse-common/lib/helpers";import { bind as bindDecorator } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import {applyContentPluginApiCallbacks,applyOnChangePluginApiCallbacks,@@ -406,7 +406,7 @@ export default class SelectKit extends Component.extend(UtilsMixin) {if (maximum && selection.length >= maximum) {const key =this.selectKit.options.maximumLabel || "select_kit.max_content_reached";- this.addError(I18n.t(key, { count: maximum }));+ this.addError(i18n(key, { count: maximum }));return false;}@@ -563,7 +563,7 @@ export default class SelectKit extends Component.extend(UtilsMixin) {let item;switch (typeof none) {case "string":- item = this.defaultItem(null, I18n.t(none));+ item = this.defaultItem(null, i18n(none));break;default:item = none;diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-filter.js b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-filter.jsindex 888d115967a..4de87a063c3 100644--- a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-filter.js+++ b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-filter.js@@ -8,7 +8,7 @@ import {classNames,} from "@ember-decorators/component";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import UtilsMixin from "select-kit/mixins/utils";@classNames("select-kit-filter")@@ -41,10 +41,10 @@ export default class SelectKitFilter extends Component.extend(UtilsMixin) {}if (isPresent(placeholder)) {- return I18n.t(placeholder);+ return i18n(placeholder);}- return I18n.t(+ return i18n(this.selectKit.options.allowAny? "select_kit.filter_placeholder_with_any": "select_kit.filter_placeholder"diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-row.js b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-row.jsindex 4528d95bf5d..5907b5770ae 100644--- a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-row.js+++ b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-row.js@@ -10,7 +10,7 @@ import {tagName,} from "@ember-decorators/component";import { makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import UtilsMixin from "select-kit/mixins/utils";@classNames("select-kit-row")@@ -97,7 +97,7 @@ export default class SelectKitRow extends Component.extend(UtilsMixin) {this.getName(this.selectKit.noneItem) !== this.rowName &&this.getName(this.selectKit.newItem) === this.rowName) {- return I18n.t("select_kit.create", { content: label });+ return i18n("select_kit.create", { content: label });}return label;}diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit/single-select-header.js b/app/assets/javascripts/select-kit/addon/components/select-kit/single-select-header.jsindex 267ce36c426..29a7433aa84 100644--- a/app/assets/javascripts/select-kit/addon/components/select-kit/single-select-header.js+++ b/app/assets/javascripts/select-kit/addon/components/select-kit/single-select-header.js@@ -5,7 +5,7 @@ import {classNames,tagName,} from "@ember-decorators/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";@tagName("summary")@@ -27,11 +27,11 @@ export default class SingleSelectHeader extends SelectKitHeaderComponent {@computed("selectedContent.name")get name() {if (this.selectedContent) {- return I18n.t("select_kit.filter_by", {+ return i18n("select_kit.filter_by", {name: this.getName(this.selectedContent),});} else {- return I18n.t("select_kit.select_to_filter");+ return i18n("select_kit.select_to_filter");}}}diff --git a/app/assets/javascripts/select-kit/addon/components/tag-drop.js b/app/assets/javascripts/select-kit/addon/components/tag-drop.jsindex 4ac19de23e4..52519efb95e 100644--- a/app/assets/javascripts/select-kit/addon/components/tag-drop.js+++ b/app/assets/javascripts/select-kit/addon/components/tag-drop.js@@ -4,7 +4,7 @@ import { classNameBindings, classNames } from "@ember-decorators/component";import { setting } from "discourse/lib/computed";import DiscourseURL, { getCategoryAndTagUrl } from "discourse/lib/url";import { makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ComboBoxComponent from "select-kit/components/combo-box";import FilterForMore from "select-kit/components/filter-for-more";import {@@ -71,15 +71,15 @@ export default class TagDrop extends ComboBoxComponent.extend(TagsMixin) {modifyNoSelection() {if (this.tagId === NONE_TAG) {- return this.defaultItem(NO_TAG_ID, I18n.t("tagging.selector_no_tags"));+ return this.defaultItem(NO_TAG_ID, i18n("tagging.selector_no_tags"));} else {- return this.defaultItem(ALL_TAGS_ID, I18n.t("tagging.selector_tags"));+ return this.defaultItem(ALL_TAGS_ID, i18n("tagging.selector_tags"));}}modifySelection(content) {if (this.tagId === NONE_TAG) {- content = this.defaultItem(NO_TAG_ID, I18n.t("tagging.selector_no_tags"));+ content = this.defaultItem(NO_TAG_ID, i18n("tagging.selector_no_tags"));} else if (this.tagId) {content = this.defaultItem(this.tagId, this.tagId);}@@ -103,21 +103,21 @@ export default class TagDrop extends ComboBoxComponent.extend(TagsMixin) {if (this.tagId) {shortcuts.push({id: ALL_TAGS_ID,- name: I18n.t("tagging.selector_remove_filter"),+ name: i18n("tagging.selector_remove_filter"),});}if (this.tagId !== NONE_TAG) {shortcuts.push({id: NO_TAG_ID,- name: I18n.t("tagging.selector_no_tags"),+ name: i18n("tagging.selector_no_tags"),});}// If there is a single shortcut, we can have a single "remove filter"// optionif (shortcuts.length === 1 && shortcuts[0].id === ALL_TAGS_ID) {- shortcuts[0].name = I18n.t("tagging.selector_remove_filter");+ shortcuts[0].name = i18n("tagging.selector_remove_filter");}return shortcuts;diff --git a/app/assets/javascripts/select-kit/addon/components/toolbar-popup-menu-options.js b/app/assets/javascripts/select-kit/addon/components/toolbar-popup-menu-options.jsindex 8c388f1364a..d3ed77c8d1a 100644--- a/app/assets/javascripts/select-kit/addon/components/toolbar-popup-menu-options.js+++ b/app/assets/javascripts/select-kit/addon/components/toolbar-popup-menu-options.js@@ -1,7 +1,7 @@import { classNames } from "@ember-decorators/component";import { PLATFORM_KEY_MODIFIER } from "discourse/lib/keyboard-shortcuts";import { translateModKey } from "discourse/lib/utilities";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";import {pluginApiIdentifiers,@@ -24,7 +24,7 @@ export default class ToolbarPopupMenuOptions extends DropdownSelectBoxComponentif (content.condition) {let label;if (content.label) {- label = I18n.t(content.label);+ label = i18n(content.label);if (content.shortcut) {label += ` <kbd class="shortcut">${translateModKey(PLATFORM_KEY_MODIFIER + "+" + content.shortcut@@ -34,7 +34,7 @@ export default class ToolbarPopupMenuOptions extends DropdownSelectBoxComponentlet title;if (content.title) {- title = I18n.t(content.title);+ title = i18n(content.title);if (content.shortcut) {title += ` (${translateModKey(PLATFORM_KEY_MODIFIER + "+" + content.shortcut@@ -44,7 +44,7 @@ export default class ToolbarPopupMenuOptions extends DropdownSelectBoxComponentlet name = content.name;if (!name && content.label) {- name = I18n.t(content.label);+ name = i18n(content.label);}return {diff --git a/app/assets/javascripts/select-kit/addon/components/topic-notifications-button.gjs b/app/assets/javascripts/select-kit/addon/components/topic-notifications-button.gjsindex 6b2223602cd..3618346afc1 100644--- a/app/assets/javascripts/select-kit/addon/components/topic-notifications-button.gjs+++ b/app/assets/javascripts/select-kit/addon/components/topic-notifications-button.gjs@@ -6,9 +6,8 @@ import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import { NotificationLevels } from "discourse/lib/notification-levels";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import TopicNotificationsOptions from "select-kit/components/topic-notifications-options";export default class TopicNotificationsButton extends Component {@@ -43,9 +42,9 @@ export default class TopicNotificationsButton extends Component {this.currentUser?.user_option.mailing_list_mode &&level > NotificationLevels.MUTED) {- return I18n.t("topic.notifications.reasons.mailing_list_mode");+ return i18n("topic.notifications.reasons.mailing_list_mode");} else {- return I18n.t(localeString, {+ return i18n(localeString, {username: this.currentUser?.username_lower,basePath: getURL(""),});diff --git a/app/assets/javascripts/select-kit/addon/components/user-notifications-dropdown.js b/app/assets/javascripts/select-kit/addon/components/user-notifications-dropdown.jsindex 1202a5ee4f4..489536f2de8 100644--- a/app/assets/javascripts/select-kit/addon/components/user-notifications-dropdown.js+++ b/app/assets/javascripts/select-kit/addon/components/user-notifications-dropdown.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";import IgnoreDurationModal from "discourse/components/modal/ignore-duration-with-username";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DropdownSelectBox from "select-kit/components/dropdown-select-box";import { selectKitOptions } from "select-kit/components/select-kit";@@ -30,23 +30,23 @@ export default class UserNotificationsDropdown extends DropdownSelectBox {content.push({icon: "bell",id: "changeToNormal",- description: I18n.t("user.user_notifications.normal_option_title"),- name: I18n.t("user.user_notifications.normal_option"),+ description: i18n("user.user_notifications.normal_option_title"),+ name: i18n("user.user_notifications.normal_option"),});content.push({icon: "bell-slash",id: "changeToMuted",- description: I18n.t("user.user_notifications.mute_option_title"),- name: I18n.t("user.user_notifications.mute_option"),+ description: i18n("user.user_notifications.mute_option_title"),+ name: i18n("user.user_notifications.mute_option"),});if (this.get("user.can_ignore_user")) {content.push({icon: "far-eye-slash",id: "changeToIgnored",- description: I18n.t("user.user_notifications.ignore_option_title"),- name: I18n.t("user.user_notifications.ignore_option"),+ description: i18n("user.user_notifications.ignore_option_title"),+ name: i18n("user.user_notifications.ignore_option"),});}diff --git a/app/assets/javascripts/select-kit/addon/mixins/tags.js b/app/assets/javascripts/select-kit/addon/mixins/tags.jsindex 15470dee002..a1a2b7bdb33 100644--- a/app/assets/javascripts/select-kit/addon/mixins/tags.js+++ b/app/assets/javascripts/select-kit/addon/mixins/tags.js@@ -4,7 +4,7 @@ import { isEmpty } from "@ember/utils";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { makeArray } from "discourse-common/lib/helpers";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default Mixin.create({searchTags(url, data, callback) {@@ -27,7 +27,7 @@ export default Mixin.create({const maximum = this.selectKit.options.maximum;if (maximum && makeArray(this.value).length >= parseInt(maximum, 10)) {this.addError(- I18n.t("select_kit.max_content_reached", {+ i18n("select_kit.max_content_reached", {count: parseInt(maximum, 10),}));diff --git a/eslint.config.mjs b/eslint.config.mjsindex 86d71cc93c3..e2719b865db 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -5,6 +5,8 @@ export default [{rules: {"ember/no-classic-classes": "error",+ "discourse/i18n-import-location": "error",+ "discourse/i18n-t": "error",},},{diff --git a/lib/pretty_text/shims.js b/lib/pretty_text/shims.jsindex 39ef88ef09c..864c83be03b 100644--- a/lib/pretty_text/shims.js+++ b/lib/pretty_text/shims.js@@ -10,6 +10,7 @@ define("I18n", ["exports"], function (exports) {define("discourse-i18n", ["exports"], function (exports) {exports.default = I18n;+ exports.i18n = I18n.t;});define("discourse-common/lib/helpers", ["exports"], function (exports) {diff --git a/plugins/automation/admin/assets/javascripts/admin/components/automation-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/automation-field.gjsindex 9aeb2db0237..6558863b9d6 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/automation-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/automation-field.gjs@@ -1,5 +1,5 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import I18n, { i18n } from 'discourse-i18n';import DaBooleanField from "./fields/da-boolean-field";import DaCategoriesField from "./fields/da-categories-field";import DaCategoryField from "./fields/da-category-field";@@ -68,7 +68,7 @@ export default class AutomationField extends Component {}get label() {- return I18n.t(+ return i18n(`discourse_automation${this.target}fields.${this.args.field.name}.label`);}diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-choices-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-choices-field.gjsindex e3e8130df2f..301ec742db2 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-choices-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-choices-field.gjs@@ -1,5 +1,5 @@import { hash } from "@ember/helper";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ComboBox from "select-kit/components/combo-box";import BaseField from "./da-base-field";import DAFieldDescription from "./da-field-description";@@ -31,7 +31,7 @@ export default class ChoicesField extends BaseField {return (this.args.field.extra.content || []).map((r) => {return {id: r.id,- name: r.translated_name || I18n.t(r.name),+ name: r.translated_name || i18n(r.name),};});}diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-key-value-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-key-value-field.gjsindex bad63e4cceb..fd57e291a37 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-key-value-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-key-value-field.gjs@@ -3,7 +3,7 @@ import { hash } from "@ember/helper";import { action } from "@ember/object";import DButton from "discourse/components/d-button";import ModalJsonSchemaEditor from "discourse/components/modal/json-schema-editor";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import BaseField from "./da-base-field";import DAFieldDescription from "./da-field-description";import DAFieldLabel from "./da-field-label";@@ -74,11 +74,11 @@ export default class KeyValueField extends BaseField {get showJsonModalLabel() {if (this.keyCount === 0) {- return I18n.t(+ return i18n("discourse_automation.fields.key_value.label_without_count");} else {- return I18n.t("discourse_automation.fields.key_value.label_with_count", {+ return i18n("discourse_automation.fields.key_value.label_with_count", {count: this.keyCount,});}diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-period-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-period-field.gjsindex 9a0c7d259b5..379a8dbcd87 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-period-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-period-field.gjs@@ -5,7 +5,7 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import { next } from "@ember/runloop";import { TrackedObject } from "@ember-compat/tracked-built-ins";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ComboBox from "select-kit/components/combo-box";import BaseField from "./da-base-field";import DAFieldDescription from "./da-field-description";@@ -32,14 +32,14 @@ export default class PeriodField extends BaseField {}get recurringLabel() {- return I18n.t("discourse_automation.triggerables.recurring.every");+ return i18n("discourse_automation.triggerables.recurring.every");}get replacedContent() {return (this.args.field?.extra?.content || []).map((r) => {return {id: r.id,- name: I18n.t(r.name),+ name: i18n(r.name),};});}diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-pms-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-pms-field.gjsindex 299739a68ea..4d0cf6a864b 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-pms-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-pms-field.gjs@@ -7,7 +7,7 @@ import { service } from "@ember/service";import { TrackedArray, TrackedObject } from "@ember-compat/tracked-built-ins";import DButton from "discourse/components/d-button";import DEditor from "discourse/components/d-editor";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import PlaceholdersList from "../placeholders-list";import BaseField from "./da-base-field";import DAFieldLabel from "./da-field-label";@@ -15,17 +15,17 @@ import DAFieldLabel from "./da-field-label";export default class PmsField extends BaseField {@service dialog;- noPmCreatedLabel = I18n.t("discourse_automation.fields.pms.no_pm_created");+ noPmCreatedLabel = i18n("discourse_automation.fields.pms.no_pm_created");- prefersEncryptLabel = I18n.t(+ prefersEncryptLabel = i18n("discourse_automation.fields.pms.prefers_encrypt.label");- delayLabel = I18n.t("discourse_automation.fields.pms.delay.label");+ delayLabel = i18n("discourse_automation.fields.pms.delay.label");- pmTitleLabel = I18n.t("discourse_automation.fields.pms.title.label");+ pmTitleLabel = i18n("discourse_automation.fields.pms.title.label");- rawLabel = I18n.t("discourse_automation.fields.pms.raw.label");+ rawLabel = i18n("discourse_automation.fields.pms.raw.label");<template><section class="field pms-field">@@ -153,7 +153,7 @@ export default class PmsField extends BaseField {@actionremovePM(pm) {this.dialog.yesNoConfirm({- message: I18n.t("discourse_automation.fields.pms.confirm_remove_pm"),+ message: i18n("discourse_automation.fields.pms.confirm_remove_pm"),didConfirm: () => {return this.args.field.metadata.value.removeObject(pm);},diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-user-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-user-field.gjsindex f02b802092d..d78200532bd 100644--- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-user-field.gjs+++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-user-field.gjs@@ -1,6 +1,6 @@import { fn, hash } from "@ember/helper";import { action } from "@ember/object";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import UserChooser from "select-kit/components/user-chooser";import BaseField from "./da-base-field";import DAFieldDescription from "./da-field-description";@@ -17,7 +17,7 @@ export default class UserField extends BaseField {content = field.acceptedContexts.map((context) => {return {- name: I18n.t(+ name: i18n(`discourse_automation.scriptables.${field.targetName}.fields.${field.name}.${context}_context`),username: context,diff --git a/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-edit.js b/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-edit.jsindex 71df6c93240..b857c39855d 100644--- a/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-edit.js+++ b/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-edit.js@@ -5,7 +5,7 @@ import { schedule } from "@ember/runloop";import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';export default class AutomationEdit extends Controller {@service dialog;@@ -91,7 +91,7 @@ export default class AutomationEdit extends Controller {_confirmReset(callback) {this.dialog.yesNoConfirm({- message: I18n.t("discourse_automation.confirm_automation_reset"),+ message: i18n("discourse_automation.confirm_automation_reset"),didConfirm: () => {return callback && callback();},@@ -100,7 +100,7 @@ export default class AutomationEdit extends Controller {_confirmTrigger(callback) {this.dialog.yesNoConfirm({- message: I18n.t("discourse_automation.confirm_automation_trigger"),+ message: i18n("discourse_automation.confirm_automation_trigger"),didConfirm: () => {return callback && callback();},diff --git a/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-index.js b/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-index.jsindex 3671a9fd9a2..95bc5b03edb 100644--- a/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-index.js+++ b/plugins/automation/admin/assets/javascripts/admin/controllers/admin-plugins-discourse-automation-index.js@@ -3,7 +3,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import escape from "discourse-common/lib/escape";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';export default class AutomationIndex extends Controller {@service dialog;@@ -25,7 +25,7 @@ export default class AutomationIndex extends Controller {@actiondestroyAutomation(automation) {this.dialog.deleteConfirm({- message: I18n.t("discourse_automation.destroy_automation.confirm", {+ message: i18n("discourse_automation.destroy_automation.confirm", {name: escape(automation.name),}),didConfirm: () => {diff --git a/plugins/chat/admin/assets/javascripts/admin/components/admin-chat-incoming-webhooks-list.gjs b/plugins/chat/admin/assets/javascripts/admin/components/admin-chat-incoming-webhooks-list.gjsindex 02e12f0287a..f39f9f3ba99 100644--- a/plugins/chat/admin/assets/javascripts/admin/components/admin-chat-incoming-webhooks-list.gjs+++ b/plugins/chat/admin/assets/javascripts/admin/components/admin-chat-incoming-webhooks-list.gjs@@ -8,8 +8,7 @@ import DButton from "discourse/components/d-button";import replaceEmoji from "discourse/helpers/replace-emoji";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";export default class AdminChatIncomingWebhooksList extends Component {@@ -24,7 +23,7 @@ export default class AdminChatIncomingWebhooksList extends Component {@actiondestroyWebhook(webhook) {this.dialog.deleteConfirm({- message: I18n.t("chat.incoming_webhooks.confirm_destroy"),+ message: i18n("chat.incoming_webhooks.confirm_destroy"),didConfirm: async () => {this.loading = true;diff --git a/plugins/chat/admin/assets/javascripts/admin/components/chat-admin-plugin-actions.gjs b/plugins/chat/admin/assets/javascripts/admin/components/chat-admin-plugin-actions.gjsindex 017dda597c3..1fc5c3e26cb 100644--- a/plugins/chat/admin/assets/javascripts/admin/components/chat-admin-plugin-actions.gjs+++ b/plugins/chat/admin/assets/javascripts/admin/components/chat-admin-plugin-actions.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';export default class ChatAdminPluginActions extends Component {@service dialog;@@ -11,7 +11,7 @@ export default class ChatAdminPluginActions extends Component {@actionconfirmExportMessages() {return this.dialog.confirm({- message: I18n.t("chat.admin.export_messages.confirm_export"),+ message: i18n("chat.admin.export_messages.confirm_export"),didConfirm: () => this.exportMessages(),});}@@ -21,7 +21,7 @@ export default class ChatAdminPluginActions extends Component {try {await this.chatAdminApi.exportMessages();this.dialog.alert(- I18n.t("chat.admin.export_messages.export_has_started")+ i18n("chat.admin.export_messages.export_has_started"));} catch (error) {popupAjaxError(error);diff --git a/plugins/chat/admin/assets/javascripts/admin/components/chat-incoming-webhook-edit-form.gjs b/plugins/chat/admin/assets/javascripts/admin/components/chat-incoming-webhook-edit-form.gjsindex d608bc29ed1..ae27d364938 100644--- a/plugins/chat/admin/assets/javascripts/admin/components/chat-incoming-webhook-edit-form.gjs+++ b/plugins/chat/admin/assets/javascripts/admin/components/chat-incoming-webhook-edit-form.gjs@@ -10,8 +10,7 @@ import Form from "discourse/components/form";import replaceEmoji from "discourse/helpers/replace-emoji";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatChannelChooser from "discourse/plugins/chat/discourse/components/chat-channel-chooser";export default class ChatIncomingWebhookEditForm extends Component {@@ -53,7 +52,7 @@ export default class ChatIncomingWebhookEditForm extends Component {this.toasts.success({duration: 3000,data: {- message: I18n.t("chat.incoming_webhooks.saved"),+ message: i18n("chat.incoming_webhooks.saved"),},});} else {@@ -65,7 +64,7 @@ export default class ChatIncomingWebhookEditForm extends Component {this.toasts.success({duration: 3000,data: {- message: I18n.t("chat.incoming_webhooks.created"),+ message: i18n("chat.incoming_webhooks.created"),},});diff --git a/plugins/chat/admin/assets/javascripts/discourse/routes/admin-plugins-show-discourse-chat-incoming-webhooks-index.js b/plugins/chat/admin/assets/javascripts/discourse/routes/admin-plugins-show-discourse-chat-incoming-webhooks-index.jsindex e44d27a867c..466fc59c7f4 100644--- a/plugins/chat/admin/assets/javascripts/discourse/routes/admin-plugins-show-discourse-chat-incoming-webhooks-index.js+++ b/plugins/chat/admin/assets/javascripts/discourse/routes/admin-plugins-show-discourse-chat-incoming-webhooks-index.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";export default class DiscourseChatIncomingWebhooksIndex extends DiscourseRoute {@@ -35,6 +35,6 @@ export default class DiscourseChatIncomingWebhooksIndex extends DiscourseRoute {}titleToken() {- return I18n.t("chat.incoming_webhooks.title");+ return i18n("chat.incoming_webhooks.title");}}diff --git a/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs b/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjsindex 34917638bed..fa3014af898 100644--- a/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/browse-channels.gjs@@ -9,8 +9,8 @@ import { service } from "@ember/service";import { eq } from "truth-helpers";import DButton from "discourse/components/d-button";import { INPUT_DELAY } from "discourse-common/config/environment";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";+import { i18n } from "discourse-i18n";import List from "discourse/plugins/chat/discourse/components/chat/list";import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message";import ChatChannelCard from "discourse/plugins/chat/discourse/components/chat-channel-card";diff --git a/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs b/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjsindex ba319ea6c8d..4292b5b8e92 100644--- a/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs@@ -8,7 +8,7 @@ import DButton from "discourse/components/d-button";import PluginOutlet from "discourse/components/plugin-outlet";import concatClass from "discourse/helpers/concat-class";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message";import EmptyChannelsList from "discourse/plugins/chat/discourse/components/empty-channels-list";import ChatChannelRow from "./chat-channel-row";diff --git a/plugins/chat/assets/javascripts/discourse/components/channels-list-public.gjs b/plugins/chat/assets/javascripts/discourse/components/channels-list-public.gjsindex 8e1e515adda..8459d28d63e 100644--- a/plugins/chat/assets/javascripts/discourse/components/channels-list-public.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/channels-list-public.gjs@@ -8,7 +8,7 @@ import { and } from "truth-helpers";import PluginOutlet from "discourse/components/plugin-outlet";import concatClass from "discourse/helpers/concat-class";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import EmptyChannelsList from "discourse/plugins/chat/discourse/components/empty-channels-list";import ChatChannelRow from "./chat-channel-row";diff --git a/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs b/plugins/chat/assets/javascripts/discourse/components/channels-list.gjsindex 8dea144893e..b3b71762b00 100644--- a/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelsListDirect from "discourse/plugins/chat/discourse/components/channels-list-direct";import ChannelsListPublic from "discourse/plugins/chat/discourse/components/channels-list-public";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.gjsindex 941365b6b87..294c62a8009 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.gjs@@ -7,7 +7,7 @@ import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import { popupAjaxError } from "discourse/lib/ajax-error";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatChannelArchiveStatus extends Component {@service chatApi;@@ -23,7 +23,7 @@ export default class ChatChannelArchiveStatus extends Component {? "chat.channel_status.archive_failed_no_topic": "chat.channel_status.archive_failed";return htmlSafe(- I18n.t(translationKey, {+ i18n(translationKey, {completed: archive.messages,total: archive.totalMessages,topic_url: this.topicUrl,@@ -33,7 +33,7 @@ export default class ChatChannelArchiveStatus extends Component {get channelArchiveCompletedMessage() {return htmlSafe(- I18n.t("chat.channel_status.archive_completed", {+ i18n("chat.channel_status.archive_completed", {topic_url: this.topicUrl,}));diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-card.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-card.gjsindex 47f144eff68..a0d2c512bb7 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-card.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-card.gjs@@ -7,7 +7,7 @@ import borderColor from "discourse/helpers/border-color";import concatClass from "discourse/helpers/concat-class";import replaceEmoji from "discourse/helpers/replace-emoji";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ToggleChannelMembershipButton from "./toggle-channel-membership-button";export default class ChatChannelCard extends Component {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-metadata.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-metadata.gjsindex 069440d8934..e628c932e87 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-metadata.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-metadata.gjs@@ -1,11 +1,11 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatChannelMetadata extends Component {get lastMessageFormattedDate() {return moment(this.args.channel.lastMessage.createdAt).calendar(null, {sameDay: "LT",- lastDay: `[${I18n.t("chat.dates.yesterday")}]`,+ lastDay: `[${i18n("chat.dates.yesterday")}]`,lastWeek: "dddd",sameElse: "l",});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-preview-card.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-preview-card.gjsindex 2a5c2643165..7a7a6e6484a 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-preview-card.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-preview-card.gjs@@ -4,7 +4,7 @@ import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelTitle from "./channel-title";import ToggleChannelMembershipButton from "./toggle-channel-membership-button";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjsindex 6ca10af0d2d..b57deb3e429 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs@@ -14,7 +14,7 @@ import replaceEmoji from "discourse/helpers/replace-emoji";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChannelIcon from "discourse/plugins/chat/discourse/components/channel-icon";import ChannelName from "discourse/plugins/chat/discourse/components/channel-name";import ChatChannelMetadata from "discourse/plugins/chat/discourse/components/chat-channel-metadata";@@ -132,11 +132,11 @@ export default class ChatChannelRow extends Component {}get leaveDirectMessageLabel() {- return I18n.t("chat.direct_messages.close");+ return i18n("chat.direct_messages.close");}get leaveChannelLabel() {- return I18n.t("chat.channel_settings.leave_channel");+ return i18n("chat.channel_settings.leave_channel");}get channelHasUnread() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.gjsindex c417904049a..2c2cfb61613 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-status.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import dIcon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import {CHANNEL_STATUSES,channelStatusIcon,@@ -40,26 +40,26 @@ export default class ChatChannelStatus extends Component {#shortStatusMessage(status) {switch (status) {case CHANNEL_STATUSES.archived:- return I18n.t("chat.channel_status.archived");+ return i18n("chat.channel_status.archived");case CHANNEL_STATUSES.closed:- return I18n.t("chat.channel_status.closed");+ return i18n("chat.channel_status.closed");case CHANNEL_STATUSES.open:- return I18n.t("chat.channel_status.open");+ return i18n("chat.channel_status.open");case CHANNEL_STATUSES.readOnly:- return I18n.t("chat.channel_status.read_only");+ return i18n("chat.channel_status.read_only");}}#longStatusMessage(status) {switch (status) {case CHANNEL_STATUSES.archived:- return I18n.t("chat.channel_status.archived_header");+ return i18n("chat.channel_status.archived_header");case CHANNEL_STATUSES.closed:- return I18n.t("chat.channel_status.closed_header");+ return i18n("chat.channel_status.closed_header");case CHANNEL_STATUSES.open:- return I18n.t("chat.channel_status.open_header");+ return i18n("chat.channel_status.open_header");case CHANNEL_STATUSES.readOnly:- return I18n.t("chat.channel_status.read_only_header");+ return i18n("chat.channel_status.read_only_header");}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjsindex be026a9a829..98a1caaf077 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs@@ -15,10 +15,9 @@ import {onPresenceChange,removeOnPresenceChange,} from "discourse/lib/user-presence";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status";import firstVisibleMessageId from "discourse/plugins/chat/discourse/helpers/first-visible-message-id";import ChatChannelSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-subscription-manager";@@ -503,7 +502,7 @@ export default class ChatChannel extends Component {message.message.length > this.siteSettings.chat_maximum_message_length) {this.dialog.alert(- I18n.t("chat.message_too_long", {+ i18n("chat.message_too_long", {count: this.siteSettings.chat_maximum_message_length,}));diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer-dropdown.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-composer-dropdown.gjsindex ac3e6c4597c..44f33a79dbf 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-composer-dropdown.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer-dropdown.gjs@@ -3,7 +3,7 @@ import { array, fn } from "@ember/helper";import { action } from "@ember/object";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";export default class ChatComposerDropdown extends Component {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer-upload.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-composer-upload.gjsindex 4c43e5b6fad..ca0cea2e5db 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-composer-upload.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer-upload.gjs@@ -3,7 +3,7 @@ import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import { isImage } from "discourse/lib/uploads";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ChatComposerUpload extends Component {get isImage() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js b/plugins/chat/assets/javascripts/discourse/components/chat-composer.jsindex ec4ec7ee884..718950e8f26 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js@@ -25,7 +25,7 @@ import {} from "discourse/lib/user-status-on-autocomplete";import { cloneJSON } from "discourse-common/lib/object";import { findRawTemplate } from "discourse-common/lib/raw-templates";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { chatComposerButtons } from "discourse/plugins/chat/discourse/lib/chat-composer-buttons";import ChatMessageInteractor from "discourse/plugins/chat/discourse/lib/chat-message-interactor";import TextareaInteractor from "discourse/plugins/chat/discourse/lib/textarea-interactor";@@ -582,7 +582,7 @@ export default class ChatComposer extends Component {}).then((list) => {if (list?.length) {- list.push({ label: I18n.t("composer.more_emoji"), term });+ list.push({ label: i18n("composer.more_emoji"), term });}return list;});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-footer.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-footer.gjsindex b70d7fa549f..e20f64f34ef 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-footer.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-footer.gjs@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { eq } from "truth-helpers";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import {UnreadChannelsIndicator,UnreadDirectMessagesIndicator,diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-header.gjsindex 06c100ee292..1d661a10ec6 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-header.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-header.gjs@@ -4,7 +4,7 @@ import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatHeader extends Component {@service site;@@ -13,8 +13,8 @@ export default class ChatHeader extends Component {@tracked previousURL;- title = I18n.t("chat.back_to_forum");- heading = I18n.t("chat.heading");+ title = i18n("chat.back_to_forum");+ heading = i18n("chat.heading");constructor() {super(...arguments);diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-mention-warnings.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-mention-warnings.gjsindex 0b33cccadbe..afec4b847ed 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-mention-warnings.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-mention-warnings.gjs@@ -2,9 +2,8 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";export default class ChatMentionWarnings extends Component {@service siteSettings;@@ -76,9 +75,9 @@ export default class ChatMentionWarnings extends Component {get warningHeaderText() {if (this.mentionsCount <= this.warningsCount || this.hasTooManyMentions) {- return I18n.t("chat.mention_warning.groups.header.all");+ return i18n("chat.mention_warning.groups.header.all");} else {- return I18n.t("chat.mention_warning.groups.header.some");+ return i18n("chat.mention_warning.groups.header.some");}}@@ -89,7 +88,7 @@ export default class ChatMentionWarnings extends Component {if (this.currentUser.admin) {return htmlSafe(- I18n.t("chat.mention_warning.too_many_mentions_admin", {+ i18n("chat.mention_warning.too_many_mentions_admin", {count: this.siteSettings.max_mentions_per_chat_message,siteSettingUrl: getURL("/admin/site_settings/category/plugins?filter=max_mentions_per_chat_message"@@ -98,7 +97,7 @@ export default class ChatMentionWarnings extends Component {);} else {return htmlSafe(- I18n.t("chat.mention_warning.too_many_mentions", {+ i18n("chat.mention_warning.too_many_mentions", {count: this.siteSettings.max_mentions_per_chat_message,}));@@ -112,16 +111,16 @@ export default class ChatMentionWarnings extends Component {switch (this.unreachableGroupMentionsCount) {case 1:- return I18n.t("chat.mention_warning.groups.unreachable_1", {+ return i18n("chat.mention_warning.groups.unreachable_1", {group: this.unreachableGroupMentions[0],});case 2:- return I18n.t("chat.mention_warning.groups.unreachable_2", {+ return i18n("chat.mention_warning.groups.unreachable_2", {group1: this.unreachableGroupMentions[0],group2: this.unreachableGroupMentions[1],});default:- return I18n.t("chat.mention_warning.groups.unreachable_multiple", {+ return i18n("chat.mention_warning.groups.unreachable_multiple", {group: this.unreachableGroupMentions[0],count: this.unreachableGroupMentionsCount - 1,});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message-collapser.js b/plugins/chat/assets/javascripts/discourse/components/chat-message-collapser.jsindex b2e00e48fb7..1ff8ce7d9eb 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-message-collapser.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat-message-collapser.js@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { escapeExpression } from "discourse/lib/utilities";import domFromString from "discourse-common/lib/dom-from-string";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatMessageCollapser extends Component {@service siteSettings;@@ -17,7 +17,7 @@ export default class ChatMessageCollapser extends Component {if (this.args.uploads.length === 1) {name = this.args.uploads[0].original_filename;} else {- name = I18n.t("chat.uploaded_files", { count: this.args.uploads.length });+ name = i18n("chat.uploaded_files", { count: this.args.uploads.length });}return htmlSafe(`<span class="chat-message-collapser-link-small">${escapeExpression(diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message-separator.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-message-separator.gjsindex b4c0a7f16a0..76bc5731c33 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-message-separator.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-message-separator.gjs@@ -4,8 +4,7 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import { modifier } from "ember-modifier";import concatClass from "discourse/helpers/concat-class";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const IS_PINNED_CLASS = "is-pinned";@@ -77,8 +76,8 @@ export default class ChatMessageSeparator extends Component {#calendarDate(date) {return moment(date).calendar(moment(), {- sameDay: `[${I18n.t("chat.chat_message_separator.today")}]`,- lastDay: `[${I18n.t("chat.chat_message_separator.yesterday")}]`,+ sameDay: `[${i18n("chat.chat_message_separator.today")}]`,+ lastDay: `[${i18n("chat.chat_message_separator.yesterday")}]`,lastWeek: "LL",sameElse: "LL",});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message-text.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-message-text.gjsindex c5dc3b55046..df08503862e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-message-text.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-message-text.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { htmlSafe } from "@ember/template";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import { isCollapsible } from "discourse/plugins/chat/discourse/components/chat-message-collapser";import ChatMessageCollapser from "./chat-message-collapser";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjsindex 2671ba9c49d..29141716084 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-message-thread-indicator.gjs@@ -3,7 +3,7 @@ import { LinkTo } from "@ember/routing";import { htmlSafe } from "@ember/template";import formatDate from "discourse/helpers/format-date";import replaceEmoji from "discourse/helpers/replace-emoji";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChatThreadParticipants from "./chat-thread-participants";import ChatUserAvatar from "./chat-user-avatar";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-message.gjsindex 16538badcbb..63e76a0e843 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-message.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-message.gjs@@ -21,7 +21,7 @@ import discourseDebounce from "discourse-common/lib/debounce";import getURL from "discourse-common/lib/get-url";import discourseLater from "discourse-common/lib/later";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatMessageAvatar from "discourse/plugins/chat/discourse/components/chat/message/avatar";import ChatMessageError from "discourse/plugins/chat/discourse/components/chat/message/error";import ChatMessageInfo from "discourse/plugins/chat/discourse/components/chat/message/info";@@ -133,7 +133,7 @@ export default class ChatMessage extends Component {recursiveCount(this.args.message);- return I18n.t("chat.deleted", { count });+ return i18n("chat.deleted", { count });}get shouldRender() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.gjsindex 567282e68e6..67bbd0b230e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-replying-indicator.gjs@@ -7,7 +7,7 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";import { service } from "@ember/service";import { isPresent } from "@ember/utils";import concatClass from "discourse/helpers/concat-class";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatReplyingIndicator extends Component {@service currentUser;@@ -50,7 +50,7 @@ export default class ChatReplyingIndicator extends Component {get text() {if (this.usernames.length === 1) {- return I18n.t("chat.replying_indicator.single_user", {+ return i18n("chat.replying_indicator.single_user", {username: this.usernames[0],});}@@ -59,8 +59,8 @@ export default class ChatReplyingIndicator extends Component {const lastUsername = this.usernames[this.usernames.length - 1];const commaSeparatedUsernames = this.usernames.slice(0, this.usernames.length - 1)- .join(I18n.t("word_connector.comma"));- return I18n.t("chat.replying_indicator.multiple_users", {+ .join(i18n("word_connector.comma"));+ return i18n("chat.replying_indicator.multiple_users", {commaSeparatedUsernames,lastUsername,});@@ -68,8 +68,8 @@ export default class ChatReplyingIndicator extends Component {const commaSeparatedUsernames = this.usernames.slice(0, 2)- .join(I18n.t("word_connector.comma"));- return I18n.t("chat.replying_indicator.many_users", {+ .join(i18n("word_connector.comma"));+ return i18n("chat.replying_indicator.many_users", {commaSeparatedUsernames,count: this.usernames.length - 2,});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder-text.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder-text.gjsindex 0bc7b270862..9076dc72396 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder-text.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-retention-reminder-text.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatRetentionReminderText extends Component {@service siteSettings;@@ -12,19 +12,19 @@ export default class ChatRetentionReminderText extends Component {get text() {if (this.args.channel.isDirectMessageChannel) {if (this.#countForChannelType > 0) {- return I18n.t(`chat.retention_reminders.${this.type}`, {+ return i18n(`chat.retention_reminders.${this.type}`, {count: this.siteSettings.chat_dm_retention_days,});} else {- return I18n.t(`chat.retention_reminders.indefinitely_${this.type}`);+ return i18n(`chat.retention_reminders.indefinitely_${this.type}`);}} else {if (this.#countForChannelType > 0) {- return I18n.t(`chat.retention_reminders.${this.type}`, {+ return i18n(`chat.retention_reminders.${this.type}`, {count: this.siteSettings.chat_channel_retention_days,});} else {- return I18n.t(`chat.retention_reminders.indefinitely_${this.type}`);+ return i18n(`chat.retention_reminders.indefinitely_${this.type}`);}}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjsindex f6f782a5f1b..67f5cab3459 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread-list.gjs@@ -6,7 +6,7 @@ import { eq } from "truth-helpers";import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";import isElementInViewport from "discourse/lib/is-element-in-viewport";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatThreadListItem from "discourse/plugins/chat/discourse/components/chat/thread-list/item";import ChatTrackMessage from "discourse/plugins/chat/discourse/modifiers/chat/track-message";@@ -16,7 +16,7 @@ export default class ChatThreadList extends Component {@service messageBus;@service chatTrackingStateManager;- noThreadsLabel = I18n.t("chat.threads.none");+ noThreadsLabel = i18n("chat.threads.none");subscribe = modifierFn((element, [channel]) => {this.messageBus.subscribe(diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread-participants.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-thread-participants.gjsindex 36076ad89aa..009891d5bcd 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread-participants.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread-participants.gjs@@ -1,5 +1,5 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";export default class ChatThreadParticipants extends Component {@@ -36,7 +36,7 @@ export default class ChatThreadParticipants extends Component {}get otherCountLabel() {- return I18n.t("chat.thread.participants_other_count", {+ return i18n("chat.thread.participants_other_count", {count: this.args.thread.preview.otherParticipantCount,});}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js b/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.jsindex d756dea8563..28c202fe4aa 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { next } from "@ember/runloop";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ThreadSettingsModal from "discourse/plugins/chat/discourse/components/chat/modal/thread-settings";import { THREAD_TITLE_PROMPT_THRESHOLD } from "discourse/plugins/chat/discourse/lib/chat-constants";import UserChatThreadMembership from "discourse/plugins/chat/discourse/models/user-chat-thread-membership";@@ -15,10 +15,10 @@ export default class ChatThreadTitlePrompt extends Component {@service site;toastText = {- title: I18n.t("chat.thread_title_toast.title"),- message: I18n.t("chat.thread_title_toast.message"),- dismissLabel: I18n.t("chat.thread_title_toast.dismiss_action"),- primaryLabel: I18n.t("chat.thread_title_toast.primary_action"),+ title: i18n("chat.thread_title_toast.title"),+ message: i18n("chat.thread_title_toast.message"),+ dismissLabel: i18n("chat.thread_title_toast.dismiss_action"),+ primaryLabel: i18n("chat.thread_title_toast.primary_action"),};constructor() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjsindex 203d43c47a5..3975a9f3755 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs@@ -11,7 +11,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import { NotificationLevels } from "discourse/lib/notification-levels";import discourseDebounce from "discourse-common/lib/debounce";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatThreadTitlePrompt from "discourse/plugins/chat/discourse/components/chat-thread-title-prompt";import firstVisibleMessageId from "discourse/plugins/chat/discourse/helpers/first-visible-message-id";import ChatChannelThreadSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-thread-subscription-manager";@@ -365,7 +365,7 @@ export default class ChatThread extends Component {message.message.length > this.siteSettings.chat_maximum_message_length) {this.dialog.alert(- I18n.t("chat.message_too_long", {+ i18n("chat.message_too_long", {count: this.siteSettings.chat_maximum_message_length,}));diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-upload-drop-zone.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-upload-drop-zone.gjsindex 71f4ee2a22b..92444b1f8b2 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-upload-drop-zone.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-upload-drop-zone.gjs@@ -1,13 +1,13 @@import Component from "@glimmer/component";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatThread from "discourse/plugins/chat/discourse/models/chat-thread";export default class ChatUploadDropZone extends Component {get title() {if (this.#isThread()) {- return I18n.t("chat.upload_to_thread");+ return i18n("chat.upload_to_thread");} else {- return I18n.t("chat.upload_to_channel", {+ return i18n("chat.upload_to_channel", {title: this.args.model.title,});}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/composer/channel.js b/plugins/chat/assets/javascripts/discourse/components/chat/composer/channel.jsindex 1b23be52692..4d7c01fe8c2 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/composer/channel.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat/composer/channel.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import { service } from "@ember/service";import { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatComposer from "../../chat-composer";export default class ChatComposerChannel extends ChatComposer {@@ -55,13 +55,13 @@ export default class ChatComposerChannel extends ChatComposer {get placeholder() {if (!this.args.channel.canModifyMessages(this.currentUser)) {- return I18n.t(+ return i18n(`chat.placeholder_new_message_disallowed.${this.args.channel.status}`);}if (!this.chat.userCanInteractWithChat) {- return I18n.t("chat.placeholder_silenced");+ return i18n("chat.placeholder_silenced");} else {return this.#messageRecipients(this.args.channel);}@@ -82,24 +82,24 @@ export default class ChatComposerChannel extends ChatComposer {#messageRecipients(channel) {if (channel.isDirectMessageChannel) {if (channel.chatable.group) {- return I18n.t("chat.placeholder_group");+ return i18n("chat.placeholder_group");} else {const directMessageRecipients = channel.chatable.users;if (directMessageRecipients.length === 1 &&directMessageRecipients[0].id === this.currentUser.id) {- return I18n.t("chat.placeholder_self");+ return i18n("chat.placeholder_self");}- return I18n.t("chat.placeholder_users", {+ return i18n("chat.placeholder_users", {commaSeparatedNames: directMessageRecipients.map((u) => u.name || `@${u.username}`)- .join(I18n.t("word_connector.comma")),+ .join(i18n("word_connector.comma")),});}} else {- return I18n.t("chat.placeholder_channel", {+ return i18n("chat.placeholder_channel", {channelName: `#${channel.title}`,});}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/composer/thread.js b/plugins/chat/assets/javascripts/discourse/components/chat/composer/thread.jsindex bc30ed267f0..239270948a8 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/composer/thread.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat/composer/thread.js@@ -1,7 +1,7 @@import { action } from "@ember/object";import { service } from "@ember/service";import { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatMessage from "discourse/plugins/chat/discourse/models/chat-message";import ChatComposer from "../../chat-composer";@@ -55,7 +55,7 @@ export default class ChatComposerThread extends ChatComposer {}get placeholder() {- return I18n.t("chat.placeholder_thread");+ return i18n("chat.placeholder_thread");}lastUserMessage(user) {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/browse.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/browse.gjsindex e077aa7a9a4..54f167a5597 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/browse.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/browse.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { array } from "@ember/helper";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import BrowseChannels from "discourse/plugins/chat/discourse/components/browse-channels";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-members.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-members.gjsindex 5440d0d892e..824f9c44536 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-members.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-members.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChannelMembers from "discourse/plugins/chat/discourse/components/chat/routes/channel-info-members";import ChannelInfoNav from "discourse/plugins/chat/discourse/components/chat/routes/channel-info-nav";@@ -16,7 +16,7 @@ export default class ChatDrawerRoutesMembers extends Component {return {route: "chat.channel",models: this.chat.activeChannel?.routeModels,- title: I18n.t("chat.return_to_channel"),+ title: i18n("chat.return_to_channel"),};}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-settings.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-settings.gjsindex 9cfb1f1349c..ee43a0b3453 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-settings.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-info-settings.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChannelInfoNav from "discourse/plugins/chat/discourse/components/chat/routes/channel-info-nav";import ChannelSettings from "discourse/plugins/chat/discourse/components/chat/routes/channel-info-settings";@@ -16,7 +16,7 @@ export default class ChatDrawerRoutesSettings extends Component {return {route: "chat.channel",models: this.chat.activeChannel?.routeModels,- title: I18n.t("chat.return_to_channel"),+ title: i18n("chat.return_to_channel"),};}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-thread.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-thread.gjsindex 32cf80c02cf..2e1635e8fb1 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-thread.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-thread.gjs@@ -6,7 +6,7 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";import didUpdate from "@ember/render-modifiers/modifiers/did-update";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatThread from "discourse/plugins/chat/discourse/components/chat-thread";@@ -28,14 +28,14 @@ export default class ChatDrawerRoutesChannelThread extends Component {};if (this.chatHistory.previousRoute?.name === "chat.channel.threads") {- link.title = I18n.t("chat.return_to_threads_list");+ link.title = i18n("chat.return_to_threads_list");link.route = "chat.channel.threads";} else if (this.chatHistory.previousRoute?.name === "chat.threads") {- link.title = I18n.t("chat.my_threads.title");+ link.title = i18n("chat.my_threads.title");link.route = "chat.threads";link.models = [];} else {- link.title = I18n.t("chat.return_to_channel");+ link.title = i18n("chat.return_to_channel");link.route = "chat.channel";}@@ -44,8 +44,7 @@ export default class ChatDrawerRoutesChannelThread extends Component {get threadTitle() {return (- this.chat.activeChannel?.activeThread?.title ??- I18n.t("chat.thread.label")+ this.chat.activeChannel?.activeThread?.title ?? i18n("chat.thread.label"));}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjsindex e2e1b0c7e92..0ce5db6683e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs@@ -5,7 +5,7 @@ import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import replaceEmoji from "discourse/helpers/replace-emoji";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatThreadList from "discourse/plugins/chat/discourse/components/chat-thread-list";@@ -14,11 +14,11 @@ export default class ChatDrawerRoutesChannelThreads extends Component {@service chatChannelsManager;@service chatStateManager;- backLinkTitle = I18n.t("chat.return_to_list");+ backLinkTitle = i18n("chat.return_to_list");get title() {return htmlSafe(- I18n.t("chat.threads.list") ++ i18n("chat.threads.list") +" - " +replaceEmoji(this.chat.activeChannel.title));diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channels.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channels.gjsindex 9baaf7f4eaa..34c5ac63c22 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channels.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channels.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelsListPublic from "discourse/plugins/chat/discourse/components/channels-list-public";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatFooter from "discourse/plugins/chat/discourse/components/chat-footer";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/direct-messages.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/direct-messages.gjsindex 4ab1eee669d..7849db75e30 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/direct-messages.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/direct-messages.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelsListDirect from "discourse/plugins/chat/discourse/components/channels-list-direct";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatFooter from "discourse/plugins/chat/discourse/components/chat-footer";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/threads.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/threads.gjsindex c2d33bf60ea..4da661f5f99 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/threads.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/threads.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatFooter from "discourse/plugins/chat/discourse/components/chat-footer";import UserThreads from "discourse/plugins/chat/discourse/components/user-threads";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/header/icon.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/header/icon.gjsindex edf20a8fd81..4d613b8ccac 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/header/icon.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/header/icon.gjs@@ -4,7 +4,7 @@ import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatHeaderIconUnreadIndicator from "discourse/plugins/chat/discourse/components/chat/header/icon/unread-indicator";import { getUserChatSeparateSidebarMode } from "discourse/plugins/chat/discourse/lib/get-user-chat-separate-sidebar-mode";@@ -43,10 +43,10 @@ export default class ChatHeaderIcon extends Component {!this.chatSeparateSidebarMode.never &&this.site.desktopView) {- return I18n.t("sidebar.panels.forum.label");+ return i18n("sidebar.panels.forum.label");}- return I18n.t("chat.title_capitalized");+ return i18n("chat.title_capitalized");}get icon() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/add-members.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/add-members.gjsindex 2512196516d..405a421c501 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/add-members.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/add-members.gjs@@ -4,7 +4,7 @@ import { service } from "@ember/service";import { gte } from "truth-helpers";import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import MembersCount from "./members-count";import MembersSelector from "./members-selector";@@ -49,7 +49,7 @@ export default class AddMembers extends Component {groups,});- this.toasts.success({ data: { message: I18n.t("saved") } });+ this.toasts.success({ data: { message: i18n("saved") } });this.router.transitionTo("chat.channel",...this.args.channel.routeModelsdiff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/group.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/group.gjsindex c04d3066a4e..ee5b5e7936b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/group.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/group.gjs@@ -1,13 +1,13 @@import Component from "@glimmer/component";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatableGroup extends Component {@service currentUser;@service siteSettings;- group_with_too_many_members = I18n.t(+ group_with_too_many_members = i18n("chat.new_message_modal.group_with_too_many_members",{ membersCount: this.args.item.model.chat_enabled_user_count });diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/list.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/list.gjsindex 745a1e53aec..15f85441ba9 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/list.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/list.gjs@@ -4,14 +4,14 @@ import { on } from "@ember/modifier";import { action } from "@ember/object";import { eq } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Channel from "./channel";import Group from "./group";import ListAction from "./list-action";import User from "./user";export default class List extends Component {- cantAddMoreMembersLabel = I18n.t(+ cantAddMoreMembersLabel = i18n("chat.new_message_modal.cant_add_more_members");diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-count.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-count.gjsindex 3e89d8e72e8..949187bf559 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-count.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-count.gjs@@ -1,11 +1,11 @@import Component from "@glimmer/component";import { gte } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class MembersCount extends Component {get countLabel() {- return I18n.t("chat.direct_message_creator.members_counter", {+ return i18n("chat.direct_message_creator.members_counter", {count: this.args.count,max: this.args.max,});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjsindex c9d0e972a08..4219b4fd0ef 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members-selector.gjs@@ -5,7 +5,7 @@ import { service } from "@ember/service";import DButton from "discourse/components/d-button";import { INPUT_DELAY } from "discourse-common/config/environment";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatablesLoader from "./lib/chatables-loader";import List from "./list";import ListHandler from "./list-handler";@@ -19,7 +19,7 @@ export default class MembersSelector extends Component {@tracked highlightedMember;@tracked highlightedChatable;- placeholder = I18n.t("chat.direct_message_creator.group_name");+ placeholder = i18n("chat.direct_message_creator.group_name");get items() {return this.chatables.filter(diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members.gjsindex fd6e586489a..c4d510e975c 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/members.gjs@@ -5,14 +5,12 @@ import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { eq } from "truth-helpers";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { getNext, getPrevious } from "./lib/iterate-list";import Member from "./member";export default class Members extends Component {- addMoreMembersLabel = I18n.t(- "chat.new_message_modal.user_search_placeholder"- );+ addMoreMembersLabel = i18n("chat.new_message_modal.user_search_placeholder");@actiononFilter() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/new-group.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/new-group.gjsindex 91074d836ca..7c21f31d9cf 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/new-group.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/new-group.gjs@@ -6,7 +6,7 @@ import { service } from "@ember/service";import { gte } from "truth-helpers";import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import MembersCount from "./members-count";import MembersSelector from "./members-selector";@@ -17,7 +17,7 @@ export default class NewGroup extends Component {@tracked newGroupTitle = "";- placeholder = I18n.t("chat.direct_message_creator.group_name");+ placeholder = i18n("chat.direct_message_creator.group_name");get membersCount() {return this.args.members?.reduce((acc, member) => {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search-input.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search-input.gjsindex b269e75c8ed..be96d7c4cc1 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search-input.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search-input.gjs@@ -2,10 +2,10 @@ import Component from "@glimmer/component";import { Input } from "@ember/component";import { on } from "@ember/modifier";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatMessageCreatorSearchInput extends Component {- filterPlaceholder = I18n.t("chat.new_message_modal.filter");+ filterPlaceholder = i18n("chat.new_message_modal.filter");<template><div class="chat-message-creator__search-input-container">diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjsindex 9b96d7d61e0..56b2ff9bc20 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs@@ -8,7 +8,7 @@ import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";import { INPUT_DELAY } from "discourse-common/config/environment";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { MODES } from "./constants";import ChatablesLoader from "./lib/chatables-loader";import List from "./list";@@ -35,7 +35,7 @@ export default class ChatMessageCreatorSearch extends Component {items.push({identifier: "new-group",type: "list-action",- label: I18n.t("chat.new_message_modal.new_group_chat"),+ label: i18n("chat.new_message_modal.new_group_chat"),enabled: true,icon: "users",id: "new-group-chat",diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/user.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/user.gjsindex 3c1b2e50851..3901b192fd2 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/user.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/user.gjs@@ -4,14 +4,14 @@ import { modifier } from "ember-modifier";import { gt, not } from "truth-helpers";import UserStatusMessage from "discourse/components/user-status-message";import userStatus from "discourse/helpers/user-status";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";import ChatUserDisplayName from "discourse/plugins/chat/discourse/components/chat-user-display-name";export default class ChatableUser extends Component {@service currentUser;- disabledUserLabel = I18n.t("chat.new_message_modal.disabled_user");+ disabledUserLabel = i18n("chat.new_message_modal.disabled_user");trackUserStatus = modifier((element, [user]) => {user.statusManager.trackStatus();diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message/error.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message/error.gjsindex 917a99d71cd..cadda991a5b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message/error.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message/error.gjs@@ -1,7 +1,7 @@import { fn } from "@ember/helper";import { eq } from "truth-helpers";import DButton from "discourse/components/d-button";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";const Error = <template>{{#if @message.error}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message/info.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message/info.gjsindex fea0f394df4..ead1308b4b8 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/message/info.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message/info.gjs@@ -10,8 +10,8 @@ import UserStatusMessage from "discourse/components/user-status-message";import concatClass from "discourse/helpers/concat-class";import { prioritizeNameInUx } from "discourse/lib/settings";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";import formatChatDate from "../../../helpers/format-chat-date";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/archive-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/archive-channel.gjsindex 9e05ed05961..f941e728f49 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/archive-channel.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/archive-channel.gjs@@ -7,9 +7,8 @@ import { isEmpty } from "@ember/utils";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import {EXISTING_TOPIC_SELECTION,NEW_TOPIC_SELECTION,@@ -65,10 +64,10 @@ export default class ChatModalArchiveChannel extends Component {get instructionLabels() {const labels = {};- labels[NEW_TOPIC_SELECTION] = I18n.t(+ labels[NEW_TOPIC_SELECTION] = i18n("chat.selection.new_topic.instructions_channel_archive");- labels[EXISTING_TOPIC_SELECTION] = I18n.t(+ labels[EXISTING_TOPIC_SELECTION] = i18n("chat.selection.existing_topic.instructions_channel_archive");return labels;@@ -76,7 +75,7 @@ export default class ChatModalArchiveChannel extends Component {get instructionsText() {return htmlSafe(- I18n.t("chat.channel_archive.instructions", {+ i18n("chat.channel_archive.instructions", {channelTitle: this.channel.escapedTitle,}));@@ -102,7 +101,7 @@ export default class ChatModalArchiveChannel extends Component {return this.chatApi.createChannelArchive(this.channel.id, this.data).then(() => {- this.flash = I18n.t("chat.channel_archive.process_started");+ this.flash = i18n("chat.channel_archive.process_started");this.flashType = "success";this.channel.status = CHANNEL_STATUSES.archived;diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.jsindex c1d320b6f8a..01439a1b3a4 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js@@ -10,10 +10,10 @@ import { extractError } from "discourse/lib/ajax-error";import { escapeExpression } from "discourse/lib/utilities";import Category from "discourse/models/category";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";const DEFAULT_HINT = htmlSafe(- I18n.t("chat.create_channel.choose_category.default_hint", {+ i18n("chat.create_channel.choose_category.default_hint", {link: "/categories",category: "category",})@@ -136,7 +136,7 @@ export default class ChatModalCreateChannel extends Component {if (catPermissions.private) {switch (allowedGroups.length) {case 1:- warning = I18n.t(+ warning = i18n("chat.create_channel.auto_join_users.warning_1_group",{count: catPermissions.members_count,@@ -145,7 +145,7 @@ export default class ChatModalCreateChannel extends Component {);break;case 2:- warning = I18n.t(+ warning = i18n("chat.create_channel.auto_join_users.warning_2_groups",{count: catPermissions.members_count,@@ -166,7 +166,7 @@ export default class ChatModalCreateChannel extends Component {break;}} else {- warning = I18n.t(+ warning = i18n("chat.create_channel.auto_join_users.public_category_warning",{category: escapeExpression(category.name),@@ -193,26 +193,20 @@ export default class ChatModalCreateChannel extends Component {switch (allowedGroups.length) {case 1:- hint = I18n.t(- "chat.create_channel.choose_category.hint_1_group",- {- settingLink,- group: escapeExpression(allowedGroups[0]),- }- );+ hint = i18n("chat.create_channel.choose_category.hint_1_group", {+ settingLink,+ group: escapeExpression(allowedGroups[0]),+ });break;case 2:- hint = I18n.t(- "chat.create_channel.choose_category.hint_2_groups",- {- settingLink,- group1: escapeExpression(allowedGroups[0]),- group2: escapeExpression(allowedGroups[1]),- }- );+ hint = i18n("chat.create_channel.choose_category.hint_2_groups", {+ settingLink,+ group1: escapeExpression(allowedGroups[0]),+ group2: escapeExpression(allowedGroups[1]),+ });break;default:- hint = I18n.t(+ hint = i18n("chat.create_channel.choose_category.hint_multiple_groups",{settingLink,diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-channel.gjsindex dbb33287653..07f1968657e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-channel.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-channel.gjs@@ -10,9 +10,8 @@ import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import withEventValue from "discourse/helpers/with-event-value";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import discourseLater from "discourse-common/lib/later";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatModalDeleteChannel extends Component {@service chatApi;@@ -46,7 +45,7 @@ export default class ChatModalDeleteChannel extends Component {get instructionsText() {return htmlSafe(- I18n.t("chat.channel_delete.instructions", {+ i18n("chat.channel_delete.instructions", {name: this.channel.escapedTitle,}));@@ -60,7 +59,7 @@ export default class ChatModalDeleteChannel extends Component {.destroyChannel(this.channel.id, this.channelNameConfirmation).then(() => {this.confirmed = true;- this.flash = I18n.t("chat.channel_delete.process_started");+ this.flash = i18n("chat.channel_delete.process_started");this.flashType = "success";discourseLater(() => {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-messages-confirm.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-messages-confirm.gjsindex 262033850c2..5baab85241b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-messages-confirm.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/delete-messages-confirm.gjs@@ -5,7 +5,7 @@ import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import DModalCancel from "discourse/components/d-modal-cancel";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class DeleteMessagesConfirm extends Component {@service chatApi;diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/edit-channel-name.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/edit-channel-name.gjsindex cfdf78efb0f..eb0f90bb63b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/edit-channel-name.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/edit-channel-name.gjs@@ -10,8 +10,8 @@ import DModal from "discourse/components/d-modal";import DModalCancel from "discourse/components/d-modal-cancel";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";+import { i18n } from "discourse-i18n";import DTooltip from "float-kit/components/d-tooltip";import slugifyChannel from "discourse/plugins/chat/discourse/lib/slugify-channel";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/move-message-to-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/move-message-to-channel.gjsindex a5ca6e5e914..4345cda538b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/move-message-to-channel.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/move-message-to-channel.gjs@@ -7,8 +7,7 @@ import { isBlank } from "@ember/utils";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatChannelChooser from "../../chat-channel-chooser";export default class ChatModalMoveMessageToChannel extends Component {@@ -44,7 +43,7 @@ export default class ChatModalMoveMessageToChannel extends Component {get instructionsText() {return htmlSafe(- I18n.t("chat.move_to_channel.instructions", {+ i18n("chat.move_to_channel.instructions", {channelTitle: this.sourceChannel.escapedTitle,count: this.selectedMessageCount,})diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/thread-settings.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/thread-settings.gjsindex 98ba05fa922..4cf9bba0218 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/thread-settings.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/thread-settings.gjs@@ -8,7 +8,7 @@ import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ChatModalThreadSettings extends Component {@service chatApi;diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/toggle-channel-status.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/toggle-channel-status.gjsindex 7d87487b3e1..c67bb65dcaf 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/toggle-channel-status.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/toggle-channel-status.gjs@@ -5,8 +5,7 @@ import { htmlSafe } from "@ember/template";import DButton from "discourse/components/d-button";import DModal from "discourse/components/d-modal";import { popupAjaxError } from "discourse/lib/ajax-error";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { CHANNEL_STATUSES } from "discourse/plugins/chat/discourse/models/chat-channel";export default class ChatModalToggleChannelStatus extends Component {@@ -27,9 +26,9 @@ export default class ChatModalToggleChannelStatus extends Component {get instructions() {if (this.channel?.isClosed) {- return htmlSafe(I18n.t("chat.channel_open.instructions"));+ return htmlSafe(i18n("chat.channel_open.instructions"));} else {- return htmlSafe(I18n.t("chat.channel_close.instructions"));+ return htmlSafe(i18n("chat.channel_close.instructions"));}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/back-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/back-button.gjsindex e454c588dff..465040f4595 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/back-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/back-button.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatNavbarBackButton extends Component {get icon() {@@ -9,7 +9,7 @@ export default class ChatNavbarBackButton extends Component {}get title() {- return this.args.title ?? I18n.t("chat.browse.back");+ return this.args.title ?? i18n("chat.browse.back");}get targetRoute() {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/browse-channels-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/browse-channels-button.gjsindex 2984559b2ff..6a1fb098afa 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/browse-channels-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/browse-channels-button.gjs@@ -2,12 +2,12 @@ import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatNavbarBrowseChannelsButton extends Component {@service router;- browseChannelsLabel = I18n.t("chat.channels_list_popup.browse");+ browseChannelsLabel = i18n("chat.channels_list_popup.browse");get showBrowseChannelsButton() {return this.router.currentRoute.name === "chat.channels";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-thread-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-thread-button.gjsindex 379bca85fc8..5131be527d2 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-thread-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-thread-button.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ChatNavbarCloseThreadButton extends Component {@service site;diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-threads-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-threads-button.gjsindex 80609fc83fb..3bb91627546 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-threads-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/close-threads-button.gjs@@ -2,12 +2,12 @@ import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatNavbarCloseThreadsButton extends Component {@service site;- closeButtonTitle = I18n.t("chat.thread.close");+ closeButtonTitle = i18n("chat.thread.close");<template>{{#if this.site.desktopView}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/new-direct-message-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/new-direct-message-button.gjsindex e12338689fa..c3ad75f8d58 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/new-direct-message-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/new-direct-message-button.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";import DButton from "discourse/components/d-button";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message";export default class ChatNavbarNewDirectMessageButton extends Component {@@ -10,7 +10,7 @@ export default class ChatNavbarNewDirectMessageButton extends Component {@service modal;@service chat;- buttonLabel = I18n.t("chat.channels_list_popup.browse");+ buttonLabel = i18n("chat.channels_list_popup.browse");get showButtonComponent() {return (diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/threads-list-button.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/threads-list-button.gjsindex 24cda83aafb..61cb286383e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/navbar/threads-list-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/navbar/threads-list-button.gjs@@ -3,13 +3,13 @@ import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import concatClass from "discourse/helpers/concat-class";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ThreadHeaderUnreadIndicator from "discourse/plugins/chat/discourse/components/chat/thread/header-unread-indicator";export default class ChatNavbarThreadsListButton extends Component {@service router;- threadsListLabel = I18n.t("chat.threads.list");+ threadsListLabel = i18n("chat.threads.list");get showThreadsListButton() {return (diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/notices/mention_without_membership.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/notices/mention_without_membership.gjsindex a304f6b652d..3f044e4109d 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/notices/mention_without_membership.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/notices/mention_without_membership.gjs@@ -5,7 +5,7 @@ import { action } from "@ember/object";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import laterFn from "../../../modifiers/chat/later-fn";export default class MentionWithoutMembership extends Component {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjsindex e3405234047..d8c2733c40b 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-members.gjs@@ -11,9 +11,8 @@ import DiscourseURL, { userPath } from "discourse/lib/url";import autoFocus from "discourse/modifiers/auto-focus";import { INPUT_DELAY } from "discourse-common/config/environment";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";import discourseDebounce from "discourse-common/lib/debounce";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import MessageCreator from "discourse/plugins/chat/discourse/components/chat/message-creator";import { MODES } from "discourse/plugins/chat/discourse/components/chat/message-creator/constants";import ChatUserInfo from "discourse/plugins/chat/discourse/components/chat-user-info";@@ -29,10 +28,10 @@ export default class ChatRouteChannelInfoMembers extends Component {@tracked filter = "";@tracked showAddMembers = false;- addMemberLabel = I18n.t("chat.members_view.add_member");- filterPlaceholder = I18n.t("chat.members_view.filter_placeholder");- noMembershipsFoundLabel = I18n.t("chat.channel.no_memberships_found");- noMembershipsLabel = I18n.t("chat.channel.no_memberships");+ addMemberLabel = i18n("chat.members_view.add_member");+ filterPlaceholder = i18n("chat.members_view.filter_placeholder");+ noMembershipsFoundLabel = i18n("chat.channel.no_memberships_found");+ noMembershipsLabel = i18n("chat.channel.no_memberships");onEnter = modifier((element, [callback]) => {const handler = (event) => {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-nav.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-nav.gjsindex 58eaafa7893..7459d6e694a 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-nav.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-nav.gjs@@ -2,7 +2,7 @@ import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import { eq } from "truth-helpers";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ChatRoutesChannelInfoNav extends Component {@service site;diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-settings.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-settings.gjsindex 75fea4dfed5..09ee7ebcdca 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-settings.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info-settings.gjs@@ -10,8 +10,7 @@ import categoryBadge from "discourse/helpers/category-badge";import replaceEmoji from "discourse/helpers/replace-emoji";import { popupAjaxError } from "discourse/lib/ajax-error";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ComboBox from "select-kit/components/combo-box";import ChatForm from "discourse/plugins/chat/discourse/components/chat/form";import ChatModalArchiveChannel from "discourse/plugins/chat/discourse/components/chat/modal/archive-channel";@@ -23,9 +22,9 @@ import ChatRetentionReminderText from "discourse/plugins/chat/discourse/componenimport ToggleChannelMembershipButton from "discourse/plugins/chat/discourse/components/toggle-channel-membership-button";const NOTIFICATION_LEVELS = [- { name: I18n.t("chat.notification_levels.never"), value: "never" },- { name: I18n.t("chat.notification_levels.mention"), value: "mention" },- { name: I18n.t("chat.notification_levels.always"), value: "always" },+ { name: i18n("chat.notification_levels.never"), value: "never" },+ { name: i18n("chat.notification_levels.mention"), value: "mention" },+ { name: i18n("chat.notification_levels.always"), value: "always" },];export default class ChatRouteChannelInfoSettings extends Component {@@ -42,27 +41,25 @@ export default class ChatRouteChannelInfoSettings extends Component {notificationLevels = NOTIFICATION_LEVELS;- settingsSectionTitle = I18n.t("chat.settings.settings_title");- channelInfoSectionTitle = I18n.t("chat.settings.info_title");- categoryLabel = I18n.t("chat.settings.category_label");- historyLabel = I18n.t("chat.settings.history_label");- adminSectionTitle = I18n.t("chat.settings.admin_title");- membersLabel = I18n.t("chat.channel_info.tabs.members");- descriptionSectionTitle = I18n.t("chat.about_view.description");- titleSectionTitle = I18n.t("chat.about_view.title");- descriptionPlaceholder = I18n.t(+ settingsSectionTitle = i18n("chat.settings.settings_title");+ channelInfoSectionTitle = i18n("chat.settings.info_title");+ categoryLabel = i18n("chat.settings.category_label");+ historyLabel = i18n("chat.settings.history_label");+ adminSectionTitle = i18n("chat.settings.admin_title");+ membersLabel = i18n("chat.channel_info.tabs.members");+ descriptionSectionTitle = i18n("chat.about_view.description");+ titleSectionTitle = i18n("chat.about_view.title");+ descriptionPlaceholder = i18n("chat.channel_edit_description_modal.description");- toggleThreadingLabel = I18n.t("chat.settings.channel_threading_label");- toggleThreadingDescription = I18n.t(+ toggleThreadingLabel = i18n("chat.settings.channel_threading_label");+ toggleThreadingDescription = i18n("chat.settings.channel_threading_description");- muteSectionLabel = I18n.t("chat.settings.mute");- channelWideMentionsLabel = I18n.t(- "chat.settings.channel_wide_mentions_label"- );- autoJoinLabel = I18n.t("chat.settings.auto_join_users_label");- notificationsLevelLabel = I18n.t("chat.settings.notification_level");+ muteSectionLabel = i18n("chat.settings.mute");+ channelWideMentionsLabel = i18n("chat.settings.channel_wide_mentions_label");+ autoJoinLabel = i18n("chat.settings.auto_join_users_label");+ notificationsLevelLabel = i18n("chat.settings.notification_level");get canEditChannel() {if (@@ -107,7 +104,7 @@ export default class ChatRouteChannelInfoSettings extends Component {}get channelWideMentionsDescription() {- return I18n.t("chat.settings.channel_wide_mentions_description", {+ return i18n("chat.settings.channel_wide_mentions_description", {channel: this.args.channel.title,});}@@ -201,7 +198,7 @@ export default class ChatRouteChannelInfoSettings extends Component {}return this.dialog.confirm({- message: I18n.t("chat.settings.auto_join_users_warning", {+ message: i18n("chat.settings.auto_join_users_warning", {category: this.args.channel.chatable.name,}),didConfirm: async () => {@@ -246,7 +243,7 @@ export default class ChatRouteChannelInfoSettings extends Component {this.args.channel.currentUserMembership[frontendKey] =result.membership[backendKey];- this.toasts.success({ data: { message: I18n.t("saved") } });+ this.toasts.success({ data: { message: i18n("saved") } });} catch (error) {popupAjaxError(error);}@@ -258,7 +255,7 @@ export default class ChatRouteChannelInfoSettings extends Component {const result = await this.chatApi.updateChannel(channel.id, {[property]: value,});- this.toasts.success({ data: { message: I18n.t("saved") } });+ this.toasts.success({ data: { message: i18n("saved") } });return result;} catch (error) {popupAjaxError(error);diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info.gjsindex a003808779e..1cea5542f66 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-info.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChatModalEditChannelName from "discourse/plugins/chat/discourse/components/chat/modal/edit-channel-name";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channels.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channels.gjsindex cfeecdf24ce..120d2ac1575 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channels.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channels.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelsListPublic from "discourse/plugins/chat/discourse/components/channels-list-public";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/direct-messages.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/direct-messages.gjsindex 22253be28ee..0d8b26e679e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/direct-messages.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/direct-messages.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelsListDirect from "discourse/plugins/chat/discourse/components/channels-list-direct";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/threads.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/threads.gjsindex d8136250172..381c7c05000 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/threads.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/threads.gjs@@ -1,6 +1,6 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import UserThreads from "discourse/plugins/chat/discourse/components/user-threads";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjsindex d1e5304e786..265b1a0a042 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/selection-manager.gjs@@ -8,7 +8,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";import { clipboardCopyAsync } from "discourse/lib/utilities";import { isTesting } from "discourse-common/config/environment";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DeleteMessagesConfirm from "discourse/plugins/chat/discourse/components/chat/modal/delete-messages-confirm";import ChatModalMoveMessageToChannel from "discourse/plugins/chat/discourse/components/chat/modal/move-message-to-channel";@@ -59,7 +59,7 @@ export default class ChatSelectionManager extends Component {}get deleteButtonTitle() {- return I18n.t("chat.selection.delete", {+ return i18n("chat.selection.delete", {selectionCount: this.args.pane.selectedMessageIds.length,totalCount: DELETE_COUNT_LIMIT,});@@ -147,7 +147,7 @@ export default class ChatSelectionManager extends Component {this.toasts.success({duration: 3000,data: {- message: I18n.t("chat.quote.copy_success"),+ message: i18n("chat.quote.copy_success"),},});}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/header.gjsindex 160d80e4896..7d928faabc9 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/header.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/header.gjs@@ -2,15 +2,14 @@ import Component from "@glimmer/component";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import replaceEmoji from "discourse/helpers/replace-emoji";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";export default class ChatThreadListHeader extends Component {@service router;@service site;- threadListTitle = I18n.t("chat.threads.list");+ threadListTitle = i18n("chat.threads.list");get title() {let title = replaceEmoji(this.threadListTitle);diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/item.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/item.gjsindex 0e5d9cf5a3c..26b88087fd3 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/item.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/thread-list/item.gjs@@ -7,7 +7,7 @@ import { gt } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";import formatDate from "discourse/helpers/format-date";import replaceEmoji from "discourse/helpers/replace-emoji";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ThreadUnreadIndicator from "discourse/plugins/chat/discourse/components/thread-unread-indicator";import ChatThreadParticipants from "../../chat-thread-participants";import ChatUserAvatar from "../../chat-user-avatar";diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header-unread-indicator.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header-unread-indicator.gjsindex 884b5516ccd..fc2b2c8abc0 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header-unread-indicator.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header-unread-indicator.gjs@@ -1,11 +1,11 @@import Component from "@glimmer/component";import { service } from "@ember/service";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ThreadHeaderUnreadIndicator extends Component {@service currentUser;- unreadCountLabel = I18n.t("chat.unread_threads_count", {+ unreadCountLabel = i18n("chat.unread_threads_count", {count: this.cappedUnreadCount,});diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjsindex c7aaade9afd..5bbbe0788b0 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs@@ -3,7 +3,7 @@ import { service } from "@ember/service";import noop from "discourse/helpers/noop";import replaceEmoji from "discourse/helpers/replace-emoji";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import and from "truth-helpers/helpers/and";import ThreadSettingsModal from "discourse/plugins/chat/discourse/components/chat/modal/thread-settings";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";@@ -21,23 +21,23 @@ export default class ChatThreadHeader extends Component {if (prevPage === "chat.channel.threads") {route = "chat.channel.threads";- title = I18n.t("chat.return_to_threads_list");+ title = i18n("chat.return_to_threads_list");models = this.channel?.routeModels;} else if (prevPage === "chat.channel.index" && this.site.desktopView) {route = "chat.channel.threads";- title = I18n.t("chat.return_to_threads_list");+ title = i18n("chat.return_to_threads_list");models = this.channel?.routeModels;} else if (prevPage === "chat.threads") {route = "chat.threads";- title = I18n.t("chat.my_threads.title");+ title = i18n("chat.my_threads.title");models = [];} else if (!this.currentUser.isInDoNotDisturb() && this.unreadCount > 0) {route = "chat.channel.threads";- title = I18n.t("chat.return_to_threads_list");+ title = i18n("chat.return_to_threads_list");models = this.channel?.routeModels;} else {route = "chat.channel.index";- title = I18n.t("chat.return_to_channel");+ title = i18n("chat.return_to_channel");models = this.channel?.routeModels;}@@ -49,7 +49,7 @@ export default class ChatThreadHeader extends Component {}get headerTitle() {- return this.args.thread?.title ?? I18n.t("chat.thread.label");+ return this.args.thread?.title ?? i18n("chat.thread.label");}get unreadCount() {diff --git a/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs b/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjsindex d3eabd99c82..5bc346e3ce3 100644--- a/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs@@ -7,7 +7,7 @@ import { htmlSafe } from "@ember/template";import { or } from "truth-helpers";import ReviewableCreatedBy from "discourse/components/reviewable-created-by";import ReviewablePostHeader from "discourse/components/reviewable-post-header";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";diff --git a/plugins/chat/assets/javascripts/discourse/components/toggle-channel-membership-button.gjs b/plugins/chat/assets/javascripts/discourse/components/toggle-channel-membership-button.gjsindex 4759b184828..191d442eb88 100644--- a/plugins/chat/assets/javascripts/discourse/components/toggle-channel-membership-button.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/toggle-channel-membership-button.gjs@@ -7,7 +7,7 @@ import DButton from "discourse/components/d-button";import PluginOutlet from "discourse/components/plugin-outlet";import concatClass from "discourse/helpers/concat-class";import { popupAjaxError } from "discourse/lib/ajax-error";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ToggleChannelMembershipButton extends Component {@service chat;@@ -22,10 +22,10 @@ export default class ToggleChannelMembershipButton extends Component {this.options = {labelType: "normal",- joinTitle: I18n.t("chat.channel_settings.join_channel"),+ joinTitle: i18n("chat.channel_settings.join_channel"),joinIcon: "",joinClass: "",- leaveTitle: I18n.t("chat.channel_settings.leave_channel"),+ leaveTitle: i18n("chat.channel_settings.leave_channel"),leaveIcon: "",leaveClass: "",...this.args.options,@@ -39,16 +39,16 @@ export default class ToggleChannelMembershipButton extends Component {if (this.options.labelType === "short") {if (this.args.channel.currentUserMembership.following) {- return I18n.t("chat.channel_settings.leave");+ return i18n("chat.channel_settings.leave");} else {- return I18n.t("chat.channel_settings.join");+ return i18n("chat.channel_settings.join");}}if (this.args.channel.currentUserMembership.following) {- return I18n.t("chat.channel_settings.leave_channel");+ return i18n("chat.channel_settings.leave_channel");} else {- return I18n.t("chat.channel_settings.join_channel");+ return i18n("chat.channel_settings.join_channel");}}diff --git a/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs b/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjsindex b548d35b9ac..e16d517287f 100644--- a/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs@@ -2,8 +2,8 @@ import Component from "@glimmer/component";import { cached } from "@glimmer/tracking";import { LinkTo } from "@ember/routing";import { service } from "@ember/service";-import i18n from "discourse-common/helpers/i18n";import { bind } from "discourse-common/utils/decorators";+import { i18n } from "discourse-i18n";import ChannelIcon from "discourse/plugins/chat/discourse/components/channel-icon";import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";import List from "discourse/plugins/chat/discourse/components/chat/list";diff --git a/plugins/chat/assets/javascripts/discourse/connectors/user-preferences-nav/chat-preferences.gjs b/plugins/chat/assets/javascripts/discourse/connectors/user-preferences-nav/chat-preferences.gjsindex 662c88f60f1..9c69c78fdfa 100644--- a/plugins/chat/assets/javascripts/discourse/connectors/user-preferences-nav/chat-preferences.gjs+++ b/plugins/chat/assets/javascripts/discourse/connectors/user-preferences-nav/chat-preferences.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { LinkTo } from "@ember/routing";import dIcon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ChatPreferences extends Component {static shouldRender({ model }, { siteSettings, currentUser }) {diff --git a/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js b/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.jsindex d7609513e1d..20a3101e351 100644--- a/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js+++ b/plugins/chat/assets/javascripts/discourse/controllers/preferences-chat.js@@ -4,7 +4,7 @@ import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import { isTesting } from "discourse-common/config/environment";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { CHAT_SOUNDS } from "discourse/plugins/chat/discourse/services/chat-audio-manager";const CHAT_ATTRS = [@@ -27,43 +27,43 @@ export default class PreferencesChatController extends Controller {@service chatAudioManager;@service siteSettings;- subpageTitle = I18n.t("chat.admin.title");+ subpageTitle = i18n("chat.admin.title");emailFrequencyOptions = [- { name: I18n.t("chat.email_frequency.never"), value: "never" },- { name: I18n.t("chat.email_frequency.when_away"), value: "when_away" },+ { name: i18n("chat.email_frequency.never"), value: "never" },+ { name: i18n("chat.email_frequency.when_away"), value: "when_away" },];headerIndicatorOptions = [{- name: I18n.t("chat.header_indicator_preference.all_new"),+ name: i18n("chat.header_indicator_preference.all_new"),value: HEADER_INDICATOR_PREFERENCE_ALL_NEW,},{- name: I18n.t("chat.header_indicator_preference.dm_and_mentions"),+ name: i18n("chat.header_indicator_preference.dm_and_mentions"),value: HEADER_INDICATOR_PREFERENCE_DM_AND_MENTIONS,},{- name: I18n.t("chat.header_indicator_preference.only_mentions"),+ name: i18n("chat.header_indicator_preference.only_mentions"),value: HEADER_INDICATOR_PREFERENCE_ONLY_MENTIONS,},{- name: I18n.t("chat.header_indicator_preference.never"),+ name: i18n("chat.header_indicator_preference.never"),value: HEADER_INDICATOR_PREFERENCE_NEVER,},];chatSeparateSidebarModeOptions = [{- name: I18n.t("admin.site_settings.chat_separate_sidebar_mode.always"),+ name: i18n("admin.site_settings.chat_separate_sidebar_mode.always"),value: "always",},{- name: I18n.t("admin.site_settings.chat_separate_sidebar_mode.fullscreen"),+ name: i18n("admin.site_settings.chat_separate_sidebar_mode.fullscreen"),value: "fullscreen",},{- name: I18n.t("admin.site_settings.chat_separate_sidebar_mode.never"),+ name: i18n("admin.site_settings.chat_separate_sidebar_mode.never"),value: "never",},];@@ -80,7 +80,7 @@ export default class PreferencesChatController extends Controller {@discourseComputedchatSounds() {return Object.keys(CHAT_SOUNDS).map((value) => {- return { name: I18n.t(`chat.sounds.${value}`), value };+ return { name: i18n(`chat.sounds.${value}`), value };});}diff --git a/plugins/chat/assets/javascripts/discourse/helpers/format-chat-date.js b/plugins/chat/assets/javascripts/discourse/helpers/format-chat-date.jsindex c72c36555e1..099c00c1637 100644--- a/plugins/chat/assets/javascripts/discourse/helpers/format-chat-date.js+++ b/plugins/chat/assets/javascripts/discourse/helpers/format-chat-date.js@@ -1,18 +1,18 @@import { htmlSafe } from "@ember/template";import User from "discourse/models/user";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default function formatChatDate(message, options = {}) {const currentUser = User.current();const tz = currentUser ? currentUser.user_option.timezone : moment.tz.guess();const date = moment(new Date(message.createdAt), tz);- const title = date.format(I18n.t("dates.long_with_year"));+ const title = date.format(i18n("dates.long_with_year"));const display =options.mode === "tiny"- ? date.format(I18n.t("dates.time_short"))- : date.format(I18n.t("dates.time"));+ ? date.format(i18n("dates.time_short"))+ : date.format(i18n("dates.time"));if (message.staged) {return htmlSafe(diff --git a/plugins/chat/assets/javascripts/discourse/initializers/chat-decorators.js b/plugins/chat/assets/javascripts/discourse/initializers/chat-decorators.jsindex 34fbb3977d7..8a1738cdfce 100644--- a/plugins/chat/assets/javascripts/discourse/initializers/chat-decorators.js+++ b/plugins/chat/assets/javascripts/discourse/initializers/chat-decorators.js@@ -7,7 +7,7 @@ import loadScript from "discourse/lib/load-script";import { withPluginApi } from "discourse/lib/plugin-api";import DiscourseURL from "discourse/lib/url";import { samePrefix } from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default {name: "chat-decorators",@@ -127,10 +127,10 @@ export default {if (this.currentUserTimezone) {dateTimeLinkEl.innerText = moment.tz(dateTimeRaw, this.currentUserTimezone)- .format(I18n.t("dates.long_no_year"));+ .format(i18n("dates.long_no_year"));} else {dateTimeLinkEl.innerText = moment(dateTimeRaw).format(- I18n.t("dates.long_no_year")+ i18n("dates.long_no_year"));}});@@ -154,7 +154,7 @@ export default {type: "image",closeOnContentClick: false,mainClass: "mfp-zoom-in",- tClose: I18n.t("lightbox.close"),+ tClose: i18n("lightbox.close"),tLoading: spinnerHTML,image: {verticalFit: true,diff --git a/plugins/chat/assets/javascripts/discourse/initializers/chat-setup.js b/plugins/chat/assets/javascripts/discourse/initializers/chat-setup.jsindex 149954d299d..2f50b3aa15b 100644--- a/plugins/chat/assets/javascripts/discourse/initializers/chat-setup.js+++ b/plugins/chat/assets/javascripts/discourse/initializers/chat-setup.js@@ -5,7 +5,7 @@ import { withPluginApi } from "discourse/lib/plugin-api";import { getOwnerWithFallback } from "discourse-common/lib/get-owner";import { replaceIcon } from "discourse-common/lib/icon-library";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { clearChatComposerButtons } from "discourse/plugins/chat/discourse/lib/chat-composer-buttons";import ChannelHashtagType from "discourse/plugins/chat/discourse/lib/hashtag-types/channel";import ChatHeaderIcon from "../components/chat/header/icon";@@ -36,11 +36,11 @@ class ChatSetupInit {return {icon: "comment-dots",class: "chat-messages",- activityText: I18n.t("about.activities.chat_messages", {+ activityText: i18n("about.activities.chat_messages", {count,formatted_number: number(count),}),- period: I18n.t("about.activities.periods.last_7_days"),+ period: i18n("about.activities.periods.last_7_days"),};}});@@ -132,10 +132,10 @@ class ChatSetupInit {if (currentUserTimezone) {dateTimeEl.innerText = moment.tz(dateTimeRaw, currentUserTimezone)- .format(I18n.t("dates.long_no_year"));+ .format(i18n("dates.long_no_year"));} else {dateTimeEl.innerText = moment(dateTimeRaw).format(- I18n.t("dates.long_no_year")+ i18n("dates.long_no_year"));}diff --git a/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js b/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.jsindex 73776e3d0dc..bdfd611f0ff 100644--- a/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js+++ b/plugins/chat/assets/javascripts/discourse/initializers/chat-sidebar.js@@ -9,7 +9,7 @@ import { emojiUnescape } from "discourse/lib/text";import { escapeExpression } from "discourse/lib/utilities";import { avatarUrl } from "discourse-common/lib/avatar-utils";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message";import {CHAT_PANEL,@@ -35,7 +35,7 @@ export default {(BaseCustomSidebarPanel) =>class ChatSidebarPanel extends BaseCustomSidebarPanel {key = CHAT_PANEL;- switchButtonLabel = I18n.t("sidebar.panels.chat.label");+ switchButtonLabel = i18n("sidebar.panels.chat.label");switchButtonIcon = "d-chat";get switchButtonDefaultUrl() {@@ -57,8 +57,8 @@ export default {(BaseCustomSidebarSection, BaseCustomSidebarSectionLink) => {const SidebarChatMyThreadsSectionLink = class extends BaseCustomSidebarSectionLink {route = "chat.threads";- text = I18n.t("chat.my_threads.title");- title = I18n.t("chat.my_threads.title");+ text = i18n("chat.my_threads.title");+ title = i18n("chat.my_threads.title");name = "user-threads";prefixType = "icon";prefixValue = "discourse-threads";@@ -181,7 +181,7 @@ export default {get title() {return this.channel.escapedDescription? htmlSafe(this.channel.escapedDescription)- : `${this.channel.escapedTitle} ${I18n.t("chat.title")}`;+ : `${this.channel.escapedTitle} ${i18n("chat.title")}`;}get prefixBadge() {@@ -248,18 +248,18 @@ export default {}get title() {- return I18n.t("chat.chat_channels");+ return i18n("chat.chat_channels");}get text() {- return I18n.t("chat.chat_channels");+ return i18n("chat.chat_channels");}get actions() {return [{id: "browseChannels",- title: I18n.t("chat.channels_list_popup.browse"),+ title: i18n("chat.channels_list_popup.browse"),action: () => this.router.transitionTo("chat.browse.open"),},];@@ -296,7 +296,7 @@ export default {suffixCSSClass = "urgent";hoverType = "icon";hoverValue = "xmark";- hoverTitle = I18n.t("chat.direct_messages.close");+ hoverTitle = i18n("chat.direct_messages.close");constructor({ channel, chatService, currentUser }) {super(...arguments);@@ -307,7 +307,7 @@ export default {if (this.oneOnOneMessage) {const user = this.channel.chatable.users[0];- if (user.username !== I18n.t("chat.deleted_chat_username")) {+ if (user.username !== i18n("chat.deleted_chat_username")) {user.statusManager.trackStatus();}}@@ -364,11 +364,11 @@ export default {get title() {if (this.channel.chatable.group) {- return I18n.t("chat.placeholder_channel", {+ return i18n("chat.placeholder_channel", {channelName: this.channel.escapedTitle,});} else {- return I18n.t("chat.placeholder_users", {+ return i18n("chat.placeholder_users", {commaSeparatedNames: this.channel.escapedTitle,});}@@ -475,11 +475,11 @@ export default {}get title() {- return I18n.t("chat.direct_messages.title");+ return i18n("chat.direct_messages.title");}get text() {- return I18n.t("chat.direct_messages.title");+ return i18n("chat.direct_messages.title");}get actions() {@@ -490,7 +490,7 @@ export default {return [{id: "startDm",- title: I18n.t("chat.direct_messages.new"),+ title: i18n("chat.direct_messages.new"),action: () => {this.modal.show(ChatModalNewMessage);},diff --git a/plugins/chat/assets/javascripts/discourse/initializers/chat-user-menu.js b/plugins/chat/assets/javascripts/discourse/initializers/chat-user-menu.jsindex d724a37d2b8..edf5d0a9f47 100644--- a/plugins/chat/assets/javascripts/discourse/initializers/chat-user-menu.js+++ b/plugins/chat/assets/javascripts/discourse/initializers/chat-user-menu.js@@ -1,7 +1,7 @@import { withPluginApi } from "discourse/lib/plugin-api";import { formatUsername } from "discourse/lib/utilities";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import slugifyChannel from "discourse/plugins/chat/discourse/lib/slugify-channel";export default {@@ -19,9 +19,9 @@ export default {"chat_invitation",(NotificationItemBase) => {return class extends NotificationItemBase {- linkTitle = I18n.t("notifications.titles.chat_invitation");+ linkTitle = i18n("notifications.titles.chat_invitation");icon = "link";- description = I18n.t("notifications.chat_invitation");+ description = i18n("notifications.chat_invitation");get linkHref() {const data = this.notification.data;@@ -70,7 +70,7 @@ export default {}get linkTitle() {- return I18n.t("notifications.titles.chat_mention");+ return i18n("notifications.titles.chat_mention");}get icon() {@@ -95,7 +95,7 @@ export default {const i18nSuffix = identifier ? "other_plain" : "direct";- return I18n.t(`${i18nPrefix}.${i18nSuffix}`, {+ return i18n(`${i18nPrefix}.${i18nSuffix}`, {identifier,channel: this.notification.data.chat_channel_title,});@@ -109,19 +109,19 @@ export default {(NotificationItemBase) => {return class extends NotificationItemBase {icon = "discourse-threads";- linkTitle = I18n.t("notifications.titles.chat_watched_thread");+ linkTitle = i18n("notifications.titles.chat_watched_thread");description = this.notification.data.description;get label() {const data = this.notification.data;if (data.user_ids.length > 2) {- return I18n.t("notifications.chat_watched_thread_label", {+ return i18n("notifications.chat_watched_thread_label", {username: formatUsername(data.username2),count: data.user_ids.length - 1,});} else if (data.user_ids.length === 2) {- return I18n.t("notifications.chat_watched_thread_label", {+ return i18n("notifications.chat_watched_thread_label", {username: formatUsername(data.username2),username2: formatUsername(data.username),count: 1,diff --git a/plugins/chat/assets/javascripts/discourse/lib/chat-composer-buttons.js b/plugins/chat/assets/javascripts/discourse/lib/chat-composer-buttons.jsindex c413e42d1c1..8e2d60b5587 100644--- a/plugins/chat/assets/javascripts/discourse/lib/chat-composer-buttons.js+++ b/plugins/chat/assets/javascripts/discourse/lib/chat-composer-buttons.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let _chatComposerButtons = {};@@ -89,7 +89,7 @@ export function chatComposerButtons(composer, position, context) {const ariaLabel = computeButton(composer, button, "ariaLabel");if (ariaLabel) {- result.ariaLabel = I18n.t(ariaLabel);+ result.ariaLabel = i18n(ariaLabel);} else {const translatedAriaLabel = computeButton(composer,@@ -101,7 +101,7 @@ export function chatComposerButtons(composer, position, context) {const title = computeButton(composer, button, "title");result.title = title- ? I18n.t(title)+ ? i18n(title): computeButton(composer, button, "translatedTitle");result.classNames = (diff --git a/plugins/chat/assets/javascripts/discourse/lib/chat-message-flag.js b/plugins/chat/assets/javascripts/discourse/lib/chat-message-flag.jsindex 76d6a828b86..25c9b76e540 100644--- a/plugins/chat/assets/javascripts/discourse/lib/chat-message-flag.js+++ b/plugins/chat/assets/javascripts/discourse/lib/chat-message-flag.js@@ -2,7 +2,7 @@ import { setOwner } from "@ember/owner";import { service } from "@ember/service";import { popupAjaxError } from "discourse/lib/ajax-error";import getURL from "discourse-common/lib/get-url";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class ChatMessageFlag {@service chatApi;@@ -35,7 +35,7 @@ export default class ChatMessageFlag {return flags.map((flag) => {flag.set("description",- I18n.t(`chat.flags.${flag.name_key}`, {+ i18n(`chat.flags.${flag.name_key}`, {basePath: getURL(""),defaultValue: flag.description,})diff --git a/plugins/chat/assets/javascripts/discourse/lib/chat-message-interactor.js b/plugins/chat/assets/javascripts/discourse/lib/chat-message-interactor.jsindex e01f06e1fd8..5e260804432 100644--- a/plugins/chat/assets/javascripts/discourse/lib/chat-message-interactor.js+++ b/plugins/chat/assets/javascripts/discourse/lib/chat-message-interactor.js@@ -10,7 +10,7 @@ import { clipboardCopy } from "discourse/lib/utilities";import Bookmark from "discourse/models/bookmark";import getURL from "discourse-common/lib/get-url";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { MESSAGE_CONTEXT_THREAD } from "discourse/plugins/chat/discourse/components/chat-message";import ChatMessageFlag from "discourse/plugins/chat/discourse/lib/chat-message-flag";import ChatMessage from "discourse/plugins/chat/discourse/models/chat-message";@@ -162,14 +162,14 @@ export default class ChatMessageInteractor {buttons.push({id: "copyLink",- name: I18n.t("chat.copy_link"),+ name: i18n("chat.copy_link"),icon: "link",});if (this.site.mobileView) {buttons.push({id: "copyText",- name: I18n.t("chat.copy_text"),+ name: i18n("chat.copy_text"),icon: "clipboard",});}@@ -177,7 +177,7 @@ export default class ChatMessageInteractor {if (this.canEdit) {buttons.push({id: "edit",- name: I18n.t("chat.edit"),+ name: i18n("chat.edit"),icon: "pencil",});}@@ -185,7 +185,7 @@ export default class ChatMessageInteractor {if (!this.pane.selectingMessages) {buttons.push({id: "select",- name: I18n.t("chat.select"),+ name: i18n("chat.select"),icon: "list-check",});}@@ -193,7 +193,7 @@ export default class ChatMessageInteractor {if (this.canFlagMessage) {buttons.push({id: "flag",- name: I18n.t("chat.flag"),+ name: i18n("chat.flag"),icon: "flag",});}@@ -201,7 +201,7 @@ export default class ChatMessageInteractor {if (this.canDeleteMessage) {buttons.push({id: "delete",- name: I18n.t("chat.delete"),+ name: i18n("chat.delete"),icon: "trash-can",});}@@ -209,7 +209,7 @@ export default class ChatMessageInteractor {if (this.canRestoreMessage) {buttons.push({id: "restore",- name: I18n.t("chat.restore"),+ name: i18n("chat.restore"),icon: "arrow-rotate-left",});}@@ -217,7 +217,7 @@ export default class ChatMessageInteractor {if (this.canRebakeMessage) {buttons.push({id: "rebake",- name: I18n.t("chat.rebake_message"),+ name: i18n("chat.rebake_message"),icon: "rotate",});}@@ -249,7 +249,7 @@ export default class ChatMessageInteractor {clipboardCopy(this.message.message);this.toasts.success({duration: 3000,- data: { message: I18n.t("chat.text_copied") },+ data: { message: i18n("chat.text_copied") },});}@@ -269,7 +269,7 @@ export default class ChatMessageInteractor {clipboardCopy(url);this.toasts.success({duration: 1500,- data: { message: I18n.t("chat.link_copied") },+ data: { message: i18n("chat.link_copied") },});}diff --git a/plugins/chat/assets/javascripts/discourse/lib/get-reaction-text.js b/plugins/chat/assets/javascripts/discourse/lib/get-reaction-text.jsindex 73047ecffad..b273201f61d 100644--- a/plugins/chat/assets/javascripts/discourse/lib/get-reaction-text.js+++ b/plugins/chat/assets/javascripts/discourse/lib/get-reaction-text.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const MAX_DISPLAYED_USERNAMES = 15;@@ -11,7 +11,7 @@ function filterUsernames(users, currentUser) {function reactionIncludingCurrentUser(reaction, currentUser) {if (reaction.count === 1) {- return I18n.t("chat.reactions.only_you", {+ return i18n("chat.reactions.only_you", {emoji: reaction.emoji,});}@@ -19,7 +19,7 @@ function reactionIncludingCurrentUser(reaction, currentUser) {const usernames = filterUsernames(reaction.users, currentUser);if (reaction.count === 2) {- return I18n.t("chat.reactions.you_and_single_user", {+ return i18n("chat.reactions.you_and_single_user", {emoji: reaction.emoji,username: usernames.pop(),});@@ -29,14 +29,14 @@ function reactionIncludingCurrentUser(reaction, currentUser) {const unnamedUserCount = reaction.count - usernames.length - 1;if (unnamedUserCount > 0) {- return I18n.t("chat.reactions.you_multiple_users_and_more", {+ return i18n("chat.reactions.you_multiple_users_and_more", {emoji: reaction.emoji,commaSeparatedUsernames: joinUsernames(usernames),count: unnamedUserCount,});}- return I18n.t("chat.reactions.you_and_multiple_users", {+ return i18n("chat.reactions.you_and_multiple_users", {emoji: reaction.emoji,username: usernames.pop(),commaSeparatedUsernames: joinUsernames(usernames),@@ -47,7 +47,7 @@ function reactionText(reaction, currentUser) {const usernames = filterUsernames(reaction.users, currentUser);if (reaction.count === 1) {- return I18n.t("chat.reactions.single_user", {+ return i18n("chat.reactions.single_user", {emoji: reaction.emoji,username: usernames.pop(),});@@ -56,14 +56,14 @@ function reactionText(reaction, currentUser) {const unnamedUserCount = reaction.count - usernames.length;if (unnamedUserCount > 0) {- return I18n.t("chat.reactions.multiple_users_and_more", {+ return i18n("chat.reactions.multiple_users_and_more", {emoji: reaction.emoji,commaSeparatedUsernames: joinUsernames(usernames),count: unnamedUserCount,});}- return I18n.t("chat.reactions.multiple_users", {+ return i18n("chat.reactions.multiple_users", {emoji: reaction.emoji,username: usernames.pop(),commaSeparatedUsernames: joinUsernames(usernames),@@ -71,7 +71,7 @@ function reactionText(reaction, currentUser) {}function joinUsernames(usernames) {- return usernames.join(I18n.t("word_connector.comma"));+ return usernames.join(i18n("word_connector.comma"));}export function getReactionText(reaction, currentUser) {diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat.js b/plugins/chat/assets/javascripts/discourse/routes/chat.jsindex 1f203707b1f..e1e841680be 100644--- a/plugins/chat/assets/javascripts/discourse/routes/chat.js+++ b/plugins/chat/assets/javascripts/discourse/routes/chat.js@@ -4,7 +4,7 @@ import { withPluginApi } from "discourse/lib/plugin-api";import { defaultHomepage } from "discourse/lib/utilities";import { scrollTop } from "discourse/mixins/scroll-top";import DiscourseRoute from "discourse/routes/discourse";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { getUserChatSeparateSidebarMode } from "discourse/plugins/chat/discourse/lib/get-user-chat-separate-sidebar-mode";import {CHAT_PANEL,@@ -19,7 +19,7 @@ export default class ChatRoute extends DiscourseRoute {@service currentUser;titleToken() {- return I18n.t("chat.title_capitalized");+ return i18n("chat.title_capitalized");}beforeModel(transition) {diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.jsindex 1277fef0c1f..9a3d884229c 100644--- a/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js+++ b/plugins/chat/assets/javascripts/discourse/services/chat-subscriptions-manager.js@@ -1,7 +1,7 @@import Service, { service } from "@ember/service";import { NotificationLevels } from "discourse/lib/notification-levels";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import { CHANNEL_STATUSES } from "discourse/plugins/chat/discourse/models/chat-channel";import ChatChannelArchive from "../models/chat-channel-archive";@@ -142,7 +142,7 @@ export default class ChatSubscriptionsManager extends Service {this.chatChannelsManager.find(busData.channel_id).then((channel) => {if (this.chat.activeChannel.id === channel.id) {this.dialog.alert({- message: I18n.t("chat.kicked_from_channel"),+ message: i18n("chat.kicked_from_channel"),didConfirm: () => {this.chatChannelsManager.remove(channel);diff --git a/plugins/chat/assets/javascripts/lib/discourse-markdown/chat-transcript.js b/plugins/chat/assets/javascripts/lib/discourse-markdown/chat-transcript.jsindex f818908862a..e323b9a48bc 100644--- a/plugins/chat/assets/javascripts/lib/discourse-markdown/chat-transcript.js+++ b/plugins/chat/assets/javascripts/lib/discourse-markdown/chat-transcript.js@@ -1,5 +1,5 @@import { performEmojiUnescape } from "pretty-text/emoji";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";let customMarkdownCookFn;@@ -47,7 +47,7 @@ const chatTranscriptRule = {lazy: true,});- channelToken.content = I18n.t("chat.quote.original_channel", {+ channelToken.content = i18n("chat.quote.original_channel", {channel: unescapedChannelName,channelLink,});@@ -97,7 +97,7 @@ const chatTranscriptRule = {});threadTitleToken.content = unescapedThreadTitle? unescapedThreadTitle- : I18n.t("chat.quote.default_thread_title");+ : i18n("chat.quote.default_thread_title");state.push("span_thread_title_close", "span", -1);diff --git a/plugins/chat/test/javascripts/components/chat-channel-card-test.js b/plugins/chat/test/javascripts/components/chat-channel-card-test.jsindex 0cd45e22b43..aed4e4d844c 100644--- a/plugins/chat/test/javascripts/components/chat-channel-card-test.js+++ b/plugins/chat/test/javascripts/components/chat-channel-card-test.js@@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";module("Discourse Chat | Component | chat-channel-card", function (hooks) {@@ -72,7 +72,7 @@ module("Discourse Chat | Component | chat-channel-card", function (hooks) {assert.strictEqual(query(".chat-channel-card__members").textContent.trim(),- I18n.t("chat.channel.memberships_count", { count: 4 })+ i18n("chat.channel.memberships_count", { count: 4 }));});diff --git a/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js b/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.jsindex 8a53b964f7a..83c57b838b7 100644--- a/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js+++ b/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js@@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender from "discourse/tests/helpers/create-pretender";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {@@ -35,7 +35,7 @@ module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {assert.dom(".chat-channel-leave-btn")- .hasAttribute("title", I18n.t("chat.direct_messages.leave"));+ .hasAttribute("title", i18n("chat.direct_messages.leave"));});test("has a specific title for message channel", async function (assert) {@@ -45,7 +45,7 @@ module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {assert.dom(".chat-channel-leave-btn")- .hasAttribute("title", I18n.t("chat.leave"));+ .hasAttribute("title", i18n("chat.leave"));});test("is not visible on mobile", async function (assert) {diff --git a/plugins/chat/test/javascripts/components/chat-channel-status-test.js b/plugins/chat/test/javascripts/components/chat-channel-status-test.jsindex ade8c623b86..8e34caf3c0c 100644--- a/plugins/chat/test/javascripts/components/chat-channel-status-test.js+++ b/plugins/chat/test/javascripts/components/chat-channel-status-test.js@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";import {CHANNEL_STATUSES,@@ -30,7 +30,7 @@ module("Discourse Chat | Component | chat-channel-status", function (hooks) {assert.dom(".chat-channel-status")- .hasText(I18n.t("chat.channel_status.closed_header"));+ .hasText(i18n("chat.channel_status.closed_header"));});test("accepts a format argument", async function (assert) {@@ -44,7 +44,7 @@ module("Discourse Chat | Component | chat-channel-status", function (hooks) {assert.dom(".chat-channel-status")- .hasText(I18n.t("chat.channel_status.archived"));+ .hasText(i18n("chat.channel_status.archived"));});test("renders the correct icon", async function (assert) {diff --git a/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js b/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.jsindex 3cde9f32793..a0b7d0c5e96 100644--- a/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js+++ b/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";module(@@ -74,7 +74,7 @@ module(assert.strictEqual(query(".chat-composer__input").placeholder,- I18n.t("chat.placeholder_group")+ i18n("chat.placeholder_group"));});diff --git a/plugins/chat/test/javascripts/components/chat-composer-upload-test.js b/plugins/chat/test/javascripts/components/chat-composer-upload-test.jsindex 9ece7516654..c088264148d 100644--- a/plugins/chat/test/javascripts/components/chat-composer-upload-test.js+++ b/plugins/chat/test/javascripts/components/chat-composer-upload-test.js@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';module("Discourse Chat | Component | chat-composer-upload", function (hooks) {setupRenderingTest(hooks);@@ -17,7 +17,7 @@ module("Discourse Chat | Component | chat-composer-upload", function (hooks) {await render(hbs`<ChatComposerUpload @upload={{this.upload}} />`);assert.dom(".upload-progress[value='50']").exists();- assert.dom(".uploading").hasText(I18n.t("uploading"));+ assert.dom(".uploading").hasText(i18n("uploading"));});test("image - uploading in progress", async function (assert) {@@ -31,7 +31,7 @@ module("Discourse Chat | Component | chat-composer-upload", function (hooks) {assert.dom(".d-icon-far-image").exists();assert.dom(".upload-progress[value='78']").exists();- assert.dom(".uploading").hasText(I18n.t("uploading"));+ assert.dom(".uploading").hasText(i18n("uploading"));});test("image - preprocessing upload in progress", async function (assert) {@@ -44,7 +44,7 @@ module("Discourse Chat | Component | chat-composer-upload", function (hooks) {await render(hbs`<ChatComposerUpload @upload={{this.upload}} />`);- assert.dom(".processing").hasText(I18n.t("processing"));+ assert.dom(".processing").hasText(i18n("processing"));});test("file - upload complete", async function (assert) {diff --git a/plugins/chat/test/javascripts/components/chat-header-icon-test.js b/plugins/chat/test/javascripts/components/chat-header-icon-test.jsindex f47eefb37f0..d61fea5bb5f 100644--- a/plugins/chat/test/javascripts/components/chat-header-icon-test.js+++ b/plugins/chat/test/javascripts/components/chat-header-icon-test.js@@ -3,7 +3,7 @@ import { hbs } from "ember-cli-htmlbars";import { module, test } from "qunit";import sinon from "sinon";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import { HEADER_INDICATOR_PREFERENCE_ALL_NEW } from "discourse/plugins/chat/discourse/controllers/preferences-chat";module("Discourse Chat | Component | chat-header-icon", function (hooks) {@@ -21,7 +21,7 @@ module("Discourse Chat | Component | chat-header-icon", function (hooks) {assert.dom(".icon.btn-flat")- .hasAttribute("title", I18n.t("chat.title_capitalized"))+ .hasAttribute("title", i18n("chat.title_capitalized")).hasAttribute("href", "/chat");assert.dom(".d-icon-d-chat").exists();@@ -37,7 +37,7 @@ module("Discourse Chat | Component | chat-header-icon", function (hooks) {assert.dom(".icon.btn-flat")- .hasAttribute("title", I18n.t("sidebar.panels.forum.label"))+ .hasAttribute("title", i18n("sidebar.panels.forum.label")).hasAttribute("href", "/latest");assert.dom(".d-icon-shuffle").exists();@@ -50,7 +50,7 @@ module("Discourse Chat | Component | chat-header-icon", function (hooks) {assert.dom(".icon.btn-flat")- .hasAttribute("title", I18n.t("chat.title_capitalized"))+ .hasAttribute("title", i18n("chat.title_capitalized")).hasAttribute("href", "/chat");assert.dom(".d-icon-d-chat").exists();@@ -69,7 +69,7 @@ module("Discourse Chat | Component | chat-header-icon", function (hooks) {assert.dom(".icon.btn-flat")- .hasAttribute("title", I18n.t("sidebar.panels.forum.label"))+ .hasAttribute("title", i18n("sidebar.panels.forum.label")).hasAttribute("href", "/latest");assert.dom(".d-icon-shuffle").exists();assert.dom(".chat-channel-unread-indicator__number").doesNotExist();@@ -84,7 +84,7 @@ module("Discourse Chat | Component | chat-header-icon", function (hooks) {assert.dom(".icon.btn-flat")- .hasAttribute("title", I18n.t("sidebar.panels.chat.label"))+ .hasAttribute("title", i18n("sidebar.panels.chat.label")).hasAttribute("href", "/chat");assert.dom(".d-icon-d-chat").exists();assertdiff --git a/plugins/chat/test/javascripts/components/chat-message-info-test.js b/plugins/chat/test/javascripts/components/chat-message-info-test.jsindex 0581ff9f9bd..cf41329dbcd 100644--- a/plugins/chat/test/javascripts/components/chat-message-info-test.js+++ b/plugins/chat/test/javascripts/components/chat-message-info-test.js@@ -5,7 +5,7 @@ import { module, test } from "qunit";import Bookmark from "discourse/models/bookmark";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";import ChatMessage from "discourse/plugins/chat/discourse/models/chat-message";@@ -28,7 +28,7 @@ module("Discourse Chat | Component | chat-message-info", function (hooks) {.hasText(this.message.chatWebhookEvent.username);assert.strictEqual(query(".chat-message-info__bot-indicator").textContent.trim(),- I18n.t("chat.bot")+ i18n("chat.bot"));});@@ -108,7 +108,7 @@ module("Discourse Chat | Component | chat-message-info", function (hooks) {assert.dom(".chat-message-info__flag > .svg-icon-title")- .hasAttribute("title", I18n.t("chat.you_flagged"));+ .hasAttribute("title", i18n("chat.you_flagged"));});test("reviewable", async function (assert) {@@ -121,7 +121,7 @@ module("Discourse Chat | Component | chat-message-info", function (hooks) {assert.dom(".chat-message-info__flag > .svg-icon-title")- .hasAttribute("title", I18n.t("chat.you_flagged"));+ .hasAttribute("title", i18n("chat.you_flagged"));});test("with username classes", async function (assert) {diff --git a/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js b/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.jsindex 45085027675..d7f0bebecbc 100644--- a/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js+++ b/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js@@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import CoreFabricators from "discourse/lib/fabricators";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";module(@@ -33,7 +33,7 @@ module(assert.dom(".chat-message-left-gutter__flag .svg-icon-title")- .hasAttribute("title", I18n.t("chat.flagged"));+ .hasAttribute("title", i18n("chat.flagged"));});test("with flag status", async function (assert) {@@ -45,7 +45,7 @@ module(assert.dom(".chat-message-left-gutter__flag .svg-icon-title")- .hasAttribute("title", I18n.t("chat.you_flagged"));+ .hasAttribute("title", i18n("chat.you_flagged"));});test("bookmark", async function (assert) {diff --git a/plugins/chat/test/javascripts/components/chat-notices-test.js b/plugins/chat/test/javascripts/components/chat-notices-test.jsindex 5373b44b471..54f7b312981 100644--- a/plugins/chat/test/javascripts/components/chat-notices-test.js+++ b/plugins/chat/test/javascripts/components/chat-notices-test.js@@ -5,7 +5,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender from "discourse/tests/helpers/create-pretender";import { queryAll } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";module("Discourse Chat | Component | chat-notice", function (hooks) {@@ -90,7 +90,7 @@ module("Discourse Chat | Component | chat-notice", function (hooks) {assert.dom(".mention-without-membership-notice__body__text").hasText(text);assert.dom(".mention-without-membership-notice__body__link")- .hasText(I18n.t("chat.mention_warning.invite"));+ .hasText(i18n("chat.mention_warning.invite"));pretender.post(`/chat/api/channels/${this.channel.id}/invites`, () => {return [200, { "Content-Type": "application/json" }, {}];diff --git a/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js b/plugins/chat/test/javascripts/components/chat-retention-reminder-test.jsindex f6875f040bc..a3faae79d73 100644--- a/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js+++ b/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js@@ -2,7 +2,7 @@ import { render } from "@ember/test-helpers";import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";module(@@ -17,7 +17,7 @@ module(await render(hbs`<ChatRetentionReminder @channel={{this.channel}} />`);assert.dom(".chat-retention-reminder").includesText(- I18n.t("chat.retention_reminders.long", {+ i18n("chat.retention_reminders.long", {count: this.siteSettings.chat_channel_retention_days,}));@@ -32,7 +32,7 @@ module();assert.dom(".chat-retention-reminder").includesText(- I18n.t("chat.retention_reminders.short", {+ i18n("chat.retention_reminders.short", {count: this.siteSettings.chat_channel_retention_days,}));diff --git a/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js b/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.jsindex d75f7a4f7b9..3424efce619 100644--- a/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js+++ b/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";module(@@ -21,7 +21,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.indefinitely_long"));+ .includesText(i18n("chat.retention_reminders.indefinitely_long"));await render(hbs`<ChatRetentionReminderText @channel={{this.channel}} @type="short" />`@@ -29,7 +29,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.indefinitely_short"));+ .includesText(i18n("chat.retention_reminders.indefinitely_short"));});test("when channel is a public channel", async function (assert) {@@ -42,7 +42,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.long", { count: 10 }));+ .includesText(i18n("chat.retention_reminders.long", { count: 10 }));await render(hbs`<ChatRetentionReminderText @channel={{this.channel}} @type="short" />`@@ -50,7 +50,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.short", { count: 10 }));+ .includesText(i18n("chat.retention_reminders.short", { count: 10 }));});test("when channel is a DM channel", async function (assert) {@@ -63,7 +63,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.long", { count: 10 }));+ .includesText(i18n("chat.retention_reminders.long", { count: 10 }));await render(hbs`<ChatRetentionReminderText @channel={{this.channel}} @type="short" />`@@ -71,7 +71,7 @@ module(assert.dom(".chat-retention-reminder-text")- .includesText(I18n.t("chat.retention_reminders.short", { count: 10 }));+ .includesText(i18n("chat.retention_reminders.short", { count: 10 }));});});diff --git a/plugins/chat/test/javascripts/integration/components/user-menu/chat-notifications-list-test.js b/plugins/chat/test/javascripts/integration/components/user-menu/chat-notifications-list-test.jsindex 77c8fefeae5..bf93ca54797 100644--- a/plugins/chat/test/javascripts/integration/components/user-menu/chat-notifications-list-test.js+++ b/plugins/chat/test/javascripts/integration/components/user-menu/chat-notifications-list-test.js@@ -4,7 +4,7 @@ import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';module("Integration | Component | user-menu | chat-notifications-list",@@ -24,7 +24,7 @@ module(assert.dom(".empty-state .empty-state-body").exists();assert.strictEqual(query(".empty-state .empty-state-title").textContent.trim(),- I18n.t("user_menu.no_chat_notifications_title")+ i18n("user_menu.no_chat_notifications_title"));});}diff --git a/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js b/plugins/checklist/assets/javascripts/discourse/initializers/checklist.jsindex 02d1f658cf8..89f6d9ece90 100644--- a/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js+++ b/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js@@ -2,7 +2,7 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { withPluginApi } from "discourse/lib/plugin-api";import { iconHTML } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function initializePlugin(api) {const siteSettings = api.container.lookup("service:site-settings");@@ -150,7 +150,7 @@ export function checklistSyntax(elem, postDecorator) {await postModel.save({raw: newRaw,- edit_reason: I18n.t("checklist.edit_reason"),+ edit_reason: i18n("checklist.edit_reason"),});postWidget.attrs.isSaving = false;diff --git a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js b/plugins/discourse-details/assets/javascripts/initializers/apply-details.jsindex a31c3c7435e..bd7a2d505d4 100644--- a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js+++ b/plugins/discourse-details/assets/javascripts/initializers/apply-details.js@@ -1,6 +1,6 @@import $ from "jquery";import { withPluginApi } from "discourse/lib/plugin-api";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";function initializeDetails(api) {api.decorateCooked(($elem) => $("details", $elem), {@@ -10,7 +10,7 @@ function initializeDetails(api) {api.addComposerToolbarPopupMenuOption({action: function (toolbarEvent) {toolbarEvent.applySurround(- "\n" + `[details="${I18n.t("composer.details_title")}"]` + "\n",+ "\n" + `[details="${i18n("composer.details_title")}"]` + "\n","\n[/details]\n","details_text",{ multiline: false }diff --git a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.jsindex 16aa67344fb..ba21d46e716 100644--- a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js+++ b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js@@ -2,7 +2,7 @@ import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';acceptance("Details Button", function (needs) {needs.user();@@ -17,11 +17,11 @@ acceptance("Details Button", function (needs) {await categoryChooser.selectRowByValue(2);await popupMenu.expand();- await popupMenu.selectRowByName(I18n.t("details.title"));+ await popupMenu.selectRowByName(i18n("details.title"));assert.strictEqual(query(".d-editor-input").value,- `\n[details="${I18n.t("composer.details_title")}"]\n${I18n.t(+ `\n[details="${i18n("composer.details_title")}"]\n${i18n("composer.details_text")}\n[/details]\n`,"it should contain the right output"@@ -34,11 +34,11 @@ acceptance("Details Button", function (needs) {textarea.selectionEnd = textarea.value.length;await popupMenu.expand();- await popupMenu.selectRowByName(I18n.t("details.title"));+ await popupMenu.selectRowByName(i18n("details.title"));assert.strictEqual(query(".d-editor-input").value,- `\n[details="${I18n.t(+ `\n[details="${i18n("composer.details_title")}"]\nThis is my title\n[/details]\n`,"it should contain the right selected output"@@ -61,11 +61,11 @@ acceptance("Details Button", function (needs) {textarea.selectionEnd = 28;await popupMenu.expand();- await popupMenu.selectRowByName(I18n.t("details.title"));+ await popupMenu.selectRowByName(i18n("details.title"));assert.strictEqual(query(".d-editor-input").value,- `Before \n[details="${I18n.t(+ `Before \n[details="${i18n("composer.details_title")}"]\nsome text in between\n[/details]\n After`,"it should contain the right output"@@ -88,11 +88,11 @@ acceptance("Details Button", function (needs) {textarea.selectionEnd = 29;await popupMenu.expand();- await popupMenu.selectRowByName(I18n.t("details.title"));+ await popupMenu.selectRowByName(i18n("details.title"));assert.strictEqual(query(".d-editor-input").value,- `Before \n\n[details="${I18n.t(+ `Before \n\n[details="${i18n("composer.details_title")}"]\nsome text in between\n[/details]\n\n After`,"it should contain the right output"@@ -126,11 +126,11 @@ acceptance("Details Button", function (needs) {textarea.selectionEnd = textarea.value.length;await popupMenu.expand();- await popupMenu.selectRowByName(I18n.t("details.title"));+ await popupMenu.selectRowByName(i18n("details.title"));assert.strictEqual(query(".d-editor-input").value,- `\n[details="${I18n.t(+ `\n[details="${i18n("composer.details_title")}"]\n${multilineInput}\n[/details]\n`,"it should contain the right output"diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js b/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.jsindex ce2c6ea7e93..2f47032b093 100644--- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js+++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/modal/local-dates-create.js@@ -8,7 +8,7 @@ import { applyLocalDates } from "discourse/lib/local-dates";import { cook } from "discourse/lib/text";import { INPUT_DELAY } from "discourse-common/config/environment";import computed, { debounce } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import generateDateMarkup from "discourse/plugins/discourse-local-dates/lib/local-date-markup-generator";export default class LocalDatesCreate extends Component {@@ -215,35 +215,35 @@ export default class LocalDatesCreate extends Component {return [{- name: I18n.t(`${key}.every_day`),+ name: i18n(`${key}.every_day`),id: "1.days",},{- name: I18n.t(`${key}.every_week`),+ name: i18n(`${key}.every_week`),id: "1.weeks",},{- name: I18n.t(`${key}.every_two_weeks`),+ name: i18n(`${key}.every_two_weeks`),id: "2.weeks",},{- name: I18n.t(`${key}.every_month`),+ name: i18n(`${key}.every_month`),id: "1.months",},{- name: I18n.t(`${key}.every_two_months`),+ name: i18n(`${key}.every_two_months`),id: "2.months",},{- name: I18n.t(`${key}.every_three_months`),+ name: i18n(`${key}.every_three_months`),id: "3.months",},{- name: I18n.t(`${key}.every_six_months`),+ name: i18n(`${key}.every_six_months`),id: "6.months",},{- name: I18n.t(`${key}.every_year`),+ name: i18n(`${key}.every_year`),id: "1.years",},];@@ -288,7 +288,7 @@ export default class LocalDatesCreate extends Component {formattedTo(dateTime, toSelected) {const emptyText = toSelected? " "- : I18n.t("discourse_local_dates.create.form.until");+ : i18n("discourse_local_dates.create.form.until");return dateTime.isValid() ? dateTime.format("LLLL") : emptyText;}diff --git a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.jsindex ffed648b795..a4bff342cf3 100644--- a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js+++ b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js@@ -9,7 +9,7 @@ import {} from "discourse/lib/to-markdown";import { iconHTML, renderIcon } from "discourse-common/lib/icon-library";import { bind } from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import generateDateMarkup from "discourse/plugins/discourse-local-dates/lib/local-date-markup-generator";import LocalDatesCreateModal from "../discourse/components/modal/local-dates-create";import LocalDateBuilder from "../lib/local-date-builder";@@ -143,7 +143,7 @@ function _partitionedRanges(element) {function initializeDiscourseLocalDates(api) {const siteSettings = api.container.lookup("service:site-settings");- const defaultTitle = I18n.t("discourse_local_dates.default_title", {+ const defaultTitle = i18n("discourse_local_dates.default_title", {site_name: siteSettings.title,});@@ -312,7 +312,7 @@ function _downloadCalendarNode(element) {const node = document.createElement("div");node.classList.add("download-calendar");- node.innerHTML = `${renderIcon("string", "file")} ${I18n.t(+ node.innerHTML = `${renderIcon("string", "file")} ${i18n("download_calendar.add_to_calendar")}`;node.setAttribute("data-starts-at", startDate.toISOString());diff --git a/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js b/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.jsindex d93ac87a53a..f07e47ecc4b 100644--- a/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js+++ b/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js@@ -1,5 +1,5 @@import { renderIcon } from "discourse-common/lib/icon-library";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DateWithZoneHelper from "./date-with-zone-helper";const DATETIME_FORMAT = "LLL";@@ -217,7 +217,7 @@ export default class LocalDateBuilder {if (diffTime < 0) {return moment.duration(diffTime).humanize();} else {- return I18n.t("discourse_local_dates.relative_dates.countdown.passed");+ return i18n("discourse_local_dates.relative_dates.countdown.passed");}}@@ -269,7 +269,7 @@ export default class LocalDateBuilder {}_translateCalendarKey(time, key) {- const translated = I18n.t(`discourse_local_dates.relative_dates.${key}`, {+ const translated = i18n(`discourse_local_dates.relative_dates.${key}`, {time: "LT",});diff --git a/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js b/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.jsindex 42717c81781..0c58da11ef9 100644--- a/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js+++ b/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js@@ -4,7 +4,7 @@ import sinon from "sinon";import { fixturesByUrl } from "discourse/tests/helpers/create-pretender";import { acceptance } from "discourse/tests/helpers/qunit-helpers";import { cloneJSON } from "discourse-common/lib/object";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';acceptance("Local Dates - Download calendar without default calendar option set",@@ -30,7 +30,7 @@ acceptance(assert.dom("#discourse-modal-title").hasText(- I18n.t("download_calendar.title"),+ i18n("download_calendar.title"),"it should display modal to select calendar");@@ -62,7 +62,7 @@ acceptance(assert.dom("#discourse-modal-title").hasText(- I18n.t("download_calendar.title"),+ i18n("download_calendar.title"),"it should display modal to select calendar");diff --git a/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js b/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.jsindex 9cde1170e50..61f91f12419 100644--- a/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js+++ b/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js@@ -1,5 +1,5 @@import QUnit, { module, test } from "qunit";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import freezeTime from "../helpers/freeze-time";import LocalDateBuilder from "../lib/local-date-builder";@@ -283,7 +283,7 @@ module("Unit | Library | local-date-builder", function () {timezone: PARIS,},{- formatted: I18n.t(+ formatted: i18n("discourse_local_dates.relative_dates.countdown.passed"),},diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjsindex f7ea8d0781d..c4a90414c36 100644--- a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs+++ b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs@@ -5,7 +5,7 @@ import { gt } from "truth-helpers";import UserLink from "discourse/components/user-link";import avatar from "discourse/helpers/avatar";import helperFn from "discourse/helpers/helper-fn";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class ComposerPresenceDisplay extends Component {@service presence;diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjsindex 6b8b08ed6b6..0431b6928b7 100644--- a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs+++ b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs@@ -5,7 +5,7 @@ import { gt } from "truth-helpers";import UserLink from "discourse/components/user-link";import avatar from "discourse/helpers/avatar";import helperFn from "discourse/helpers/helper-fn";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";export default class TopicPresenceDisplay extends Component {@service presence;diff --git a/plugins/poll/assets/javascripts/discourse/components/modal/poll-breakdown.js b/plugins/poll/assets/javascripts/discourse/components/modal/poll-breakdown.jsindex d1ad9eb5081..c3f810e32f2 100644--- a/plugins/poll/assets/javascripts/discourse/components/modal/poll-breakdown.js+++ b/plugins/poll/assets/javascripts/discourse/components/modal/poll-breakdown.js@@ -7,7 +7,7 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import loadScript from "discourse/lib/load-script";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PollBreakdownModal extends Component {@service dialog;@@ -66,7 +66,7 @@ export default class PollBreakdownModal extends Component {if (error) {popupAjaxError(error);} else {- this.dialog.alert(I18n.t("poll.error_while_fetching_voters"));+ this.dialog.alert(i18n("poll.error_while_fetching_voters"));}}).then((result) => {diff --git a/plugins/poll/assets/javascripts/discourse/components/modal/poll-ui-builder.js b/plugins/poll/assets/javascripts/discourse/components/modal/poll-ui-builder.jsindex cd26ab9e4b2..fae1651fd8e 100644--- a/plugins/poll/assets/javascripts/discourse/components/modal/poll-ui-builder.js+++ b/plugins/poll/assets/javascripts/discourse/components/modal/poll-ui-builder.js@@ -4,7 +4,7 @@ import { gt, or } from "@ember/object/computed";import { service } from "@ember/service";import { observes } from "@ember-decorators/object";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export const BAR_CHART_TYPE = "bar";export const PIE_CHART_TYPE = "pie";@@ -46,22 +46,22 @@ export default class PollUiBuilderModal extends Component {pollResults(staff) {const options = [{- name: I18n.t("poll.ui_builder.poll_result.always"),+ name: i18n("poll.ui_builder.poll_result.always"),value: ALWAYS_POLL_RESULT,},{- name: I18n.t("poll.ui_builder.poll_result.vote"),+ name: i18n("poll.ui_builder.poll_result.vote"),value: VOTE_POLL_RESULT,},{- name: I18n.t("poll.ui_builder.poll_result.closed"),+ name: i18n("poll.ui_builder.poll_result.closed"),value: CLOSED_POLL_RESULT,},];if (staff) {options.push({- name: I18n.t("poll.ui_builder.poll_result.staff"),+ name: i18n("poll.ui_builder.poll_result.staff"),value: STAFF_POLL_RESULT,});}@@ -224,14 +224,14 @@ export default class PollUiBuilderModal extends Component {if (pollOptionsCount < 1) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.options_min_count"),+ reason: i18n("poll.ui_builder.help.options_min_count"),});}if (pollOptionsCount > this.siteSettings.poll_maximum_options) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.options_max_count", {+ reason: i18n("poll.ui_builder.help.options_max_count", {count: this.siteSettings.poll_maximum_options,}),});@@ -269,21 +269,21 @@ export default class PollUiBuilderModal extends Component {if (pollMin < 0) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.invalid_min_value"),+ reason: i18n("poll.ui_builder.help.invalid_min_value"),});}if (pollMax < 0 || (isMultiple && pollMax > pollOptionsCount)) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.invalid_max_value"),+ reason: i18n("poll.ui_builder.help.invalid_max_value"),});}if (pollMin > pollMax) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.invalid_values"),+ reason: i18n("poll.ui_builder.help.invalid_values"),});}@@ -291,7 +291,7 @@ export default class PollUiBuilderModal extends Component {if (pollStep < 1) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.min_step_value"),+ reason: i18n("poll.ui_builder.help.min_step_value"),});}@@ -300,14 +300,14 @@ export default class PollUiBuilderModal extends Component {if (optionsCount < 1) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.options_min_count"),+ reason: i18n("poll.ui_builder.help.options_min_count"),});}if (optionsCount > this.siteSettings.poll_maximum_options) {return EmberObject.create({failed: true,- reason: I18n.t("poll.ui_builder.help.options_max_count", {+ reason: i18n("poll.ui_builder.help.options_max_count", {count: this.siteSettings.poll_maximum_options,}),});diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-breakdown-option.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-breakdown-option.gjsindex f7a4a4dc8f6..4dd6e1526f1 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-breakdown-option.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-breakdown-option.gjs@@ -4,9 +4,8 @@ import { equal } from "@ember/object/computed";import { htmlSafe } from "@ember/template";import { tagName } from "@ember-decorators/component";import { propertyEqual } from "discourse/lib/computed";-import i18n from "discourse-common/helpers/i18n";import discourseComputed from "discourse-common/utils/decorators";-import I18n from "discourse-i18n";+import I18n, { i18n } from "discourse-i18n";import { getColors } from "discourse/plugins/poll/lib/chart-colors";@tagName("")diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-info.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-info.gjsindex 2b1c7e8a828..ffe5db6cece 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-info.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-info.gjs@@ -3,7 +3,7 @@ import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { relativeAge } from "discourse/lib/formatter";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const ON_VOTE = "on_vote";const ON_CLOSE = "on_close";@@ -18,13 +18,13 @@ export default class PollInfoComponent extends Component {if (max > 0) {if (min === max && min > 1) {- return htmlSafe(I18n.t("poll.multiple.help.x_options", { count: min }));+ return htmlSafe(i18n("poll.multiple.help.x_options", { count: min }));}if (min > 1) {if (max < optionsCount) {return htmlSafe(- I18n.t("poll.multiple.help.between_min_and_max_options", {+ i18n("poll.multiple.help.between_min_and_max_options", {min,max,})@@ -32,20 +32,20 @@ export default class PollInfoComponent extends Component {}return htmlSafe(- I18n.t("poll.multiple.help.at_least_min_options", { count: min })+ i18n("poll.multiple.help.at_least_min_options", { count: min }));}if (max <= optionsCount) {return htmlSafe(- I18n.t("poll.multiple.help.up_to_max_options", { count: max })+ i18n("poll.multiple.help.up_to_max_options", { count: max }));}}}get votersLabel() {- return I18n.t("poll.voters", { count: this.args.voters });+ return i18n("poll.voters", { count: this.args.voters });}get showTotalVotes() {@@ -59,15 +59,15 @@ export default class PollInfoComponent extends Component {}get totalVotesLabel() {- return I18n.t("poll.total_votes", { count: this.totalVotes });+ return i18n("poll.total_votes", { count: this.totalVotes });}get automaticCloseAgeLabel() {- return I18n.t("poll.automatic_close.age", this.age);+ return i18n("poll.automatic_close.age", this.age);}get automaticCloseClosesInLabel() {- return I18n.t("poll.automatic_close.closes_in", this.timeLeft);+ return i18n("poll.automatic_close.closes_in", this.timeLeft);}get showMultipleHelpText() {@@ -110,7 +110,7 @@ export default class PollInfoComponent extends Component {}get resultsOnVoteTitle() {- return htmlSafe(I18n.t("poll.results.vote.title"));+ return htmlSafe(i18n("poll.results.vote.title"));}get resultsOnClose() {@@ -118,7 +118,7 @@ export default class PollInfoComponent extends Component {}get resultsOnCloseTitle() {- return htmlSafe(I18n.t("poll.results.closed.title"));+ return htmlSafe(i18n("poll.results.closed.title"));}get resultsStaffOnly() {@@ -129,7 +129,7 @@ export default class PollInfoComponent extends Component {}get resultsStaffOnlyTitle() {- return htmlSafe(I18n.t("poll.results.staff.title"));+ return htmlSafe(i18n("poll.results.staff.title"));}get publicTitle() {@@ -142,7 +142,7 @@ export default class PollInfoComponent extends Component {}get publicTitleLabel() {- return htmlSafe(I18n.t("poll.public.title"));+ return htmlSafe(i18n("poll.public.title"));}get showInstructionsSection() {diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice-dropdown.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice-dropdown.gjsindex aa48b8d7fcb..72a569d0020 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice-dropdown.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice-dropdown.gjs@@ -4,7 +4,7 @@ import { action } from "@ember/object";import DButton from "discourse/components/d-button";import DropdownMenu from "discourse/components/dropdown-menu";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import DMenu from "float-kit/components/d-menu";export default class PollOptionsDropdownComponent extends Component {@@ -21,7 +21,7 @@ export default class PollOptionsDropdownComponent extends Component {get rankLabel() {return this.args.rank === 0- ? I18n.t("poll.options.ranked_choice.abstain")+ ? i18n("poll.options.ranked_choice.abstain"): this.args.rank;}diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjsindex 43f67c5beec..4d9502ec93d 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs@@ -4,7 +4,7 @@ import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import DButton from "discourse/components/d-button";import routeAction from "discourse/helpers/route-action";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import PollOptionRankedChoiceDropdown from "./poll-option-ranked-choice-dropdown";export default class PollOptionsComponent extends Component {diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjsindex e14e6bc4093..4501a7cbd4a 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs@@ -7,7 +7,7 @@ import { htmlSafe } from "@ember/template";import concatClass from "discourse/helpers/concat-class";import routeAction from "discourse/helpers/route-action";import icon from "discourse-common/helpers/d-icon";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import PollOptionRankedChoice from "./poll-option-ranked-choice";export default class PollOptionsComponent extends Component {@@ -32,7 +32,7 @@ export default class PollOptionsComponent extends Component {rankedChoiceDropdownContent.push({id: 0,- name: I18n.t("poll.options.ranked_choice.abstain"),+ name: i18n("poll.options.ranked_choice.abstain"),});this.args.options.forEach((option, i) => {@@ -40,11 +40,11 @@ export default class PollOptionsComponent extends Component {let priority = "";if (i === 0) {- priority = ` ${I18n.t("poll.options.ranked_choice.highest_priority")}`;+ priority = ` ${i18n("poll.options.ranked_choice.highest_priority")}`;}if (i === this.args.options.length - 1) {- priority = ` ${I18n.t("poll.options.ranked_choice.lowest_priority")}`;+ priority = ` ${i18n("poll.options.ranked_choice.lowest_priority")}`;}rankedChoiceDropdownContent.push({diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-results-ranked-choice.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-results-ranked-choice.gjsindex f6a0a74d904..88e2dbb7649 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-results-ranked-choice.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-results-ranked-choice.gjs@@ -1,12 +1,11 @@import Component from "@glimmer/component";import { htmlSafe } from "@ember/template";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class PollResultsRankedChoiceComponent extends Component {get rankedChoiceWinnerText() {return htmlSafe(- I18n.t("poll.ranked_choice.winner", {+ i18n("poll.ranked_choice.winner", {count: this.args.rankedChoiceOutcome?.round_activity?.length,winner: this.args.rankedChoiceOutcome?.winning_candidate?.html,})@@ -14,7 +13,7 @@ export default class PollResultsRankedChoiceComponent extends Component {}get rankedChoiceTiedText() {- return I18n.t("poll.ranked_choice.tied", {+ return i18n("poll.ranked_choice.tied", {count: this.args.rankedChoiceOutcome?.round_activity?.length,});}diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-results-standard.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-results-standard.gjsindex d24d2878522..ef7772df5bf 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-results-standard.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-results-standard.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";import { concat } from "@ember/helper";import { htmlSafe } from "@ember/template";-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import evenRound from "discourse/plugins/poll/lib/even-round";import PollVoters from "./poll-voters";diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-results-tabs.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-results-tabs.gjsindex c210a4fe9d5..9a6d710aab4 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-results-tabs.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-results-tabs.gjs@@ -4,14 +4,14 @@ import { fn } from "@ember/helper";import { action } from "@ember/object";import { eq } from "truth-helpers";import DButton from "discourse/components/d-button";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import PollResultsRankedChoice from "./poll-results-ranked-choice";import PollResultsStandard from "./poll-results-standard";export default class TabsComponent extends Component {@tracked activeTab;- tabOne = I18n.t("poll.results.tabs.votes");- tabTwo = I18n.t("poll.results.tabs.outcome");+ tabOne = i18n("poll.results.tabs.votes");+ tabTwo = i18n("poll.results.tabs.outcome");constructor() {super(...arguments);diff --git a/plugins/poll/assets/javascripts/discourse/components/poll.gjs b/plugins/poll/assets/javascripts/discourse/components/poll.gjsindex 65c423ff85e..16b58eacb35 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll.gjs@@ -9,8 +9,7 @@ import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import round from "discourse/lib/round";import icon from "discourse-common/helpers/d-icon";-import i18n from "discourse-common/helpers/i18n";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";import PollBreakdownModal from "../components/modal/poll-breakdown";import {MULTIPLE_POLL_TYPE,@@ -243,7 +242,7 @@ export default class PollComponent extends Component {}popupAjaxError(error);} else {- this.dialog.alert(I18n.t("poll.error_while_casting_votes"));+ this.dialog.alert(i18n("poll.error_while_casting_votes"));}}}@@ -378,7 +377,7 @@ export default class PollComponent extends Component {}get pollGroups() {- return I18n.t("poll.results.groups.title", { groups: this.poll.groups });+ return i18n("poll.results.groups.title", { groups: this.poll.groups });}get showCastVotesButton() {@@ -445,7 +444,7 @@ export default class PollComponent extends Component {const average = this.voters === 0 ? 0 : round(totalScore / this.voters, -2);- return htmlSafe(I18n.t("poll.average_rating", { average }));+ return htmlSafe(i18n("poll.average_rating", { average }));}get availableDisplayMode() {@@ -527,7 +526,7 @@ export default class PollComponent extends Component {if (error) {popupAjaxError(error);} else {- this.dialog.alert(I18n.t("poll.error_while_fetching_voters"));+ this.dialog.alert(i18n("poll.error_while_fetching_voters"));}}).finally(() => {@@ -573,7 +572,7 @@ export default class PollComponent extends Component {}this.dialog.yesNoConfirm({- message: I18n.t(this.closed ? "poll.open.confirm" : "poll.close.confirm"),+ message: i18n(this.closed ? "poll.open.confirm" : "poll.close.confirm"),didConfirm: () => {const status = this.closed ? OPEN_STATUS : CLOSED_STATUS;ajax("/polls/toggle_status", {@@ -607,7 +606,7 @@ export default class PollComponent extends Component {if (error) {popupAjaxError(error);} else {- this.dialog.alert(I18n.t("poll.error_while_toggling_status"));+ this.dialog.alert(i18n("poll.error_while_toggling_status"));}});},@@ -663,7 +662,7 @@ export default class PollComponent extends Component {if (error) {popupAjaxError(error);} else {- this.dialog.alert(I18n.t("poll.error_while_exporting_results"));+ this.dialog.alert(i18n("poll.error_while_exporting_results"));}});}diff --git a/plugins/poll/assets/javascripts/lib/discourse-markdown/poll.js b/plugins/poll/assets/javascripts/lib/discourse-markdown/poll.jsindex 5b0e49b560a..23af3a2fc80 100644--- a/plugins/poll/assets/javascripts/lib/discourse-markdown/poll.js+++ b/plugins/poll/assets/javascripts/lib/discourse-markdown/poll.js@@ -1,5 +1,5 @@/*eslint no-bitwise:0 */-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const DATA_PREFIX = "data-poll-";const DEFAULT_POLL = { name: "poll", status: "open" };@@ -97,7 +97,7 @@ function addPollInfo(state) {token.block = false;token = state.push("text", "", 0);- token.content = I18n.t("poll.voters", { count: 0 });+ token.content = i18n("poll.voters", { count: 0 });state.push("poll_info_label_close", "span", -1);state.push("poll_info_counts_count_close", "div", -1);diff --git a/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js b/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.jsindex dcd99855637..db22bb45978 100644--- a/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js+++ b/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js@@ -5,7 +5,7 @@ import {acceptance,updateCurrentUser,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';import { displayPollBuilderButton } from "discourse/plugins/poll/helpers/display-poll-builder-button";acceptance("Poll Builder - polls are enabled", function (needs) {@@ -25,7 +25,7 @@ acceptance("Poll Builder - polls are enabled", function (needs) {await displayPollBuilderButton();- const pollBuilderButtonSelector = `.select-kit-row[data-name='${I18n.t(+ const pollBuilderButtonSelector = `.select-kit-row[data-name='${i18n("poll.ui_builder.title")}']`;@@ -71,7 +71,7 @@ acceptance("Poll Builder - polls are enabled", function (needs) {await displayPollBuilderButton();assert- .dom(`.select-kit-row[data-name='${I18n.t("poll.ui_builder.title")}']`)+ .dom(`.select-kit-row[data-name='${i18n("poll.ui_builder.title")}']`).exists("it shows the builder button");});});diff --git a/plugins/poll/test/javascripts/acceptance/poll-results-test.js b/plugins/poll/test/javascripts/acceptance/poll-results-test.jsindex 5d880f6ad5a..44cf0a8d5ab 100644--- a/plugins/poll/test/javascripts/acceptance/poll-results-test.js+++ b/plugins/poll/test/javascripts/acceptance/poll-results-test.js@@ -5,7 +5,7 @@ import {publishToMessageBus,query,} from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';acceptance("Poll results", function (needs) {needs.user();@@ -1121,7 +1121,7 @@ acceptance("Poll results", function (needs) {query(".poll-container .discourse-poll-ranked_choice-results .tab-container .tab.nav-item.active button").innerText,- I18n.t("poll.results.tabs.outcome"),+ i18n("poll.results.tabs.outcome"),"Outcome tab is active");@@ -1133,7 +1133,7 @@ acceptance("Poll results", function (needs) {query(".poll-container .discourse-poll-ranked_choice-results .tab-container .tab.nav-item.active button").innerText,- I18n.t("poll.results.tabs.votes"),+ i18n("poll.results.tabs.votes"),"Votes tab is active");diff --git a/plugins/poll/test/javascripts/component/poll-buttons-dropdown-test.js b/plugins/poll/test/javascripts/component/poll-buttons-dropdown-test.jsindex e604f5f072e..63e61974d47 100644--- a/plugins/poll/test/javascripts/component/poll-buttons-dropdown-test.js+++ b/plugins/poll/test/javascripts/component/poll-buttons-dropdown-test.js@@ -3,7 +3,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';module("Poll | Component | poll-buttons-dropdown", function (hooks) {setupRenderingTest(hooks);@@ -40,7 +40,7 @@ module("Poll | Component | poll-buttons-dropdown", function (hooks) {assert.dom("li.dropdown-menu__item").exists({ count: 2 });assert.strictEqual(query("li.dropdown-menu__item span").textContent.trim(),- I18n.t("poll.export-results.label"),+ i18n("poll.export-results.label"),"displays the poll Export action");});@@ -76,7 +76,7 @@ module("Poll | Component | poll-buttons-dropdown", function (hooks) {assert.dom(query("li.dropdown-menu__item span")).hasText(- I18n.t("poll.show-tally.label"),+ i18n("poll.show-tally.label"),"displays the show absolute button");});@@ -108,7 +108,7 @@ module("Poll | Component | poll-buttons-dropdown", function (hooks) {assert.dom("button.widget-button").exists({ count: 1 });assert.strictEqual(query("button.widget-button span.d-button-label").textContent.trim(),- I18n.t("poll.breakdown.breakdown"),+ i18n("poll.breakdown.breakdown"),"displays the poll Close action");});diff --git a/plugins/poll/test/javascripts/component/poll-info-test.js b/plugins/poll/test/javascripts/component/poll-info-test.jsindex 01e3151e264..624427b597c 100644--- a/plugins/poll/test/javascripts/component/poll-info-test.js+++ b/plugins/poll/test/javascripts/component/poll-info-test.js@@ -3,7 +3,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';const OPTIONS = [{ id: "1ddc47be0d2315b9711ee8526ca9d83f", html: "This", votes: 2, rank: 0 },@@ -47,7 +47,7 @@ module("Poll | Component | poll-info", function (hooks) {assert.strictEqual(query(".poll-info_instructions li.multiple-help-text").textContent.trim(),- I18n.t("poll.multiple.help.up_to_max_options", {+ i18n("poll.multiple.help.up_to_max_options", {count: this.max,}).replace(/<\/?[^>]+(>|$)/g, ""),"displays the multiple help text"@@ -55,7 +55,7 @@ module("Poll | Component | poll-info", function (hooks) {assert.strictEqual(query(".poll-info_instructions li.is-public").textContent.trim(),- I18n.t("poll.public.title").replace(/<\/?[^>]+(>|$)/g, ""),+ i18n("poll.public.title").replace(/<\/?[^>]+(>|$)/g, ""),"displays the public label");});@@ -93,7 +93,7 @@ module("Poll | Component | poll-info", function (hooks) {assert.strictEqual(query(".poll-info_instructions li.multiple-help-text").textContent.trim(),- I18n.t("poll.multiple.help.up_to_max_options", {+ i18n("poll.multiple.help.up_to_max_options", {count: this.max,}).replace(/<\/?[^>]+(>|$)/g, ""),"displays the multiple help text"@@ -103,13 +103,13 @@ module("Poll | Component | poll-info", function (hooks) {query(".poll-info_instructions li.results-on-vote span").textContent.trim(),- I18n.t("poll.results.vote.title").replace(/<\/?[^>]+(>|$)/g, ""),+ i18n("poll.results.vote.title").replace(/<\/?[^>]+(>|$)/g, ""),"displays the results on vote label");assert.strictEqual(query(".poll-info_instructions li.is-public").textContent.trim(),- I18n.t("poll.public.title").replace(/<\/?[^>]+(>|$)/g, ""),+ i18n("poll.public.title").replace(/<\/?[^>]+(>|$)/g, ""),"displays the public label");});diff --git a/plugins/poll/test/javascripts/component/poll-options-test.js b/plugins/poll/test/javascripts/component/poll-options-test.jsindex dfec4af114e..ada2616328b 100644--- a/plugins/poll/test/javascripts/component/poll-options-test.js+++ b/plugins/poll/test/javascripts/component/poll-options-test.js@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';const OPTIONS = [{ id: "1ddc47be0d2315b9711ee8526ca9d83f", html: "This", votes: 0, rank: 0 },@@ -155,10 +155,10 @@ module("Poll | Component | poll-options", function (hooks) {assert.dom(".dropdown-menu__item:nth-child(2)")- .hasText(`1 ${I18n.t("poll.options.ranked_choice.highest_priority")}`);+ .hasText(`1 ${i18n("poll.options.ranked_choice.highest_priority")}`);assert.dom(".dropdown-menu__item:nth-child(4)")- .hasText(`3 ${I18n.t("poll.options.ranked_choice.lowest_priority")}`);+ .hasText(`3 ${i18n("poll.options.ranked_choice.lowest_priority")}`);});});diff --git a/plugins/poll/test/javascripts/component/poll-results-ranked-choice-test.js b/plugins/poll/test/javascripts/component/poll-results-ranked-choice-test.jsindex ea218679269..5198ae91d9f 100644--- a/plugins/poll/test/javascripts/component/poll-results-ranked-choice-test.js+++ b/plugins/poll/test/javascripts/component/poll-results-ranked-choice-test.js@@ -3,7 +3,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { query } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';const RANKED_CHOICE_OUTCOME = {tied: false,@@ -49,7 +49,7 @@ module("Poll | Component | poll-results-ranked-choice", function (hooks) {assert.strictEqual(query("span.poll-results-ranked-choice-info").textContent.trim(),- I18n.t("poll.ranked_choice.winner", {+ i18n("poll.ranked_choice.winner", {count: this.rankedChoiceOutcome.round_activity.length,winner: this.rankedChoiceOutcome.winning_candidate.html,}),diff --git a/plugins/poll/test/javascripts/component/poll-results-standard-test.js b/plugins/poll/test/javascripts/component/poll-results-standard-test.jsindex fdef4486c65..d6e4c7d4df2 100644--- a/plugins/poll/test/javascripts/component/poll-results-standard-test.js+++ b/plugins/poll/test/javascripts/component/poll-results-standard-test.js@@ -3,7 +3,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import { queryAll } from "discourse/tests/helpers/qunit-helpers";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';const TWO_OPTIONS = [{ id: "1ddc47be0d2315b9711ee8526ca9d83f", html: "This", votes: 5, rank: 0 },@@ -188,13 +188,13 @@ module("Poll | Component | poll-results-standard", function (hooks) {/>`);let percentages = queryAll(".option .absolute");- assert.dom(percentages[0]).hasText(I18n.t("poll.votes", { count: 5 }));- assert.dom(percentages[1]).hasText(I18n.t("poll.votes", { count: 4 }));- assert.dom(percentages[2]).hasText(I18n.t("poll.votes", { count: 2 }));- assert.dom(percentages[3]).hasText(I18n.t("poll.votes", { count: 1 }));+ assert.dom(percentages[0]).hasText(i18n("poll.votes", { count: 5 }));+ assert.dom(percentages[1]).hasText(i18n("poll.votes", { count: 4 }));+ assert.dom(percentages[2]).hasText(i18n("poll.votes", { count: 2 }));+ assert.dom(percentages[3]).hasText(i18n("poll.votes", { count: 1 }));assert.dom(queryAll(".option")[3].querySelectorAll("span")[1]).hasText("a");- assert.dom(percentages[4]).hasText(I18n.t("poll.votes", { count: 1 }));+ assert.dom(percentages[4]).hasText(i18n("poll.votes", { count: 1 }));assert.dom(queryAll(".option")[4].querySelectorAll("span")[1]).hasText("b");});});diff --git a/plugins/poll/test/javascripts/component/poll-test.js b/plugins/poll/test/javascripts/component/poll-test.jsindex 37f74a47ff3..ab90eb3151e 100644--- a/plugins/poll/test/javascripts/component/poll-test.js+++ b/plugins/poll/test/javascripts/component/poll-test.js@@ -5,7 +5,7 @@ import hbs from "htmlbars-inline-precompile";import { module, test } from "qunit";import { setupRenderingTest } from "discourse/tests/helpers/component-test";import pretender, { response } from "discourse/tests/helpers/create-pretender";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';let requests = 0;@@ -171,7 +171,7 @@ module("Poll | Component | poll", function (hooks) {);assert.dom(".poll-container .alert")- .hasText(I18n.t("poll.results.groups.title", { groups: "foo" }));+ .hasText(i18n("poll.results.groups.title", { groups: "foo" }));assert.strictEqual(requests, 0);assert.dom(".chosen").doesNotExist();});diff --git a/plugins/spoiler-alert/assets/javascripts/lib/apply-spoiler.js b/plugins/spoiler-alert/assets/javascripts/lib/apply-spoiler.jsindex 9677e73e98e..bb6ad70c831 100644--- a/plugins/spoiler-alert/assets/javascripts/lib/apply-spoiler.js+++ b/plugins/spoiler-alert/assets/javascripts/lib/apply-spoiler.js@@ -1,4 +1,4 @@-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";const INTERACTIVE_SELECTOR = ["a",@@ -45,7 +45,7 @@ function _setSpoilerHidden(element) {tabindex: "0","data-spoiler-state": "blurred","aria-expanded": false,- "aria-label": I18n.t("spoiler.label.show"),+ "aria-label": i18n("spoiler.label.show"),"aria-live": "polite",};diff --git a/plugins/spoiler-alert/test/javascripts/acceptance/spoiler-button-test.js b/plugins/spoiler-alert/test/javascripts/acceptance/spoiler-button-test.jsindex cb539515261..b711f5b7140 100644--- a/plugins/spoiler-alert/test/javascripts/acceptance/spoiler-button-test.js+++ b/plugins/spoiler-alert/test/javascripts/acceptance/spoiler-button-test.js@@ -2,7 +2,7 @@ import { click, fillIn, visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";import selectKit from "discourse/tests/helpers/select-kit-helper";-import I18n from "discourse-i18n";+import { i18n } from 'discourse-i18n';acceptance("Spoiler Button", function (needs) {needs.user();@@ -20,11 +20,11 @@ acceptance("Spoiler Button", function (needs) {await categoryChooser.expand();await categoryChooser.selectRowByValue(2);await popUpMenu.expand();- await popUpMenu.selectRowByName(I18n.t("spoiler.title"));+ await popUpMenu.selectRowByName(i18n("spoiler.title"));assert.strictEqual(query(".d-editor-input").value,- `[spoiler]${I18n.t("composer.spoiler_text")}[/spoiler]`,+ `[spoiler]${i18n("composer.spoiler_text")}[/spoiler]`,"it should contain the right output");@@ -36,7 +36,7 @@ acceptance("Spoiler Button", function (needs) {);assert.strictEqual(textarea.selectionEnd,- I18n.t("composer.spoiler_text").length + 9,+ i18n("composer.spoiler_text").length + 9,"it should end highlighting at the right position");@@ -46,7 +46,7 @@ acceptance("Spoiler Button", function (needs) {textarea.selectionEnd = textarea.value.length;await popUpMenu.expand();- await popUpMenu.selectRowByName(I18n.t("spoiler.title"));+ await popUpMenu.selectRowByName(i18n("spoiler.title"));assert.strictEqual(query(".d-editor-input").value,@@ -71,7 +71,7 @@ acceptance("Spoiler Button", function (needs) {textarea.selectionEnd = 21;await popUpMenu.expand();- await popUpMenu.selectRowByName(I18n.t("spoiler.title"));+ await popUpMenu.selectRowByName(i18n("spoiler.title"));assert.strictEqual(query(".d-editor-input").value,@@ -96,7 +96,7 @@ acceptance("Spoiler Button", function (needs) {textarea.selectionEnd = 21;await popUpMenu.expand();- await popUpMenu.selectRowByName(I18n.t("spoiler.title"));+ await popUpMenu.selectRowByName(i18n("spoiler.title"));assert.strictEqual(query(".d-editor-input").value,@@ -122,7 +122,7 @@ acceptance("Spoiler Button", function (needs) {textarea.selectionEnd = 22;await popUpMenu.expand();- await popUpMenu.selectRowByName(I18n.t("spoiler.title"));+ await popUpMenu.selectRowByName(i18n("spoiler.title"));assert.strictEqual(query(".d-editor-input").value,diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/00-typography.gjs b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/00-typography.gjsindex 90e6d4a1dc9..cf7e56989fb 100644--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/00-typography.gjs+++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/00-typography.gjs@@ -1,4 +1,4 @@-import i18n from "discourse-common/helpers/i18n";+import { i18n } from "discourse-i18n";import StyleguideExample from "../../styleguide-example";<template>diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/organisms/modal.js b/plugins/styleguide/assets/javascripts/discourse/components/sections/organisms/modal.jsindex 3e4e0aa6b4b..e4d8b41f26b 100644--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/organisms/modal.js+++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/organisms/modal.js@@ -2,14 +2,14 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { getLoadedFaker } from "discourse/lib/load-faker";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default class extends Component {@tracked inline = true;@tracked hideHeader = false;@tracked dismissable = true;@tracked modalTagName = "div";- @tracked title = I18n.t("styleguide.sections.modal.header");+ @tracked title = i18n("styleguide.sections.modal.header");@tracked body = getLoadedFaker().faker.lorem.lines(5);@tracked subtitle = "";@tracked flash = "";diff --git a/plugins/styleguide/assets/javascripts/discourse/helpers/section-title.js b/plugins/styleguide/assets/javascripts/discourse/helpers/section-title.jsindex e63ff3c2ca8..8c2fe36c6d3 100644--- a/plugins/styleguide/assets/javascripts/discourse/helpers/section-title.js+++ b/plugins/styleguide/assets/javascripts/discourse/helpers/section-title.js@@ -1,6 +1,6 @@import Helper from "@ember/component/helper";-import I18n from "discourse-i18n";+import { i18n } from "discourse-i18n";export default Helper.helper(function (params) {- return I18n.t(`styleguide.sections.${params[0].replace(/\-/g, "_")}.title`);+ return i18n(`styleguide.sections.${params[0].replace(/\-/g, "_")}.title`);});