mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Consolidate i18n import paths (#29804)
Enables our new eslint rules which enforce consistent i18n imports. For more info, see 0d58b40cd7
This commit is contained in:
@ -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`
|
||||
);
|
||||
}
|
||||
|
@ -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),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -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),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -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 {
|
||||
@action
|
||||
removePM(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);
|
||||
},
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
},
|
||||
|
@ -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 {
|
||||
@action
|
||||
destroyAutomation(automation) {
|
||||
this.dialog.deleteConfirm({
|
||||
message: I18n.t("discourse_automation.destroy_automation.confirm", {
|
||||
message: i18n("discourse_automation.destroy_automation.confirm", {
|
||||
name: escape(automation.name),
|
||||
}),
|
||||
didConfirm: () => {
|
||||
|
Reference in New Issue
Block a user