DEV: Bump dependencies and fix linting (#685)
This commit is contained in:
parent
6cd250dc10
commit
db040749b2
|
|
@ -3,9 +3,9 @@ import { getOwner } from "@ember/owner";
|
|||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { service } from "@ember/service";
|
||||
import { or } from "truth-helpers";
|
||||
import icon from "discourse/helpers/d-icon";
|
||||
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 CsvUploader extends Component {
|
||||
@service dialog;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import Component from "@glimmer/component";
|
||||
import avatar from "discourse/helpers/avatar";
|
||||
import { formatUsername } from "discourse/lib/utilities";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default class DiscoursePostEventCreator extends Component {
|
||||
get username() {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
|||
import { next } from "@ember/runloop";
|
||||
import { service } from "@ember/service";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import icon from "discourse/helpers/d-icon";
|
||||
import { applyLocalDates } from "discourse/lib/local-dates";
|
||||
import { cook } from "discourse/lib/text";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import guessDateFormat from "../../lib/guess-best-date-format";
|
||||
|
||||
export default class DiscoursePostEventDates extends Component {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import Component from "@glimmer/component";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default class EventStatus extends Component {
|
||||
get eventStatusLabel() {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import { service } from "@ember/service";
|
|||
import { modifier } from "ember-modifier";
|
||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import icon from "discourse/helpers/d-icon";
|
||||
import replaceEmoji from "discourse/helpers/replace-emoji";
|
||||
import routeAction from "discourse/helpers/route-action";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import Creator from "./creator";
|
||||
import Dates from "./dates";
|
||||
import EventStatus from "./event-status";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { eq } from "truth-helpers";
|
|||
import AvatarFlair from "discourse/components/avatar-flair";
|
||||
import avatar from "discourse/helpers/avatar";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default class DiscoursePostEventInvitee extends Component {
|
||||
@service site;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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 icon from "discourse/helpers/d-icon";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import Invitee from "./invitee";
|
||||
|
||||
export default class DiscoursePostEventInvitees extends Component {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import DropdownMenu from "discourse/components/dropdown-menu";
|
|||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { downloadCalendar } from "discourse/lib/download-calendar";
|
||||
import { exportEntity } from "discourse/lib/export-csv";
|
||||
import { getAbsoluteURL } from "discourse/lib/get-url";
|
||||
import { cook } from "discourse/lib/text";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { getAbsoluteURL } from "discourse-common/lib/get-url";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import DMenu from "float-kit/components/d-menu";
|
||||
import { buildParams, replaceRaw } from "../../lib/raw-event-helper";
|
||||
import PostEventBuilder from "../modal/post-event-builder";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import Component from "@glimmer/component";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import icon from "discourse/helpers/d-icon";
|
||||
|
||||
export default class DiscoursePostEventUrl extends Component {
|
||||
get url() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { service } from "@ember/service";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import guessDateFormat from "../lib/guess-best-date-format";
|
||||
|
||||
export default class EventDate extends Component {
|
||||
|
|
@ -93,7 +93,7 @@ export default class EventDate extends Component {
|
|||
}
|
||||
|
||||
get timeRemainingContent() {
|
||||
return I18n.t("discourse_post_event.topic_title.ends_in_duration", {
|
||||
return i18n("discourse_post_event.topic_title.ends_in_duration", {
|
||||
duration: this.eventEndedAt.from(moment()),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import notEq from "truth-helpers/helpers/not-eq";
|
||||
|
||||
const EventField = <template>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { service } from "@ember/service";
|
|||
import { extractError } from "discourse/lib/ajax-error";
|
||||
import { cook } from "discourse/lib/text";
|
||||
import Group from "discourse/models/group";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import { buildParams, replaceRaw } from "../../lib/raw-event-helper";
|
||||
|
||||
export default class PostEventBuilder extends Component {
|
||||
|
|
@ -33,13 +33,13 @@ export default class PostEventBuilder extends Component {
|
|||
return [
|
||||
{
|
||||
value: "notification",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.reminders.types.notification"
|
||||
),
|
||||
},
|
||||
{
|
||||
value: "bumpTopic",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.reminders.types.bump_topic"
|
||||
),
|
||||
},
|
||||
|
|
@ -50,25 +50,21 @@ export default class PostEventBuilder extends Component {
|
|||
return [
|
||||
{
|
||||
value: "minutes",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.reminders.units.minutes"
|
||||
),
|
||||
},
|
||||
{
|
||||
value: "hours",
|
||||
name: I18n.t(
|
||||
"discourse_post_event.builder_modal.reminders.units.hours"
|
||||
),
|
||||
name: i18n("discourse_post_event.builder_modal.reminders.units.hours"),
|
||||
},
|
||||
{
|
||||
value: "days",
|
||||
name: I18n.t("discourse_post_event.builder_modal.reminders.units.days"),
|
||||
name: i18n("discourse_post_event.builder_modal.reminders.units.days"),
|
||||
},
|
||||
{
|
||||
value: "weeks",
|
||||
name: I18n.t(
|
||||
"discourse_post_event.builder_modal.reminders.units.weeks"
|
||||
),
|
||||
name: i18n("discourse_post_event.builder_modal.reminders.units.weeks"),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
@ -77,13 +73,13 @@ export default class PostEventBuilder extends Component {
|
|||
return [
|
||||
{
|
||||
value: "before",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.reminders.periods.before"
|
||||
),
|
||||
},
|
||||
{
|
||||
value: "after",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.reminders.periods.after"
|
||||
),
|
||||
},
|
||||
|
|
@ -94,35 +90,31 @@ export default class PostEventBuilder extends Component {
|
|||
return [
|
||||
{
|
||||
id: "every_day",
|
||||
name: I18n.t("discourse_post_event.builder_modal.recurrence.every_day"),
|
||||
name: i18n("discourse_post_event.builder_modal.recurrence.every_day"),
|
||||
},
|
||||
{
|
||||
id: "every_month",
|
||||
name: I18n.t(
|
||||
"discourse_post_event.builder_modal.recurrence.every_month"
|
||||
),
|
||||
name: i18n("discourse_post_event.builder_modal.recurrence.every_month"),
|
||||
},
|
||||
{
|
||||
id: "every_weekday",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.recurrence.every_weekday"
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "every_week",
|
||||
name: I18n.t(
|
||||
"discourse_post_event.builder_modal.recurrence.every_week"
|
||||
),
|
||||
name: i18n("discourse_post_event.builder_modal.recurrence.every_week"),
|
||||
},
|
||||
{
|
||||
id: "every_two_weeks",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.recurrence.every_two_weeks"
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "every_four_weeks",
|
||||
name: I18n.t(
|
||||
name: i18n(
|
||||
"discourse_post_event.builder_modal.recurrence.every_four_weeks"
|
||||
),
|
||||
},
|
||||
|
|
@ -256,7 +248,7 @@ export default class PostEventBuilder extends Component {
|
|||
if (newRaw) {
|
||||
const props = {
|
||||
raw: newRaw,
|
||||
edit_reason: I18n.t("discourse_post_event.edit_reason"),
|
||||
edit_reason: i18n("discourse_post_event.edit_reason"),
|
||||
};
|
||||
|
||||
const cooked = await cook(newRaw);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { TrackedArray } from "@ember-compat/tracked-built-ins";
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import { extractError } from "discourse/lib/ajax-error";
|
||||
import Group from "discourse/models/group";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default class PostEventBulkInvite extends Component {
|
||||
@service dialog;
|
||||
|
|
@ -22,19 +22,19 @@ export default class PostEventBulkInvite extends Component {
|
|||
get bulkInviteStatuses() {
|
||||
return [
|
||||
{
|
||||
label: I18n.t("discourse_post_event.models.invitee.status.unknown"),
|
||||
label: i18n("discourse_post_event.models.invitee.status.unknown"),
|
||||
name: "unknown",
|
||||
},
|
||||
{
|
||||
label: I18n.t("discourse_post_event.models.invitee.status.going"),
|
||||
label: i18n("discourse_post_event.models.invitee.status.going"),
|
||||
name: "going",
|
||||
},
|
||||
{
|
||||
label: I18n.t("discourse_post_event.models.invitee.status.not_going"),
|
||||
label: i18n("discourse_post_event.models.invitee.status.not_going"),
|
||||
name: "not_going",
|
||||
},
|
||||
{
|
||||
label: I18n.t("discourse_post_event.models.invitee.status.interested"),
|
||||
label: i18n("discourse_post_event.models.invitee.status.interested"),
|
||||
name: "interested",
|
||||
},
|
||||
];
|
||||
|
|
@ -97,7 +97,7 @@ export default class PostEventBulkInvite extends Component {
|
|||
@action
|
||||
async uploadDone() {
|
||||
await this.dialog.alert(
|
||||
I18n.t("discourse_post_event.bulk_invite_modal.success")
|
||||
i18n("discourse_post_event.bulk_invite_modal.success")
|
||||
);
|
||||
this.args.closeModal();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@ import ConditionalLoadingSpinner from "discourse/components/conditional-loading-
|
|||
import DButton from "discourse/components/d-button";
|
||||
import DModal from "discourse/components/d-modal";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { debounce } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
import { debounce } from "discourse/lib/decorators";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import ToggleInvitees from "../../toggle-invitees";
|
||||
import User from "./user";
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ export default class PostEventInviteesModal extends Component {
|
|||
}
|
||||
|
||||
get title() {
|
||||
return I18n.t(
|
||||
return i18n(
|
||||
`discourse_post_event.invitees_modal.${
|
||||
this.args.model.title || "title_invited"
|
||||
}`
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { computed } from "@ember/object";
|
||||
import { classNames } from "@ember-decorators/component";
|
||||
import I18n from "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import ComboBoxComponent from "select-kit/components/combo-box";
|
||||
import {
|
||||
pluginApiIdentifiers,
|
||||
|
|
@ -28,14 +28,14 @@ export default class RegionInput extends ComboBoxComponent {
|
|||
|
||||
if (this.allowNoneRegion === true) {
|
||||
regions.push({
|
||||
name: I18n.t("discourse_calendar.region.none"),
|
||||
name: i18n("discourse_calendar.region.none"),
|
||||
id: null,
|
||||
});
|
||||
}
|
||||
|
||||
regions = regions.concat(
|
||||
HOLIDAY_REGIONS.map((region) => ({
|
||||
name: I18n.t(`discourse_calendar.region.names.${region}`),
|
||||
name: i18n(`discourse_calendar.region.names.${region}`),
|
||||
id: region,
|
||||
})).sort((a, b) => a.name.localeCompare(b.name))
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import Component from "@ember/component";
|
|||
import { schedule } from "@ember/runloop";
|
||||
import { tagName } from "@ember-decorators/component";
|
||||
import { Promise } from "rsvp";
|
||||
import getURL from "discourse/lib/get-url";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import Category from "discourse/models/category";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { formatEventName } from "../helpers/format-event-name";
|
||||
import addRecurrentEvents from "../lib/add-recurrent-events";
|
||||
import fullCalendarDefaultOptions from "../lib/full-calendar-default-options";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import ConditionalLoadingSpinner from "discourse/components/conditional-loading-
|
|||
import DButton from "discourse/components/d-button";
|
||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import or from "truth-helpers/helpers/or";
|
||||
import { isNotFullDayEvent } from "../lib/guess-best-date-format";
|
||||
|
||||
|
|
@ -37,10 +37,10 @@ export default class UpcomingEventsList extends Component {
|
|||
count = this.args.params?.count ?? DEFAULT_COUNT;
|
||||
upcomingDays = this.args.params?.upcomingDays ?? DEFAULT_UPCOMING_DAYS;
|
||||
|
||||
emptyMessage = I18n.t("discourse_post_event.upcoming_events_list.empty");
|
||||
allDayLabel = I18n.t("discourse_post_event.upcoming_events_list.all_day");
|
||||
errorMessage = I18n.t("discourse_post_event.upcoming_events_list.error");
|
||||
viewAllLabel = I18n.t("discourse_post_event.upcoming_events_list.view_all");
|
||||
emptyMessage = i18n("discourse_post_event.upcoming_events_list.empty");
|
||||
allDayLabel = i18n("discourse_post_event.upcoming_events_list.all_day");
|
||||
errorMessage = i18n("discourse_post_event.upcoming_events_list.error");
|
||||
viewAllLabel = i18n("discourse_post_event.upcoming_events_list.view_all");
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
|
@ -64,7 +64,7 @@ export default class UpcomingEventsList extends Component {
|
|||
const titleSetting = this.siteSettings.map_events_title;
|
||||
|
||||
if (titleSetting === "") {
|
||||
return I18n.t("discourse_post_event.upcoming_events_list.title");
|
||||
return i18n("discourse_post_event.upcoming_events_list.title");
|
||||
}
|
||||
|
||||
const categories = JSON.parse(titleSetting).map(
|
||||
|
|
@ -78,7 +78,7 @@ export default class UpcomingEventsList extends Component {
|
|||
);
|
||||
return customTitleLookup?.custom_title;
|
||||
} else {
|
||||
return I18n.t("discourse_post_event.upcoming_events_list.title");
|
||||
return i18n("discourse_post_event.upcoming_events_list.title");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default {
|
||||
name: "add-upcoming-events-to-sidebar",
|
||||
|
|
@ -15,8 +15,8 @@ export default {
|
|||
return class UpcomingEventsSectionLink extends baseSectionLink {
|
||||
name = "upcoming-events";
|
||||
route = "discourse-post-event-upcoming-events";
|
||||
text = I18n.t("discourse_post_event.upcoming_events.title");
|
||||
title = I18n.t("discourse_post_event.upcoming_events.title");
|
||||
text = i18n("discourse_post_event.upcoming_events.title");
|
||||
title = i18n("discourse_post_event.upcoming_events.title");
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import discourseComputed from "discourse/lib/decorators";
|
||||
import { withSilencedDeprecations } from "discourse/lib/deprecated";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { withSilencedDeprecations } from "discourse-common/lib/deprecated";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
|
||||
export default {
|
||||
name: "disable-sort",
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ import $ from "jquery";
|
|||
import { escape } from "pretty-text/sanitizer";
|
||||
import { Promise } from "rsvp";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import getURL from "discourse/lib/get-url";
|
||||
import { iconHTML } from "discourse/lib/icon-library";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { cook } from "discourse/lib/text";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import Category from "discourse/models/category";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import I18n from "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import { formatEventName } from "../helpers/format-event-name";
|
||||
import addRecurrentEvents from "../lib/add-recurrent-events";
|
||||
import { colorToHex, contrastColor, stringToColor } from "../lib/colors";
|
||||
|
|
@ -247,7 +247,7 @@ function initializeDiscourseCalendar(api) {
|
|||
return class extends NotificationTypeBase {
|
||||
get linkTitle() {
|
||||
if (this.notification.data.title) {
|
||||
return I18n.t(this.notification.data.title);
|
||||
return i18n(this.notification.data.title);
|
||||
} else {
|
||||
return super.linkTitle;
|
||||
}
|
||||
|
|
@ -258,7 +258,7 @@ function initializeDiscourseCalendar(api) {
|
|||
}
|
||||
|
||||
get label() {
|
||||
return I18n.t(this.notification.data.message);
|
||||
return i18n(this.notification.data.message);
|
||||
}
|
||||
|
||||
get description() {
|
||||
|
|
@ -280,7 +280,7 @@ function initializeDiscourseCalendar(api) {
|
|||
this.notification.data.message ===
|
||||
"discourse_post_event.notifications.invite_user_predefined_attendance_notification"
|
||||
) {
|
||||
return I18n.t(this.notification.data.message, {
|
||||
return i18n(this.notification.data.message, {
|
||||
username: this.username,
|
||||
});
|
||||
}
|
||||
|
|
@ -881,7 +881,7 @@ function initializeDiscourseCalendar(api) {
|
|||
);
|
||||
const timezoneButton = document.createElement("button");
|
||||
|
||||
timezoneButton.title = I18n.t(
|
||||
timezoneButton.title = i18n(
|
||||
"discourse_calendar.toggle_timezone_offset_title"
|
||||
);
|
||||
timezoneButton.classList.add(
|
||||
|
|
@ -984,7 +984,7 @@ function initializeDiscourseCalendar(api) {
|
|||
startDate = _formatDateForGoogleApi(startDate, event.eventRange.def.allDay);
|
||||
|
||||
const link = document.createElement("a");
|
||||
const title = I18n.t("discourse_calendar.add_to_calendar");
|
||||
const title = i18n("discourse_calendar.add_to_calendar");
|
||||
link.title = title;
|
||||
link.appendChild(document.createTextNode(title));
|
||||
link.href = `
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import $ from "jquery";
|
||||
import { getRegister } from "discourse/lib/get-owner";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import WidgetGlue from "discourse/widgets/glue";
|
||||
import { getRegister } from "discourse-common/lib/get-owner";
|
||||
|
||||
export default {
|
||||
name: "discourse-group-timezones",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import I18n from "I18n";
|
||||
import I18n, { i18n } from "discourse-i18n";
|
||||
import DiscoursePostEvent from "discourse/plugins/discourse-calendar/discourse/components/discourse-post-event";
|
||||
import DiscoursePostEventEvent from "discourse/plugins/discourse-calendar/discourse/models/discourse-post-event-event";
|
||||
import guessDateFormat from "../lib/guess-best-date-format";
|
||||
|
|
@ -14,7 +14,7 @@ function _validEventPreview(eventContainer) {
|
|||
if (I18n.lookup(statusLocaleKey, { locale: "en" })) {
|
||||
const statusContainer = document.createElement("div");
|
||||
statusContainer.classList.add("event-preview-status");
|
||||
statusContainer.innerText = I18n.t(statusLocaleKey);
|
||||
statusContainer.innerText = i18n(statusLocaleKey);
|
||||
eventContainer.appendChild(statusContainer);
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ function _invalidEventPreview(eventContainer) {
|
|||
"alert-error"
|
||||
);
|
||||
eventContainer.classList.remove("discourse-post-event");
|
||||
eventContainer.innerText = I18n.t(
|
||||
eventContainer.innerText = i18n(
|
||||
"discourse_post_event.preview.more_than_one_event"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { cancel } from "@ember/runloop";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
import { isTesting } from "discourse/lib/environment";
|
||||
import discourseLater from "discourse/lib/later";
|
||||
import eventRelativeDate from "../lib/event-relative-date";
|
||||
|
||||
function computeRelativeEventDates() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import I18n from "I18n";
|
||||
import I18n, { i18n } from "discourse-i18n";
|
||||
|
||||
export function getCurrentBcp47Locale() {
|
||||
return I18n.currentLocale().replace("_", "-").toLowerCase();
|
||||
|
|
@ -6,10 +6,10 @@ export function getCurrentBcp47Locale() {
|
|||
|
||||
export function getCalendarButtonsText() {
|
||||
return {
|
||||
today: I18n.t("discourse_calendar.toolbar_button.today"),
|
||||
month: I18n.t("discourse_calendar.toolbar_button.month"),
|
||||
week: I18n.t("discourse_calendar.toolbar_button.week"),
|
||||
day: I18n.t("discourse_calendar.toolbar_button.day"),
|
||||
list: I18n.t("discourse_calendar.toolbar_button.list"),
|
||||
today: i18n("discourse_calendar.toolbar_button.today"),
|
||||
month: i18n("discourse_calendar.toolbar_button.month"),
|
||||
week: i18n("discourse_calendar.toolbar_button.week"),
|
||||
day: i18n("discourse_calendar.toolbar_button.day"),
|
||||
list: i18n("discourse_calendar.toolbar_button.list"),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import I18n from "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import guessDateFormat from "./guess-best-date-format";
|
||||
|
||||
function _computeCurrentEvent(container, endsAt) {
|
||||
|
|
@ -8,7 +8,7 @@ function _computeCurrentEvent(container, endsAt) {
|
|||
|
||||
const text = document.createElement("span");
|
||||
text.classList.add("text");
|
||||
text.innerText = I18n.t("discourse_post_event.topic_title.ends_in_duration", {
|
||||
text.innerText = i18n("discourse_post_event.topic_title.ends_in_duration", {
|
||||
duration: endsAt.from(moment()),
|
||||
});
|
||||
container.appendChild(text);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { tracked } from "@glimmer/tracking";
|
||||
import EmberObject from "@ember/object";
|
||||
import { TrackedArray } from "@ember-compat/tracked-built-ins";
|
||||
import { bind } from "discourse/lib/decorators";
|
||||
import User from "discourse/models/user";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import DiscoursePostEventEventStats from "./discourse-post-event-event-stats";
|
||||
import DiscoursePostEventInvitee from "./discourse-post-event-invitee";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { throttle } from "@ember/runloop";
|
||||
import { createWidget } from "discourse/widgets/widget";
|
||||
import I18n from "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default createWidget("discourse-group-timezones-filter", {
|
||||
tagName: "input.group-timezones-filter",
|
||||
|
|
@ -22,7 +22,7 @@ export default createWidget("discourse-group-timezones-filter", {
|
|||
buildAttributes() {
|
||||
return {
|
||||
type: "text",
|
||||
placeholder: I18n.t("group_timezones.search"),
|
||||
placeholder: i18n("group_timezones.search"),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import hbs from "discourse/widgets/hbs-compiler";
|
||||
import { createWidget } from "discourse/widgets/widget";
|
||||
import I18n from "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default createWidget("discourse-group-timezones-header", {
|
||||
tagName: "div.group-timezones-header",
|
||||
|
||||
transform(attrs) {
|
||||
return {
|
||||
title: I18n.t("group_timezones.group_availability", {
|
||||
title: i18n("group_timezones.group_availability", {
|
||||
group: attrs.group,
|
||||
}),
|
||||
};
|
||||
|
|
|
|||
13
package.json
13
package.json
|
|
@ -1,15 +1,16 @@
|
|||
{
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@discourse/lint-configs": "2.2.2",
|
||||
"ember-template-lint": "6.0.0",
|
||||
"eslint": "9.15.0",
|
||||
"@discourse/lint-configs": "2.4.0",
|
||||
"ember-template-lint": "6.1.0",
|
||||
"eslint": "9.19.0",
|
||||
"prettier": "2.8.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18",
|
||||
"node": ">= 22",
|
||||
"npm": "please-use-pnpm",
|
||||
"yarn": "please-use-pnpm",
|
||||
"pnpm": ">= 9"
|
||||
}
|
||||
"pnpm": "9.x"
|
||||
},
|
||||
"packageManager": "pnpm@9.15.5"
|
||||
}
|
||||
|
|
|
|||
1317
pnpm-lock.yaml
1317
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -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 "I18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
acceptance("Discourse Calendar - Notifications", function (needs) {
|
||||
needs.user({ redesigned_user_menu_enabled: true });
|
||||
|
|
@ -117,7 +117,7 @@ acceptance("Discourse Calendar - Notifications", function (needs) {
|
|||
|
||||
assert.strictEqual(
|
||||
notifications[0].textContent.replaceAll(/\s+/g, " ").trim(),
|
||||
`${I18n.t(
|
||||
`${i18n(
|
||||
"discourse_post_event.notifications.before_event_reminder"
|
||||
)} Monthly Hangout #3`,
|
||||
"before event reminder notification has the right content"
|
||||
|
|
@ -132,7 +132,7 @@ acceptance("Discourse Calendar - Notifications", function (needs) {
|
|||
|
||||
assert.strictEqual(
|
||||
notifications[1].textContent.replaceAll(/\s+/g, " ").trim(),
|
||||
`${I18n.t(
|
||||
`${i18n(
|
||||
"discourse_post_event.notifications.ongoing_event_reminder"
|
||||
)} Fancy title and pants`,
|
||||
"ongoing event reminder notification has the right content"
|
||||
|
|
@ -147,7 +147,7 @@ acceptance("Discourse Calendar - Notifications", function (needs) {
|
|||
|
||||
assert.strictEqual(
|
||||
notifications[2].textContent.replaceAll(/\s+/g, " ").trim(),
|
||||
`${I18n.t(
|
||||
`${i18n(
|
||||
"discourse_post_event.notifications.after_event_reminder"
|
||||
)} Topic with event and after_event reminder`,
|
||||
"after event reminder notification has the right content"
|
||||
|
|
@ -177,7 +177,7 @@ acceptance("Discourse Calendar - Notifications", function (needs) {
|
|||
|
||||
assert.strictEqual(
|
||||
notifications[4].textContent.replaceAll(/\s+/g, " ").trim(),
|
||||
`${I18n.t(
|
||||
`${i18n(
|
||||
"discourse_post_event.notifications.invite_user_predefined_attendance_notification",
|
||||
{ username: "apacer" }
|
||||
)} Asia Pacific team call`,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { test } from "qunit";
|
|||
import sinon from "sinon";
|
||||
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("Post event - composer", function (needs) {
|
||||
needs.user({ admin: true, can_create_discourse_post_event: true });
|
||||
|
|
@ -23,7 +23,7 @@ acceptance("Post event - composer", function (needs) {
|
|||
await categoryChooser.selectRowByValue(2);
|
||||
await click(".toolbar-popup-menu-options .dropdown-select-box-header");
|
||||
await click(
|
||||
`.toolbar-popup-menu-options *[data-name='${I18n.t(
|
||||
`.toolbar-popup-menu-options *[data-name='${i18n(
|
||||
"discourse_post_event.builder_modal.attach"
|
||||
)}']`
|
||||
);
|
||||
|
|
@ -93,7 +93,7 @@ acceptance("Post event - composer", function (needs) {
|
|||
|
||||
await click(".toolbar-popup-menu-options .dropdown-select-box-header");
|
||||
await click(
|
||||
`.toolbar-popup-menu-options *[data-name='${I18n.t(
|
||||
`.toolbar-popup-menu-options *[data-name='${i18n(
|
||||
"discourse_post_event.builder_modal.attach"
|
||||
)}']`
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import { cloneJSON } from "discourse/lib/object";
|
||||
import { acceptance, fakeTime } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
import eventTopicFixture from "../helpers/event-topic-fixture";
|
||||
|
||||
acceptance("Discourse Calendar - Topic Calendar Holidays", function (needs) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import sinon from "sinon";
|
||||
import { cloneJSON } from "discourse/lib/object";
|
||||
import discoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";
|
||||
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { cloneJSON } from "discourse-common/lib/object";
|
||||
|
||||
acceptance("Discourse Calendar - Event Title Decorator", function (needs) {
|
||||
needs.user();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { module, test } from "qunit";
|
|||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import pretender, { response } from "discourse/tests/helpers/create-pretender";
|
||||
import { fakeTime, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||
import I18n from "discourse-i18n";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import UpcomingEventsList, {
|
||||
DEFAULT_TIME_FORMAT,
|
||||
} from "../../discourse/components/upcoming-events-list";
|
||||
|
|
@ -52,7 +52,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__heading")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.title"),
|
||||
i18n("discourse_post_event.upcoming_events_list.title"),
|
||||
"displays the title"
|
||||
);
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__empty-message")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.empty"),
|
||||
i18n("discourse_post_event.upcoming_events_list.empty"),
|
||||
"displays the empty list message"
|
||||
);
|
||||
});
|
||||
|
|
@ -76,7 +76,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__heading")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.title"),
|
||||
i18n("discourse_post_event.upcoming_events_list.title"),
|
||||
"displays the title"
|
||||
);
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
(el) => el.innerText
|
||||
),
|
||||
[
|
||||
I18n.t("discourse_post_event.upcoming_events_list.all_day"),
|
||||
i18n("discourse_post_event.upcoming_events_list.all_day"),
|
||||
moment(nextMonth).format(DEFAULT_TIME_FORMAT),
|
||||
],
|
||||
"displays the formatted time"
|
||||
|
|
@ -202,7 +202,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__view-all")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.view_all"),
|
||||
i18n("discourse_post_event.upcoming_events_list.view_all"),
|
||||
"displays the view-all link"
|
||||
);
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__heading")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.title"),
|
||||
i18n("discourse_post_event.upcoming_events_list.title"),
|
||||
"displays the title"
|
||||
);
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
(el) => el.innerText
|
||||
),
|
||||
[
|
||||
I18n.t("discourse_post_event.upcoming_events_list.all_day"),
|
||||
i18n("discourse_post_event.upcoming_events_list.all_day"),
|
||||
moment(nextMonth).format("LLL"),
|
||||
],
|
||||
"displays the formatted time"
|
||||
|
|
@ -265,7 +265,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__heading")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.title"),
|
||||
i18n("discourse_post_event.upcoming_events_list.title"),
|
||||
"displays the title"
|
||||
);
|
||||
|
||||
|
|
@ -274,14 +274,14 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__error-message")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.error"),
|
||||
i18n("discourse_post_event.upcoming_events_list.error"),
|
||||
"displays the error message"
|
||||
);
|
||||
|
||||
assert
|
||||
.dom(".upcoming-events-list__try-again")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.try_again"),
|
||||
i18n("discourse_post_event.upcoming_events_list.try_again"),
|
||||
"displays the try again button"
|
||||
);
|
||||
});
|
||||
|
|
@ -298,7 +298,7 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
|
|||
assert
|
||||
.dom(".upcoming-events-list__heading")
|
||||
.hasText(
|
||||
I18n.t("discourse_post_event.upcoming_events_list.title"),
|
||||
i18n("discourse_post_event.upcoming_events_list.title"),
|
||||
"displays the title"
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue