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:
David Taylor
2024-11-19 20:45:18 +00:00
committed by GitHub
parent 187b7d74fb
commit 32665cf9dd
909 changed files with 3453 additions and 3591 deletions

View File

@ -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");
});
});