diff --git a/e2e/test/scenarios/question/reproductions/33079-drill-underlying-records.cy.spec.js b/e2e/test/scenarios/question/reproductions/33079-drill-underlying-records.cy.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..ad6a9f558682cb06fbe57a52b6503dcd21600937 --- /dev/null +++ b/e2e/test/scenarios/question/reproductions/33079-drill-underlying-records.cy.spec.js @@ -0,0 +1,34 @@ +import { popover, restore } from "e2e/support/helpers"; +import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database"; +const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE; + +const questionDetails = { + display: "line", + query: { + "source-table": ORDERS_ID, + aggregation: [["count"]], + breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }]], + }, +}; + +describe("issue 33079", () => { + beforeEach(() => { + restore(); + cy.signInAsAdmin(); + + cy.intercept("POST", "/api/dataset").as("dataset"); + cy.request("GET", "/api/user/current").then(({ body: user }) => { + cy.request("PUT", `/api/user/${user.id}`, { locale: "de" }); + }); + }); + + it("underlying records drill should work in a non-English locale (metabase#33079)", () => { + cy.createQuestion(questionDetails, { visitQuestion: true }); + cy.get(".dot").eq(1).click({ force: true }); + popover() + .findByText(/Order/) // See these Orders + .click(); + cy.wait("@dataset"); + cy.findByTestId("question-row-count").should("contain", "19"); + }); +}); diff --git a/frontend/src/metabase/modes/components/drill/UnderlyingRecordsDrill.ts b/frontend/src/metabase/modes/components/drill/UnderlyingRecordsDrill.ts index 5a237a9f0484ba76f0a740c636a3ed2c58aed032..43b522b53d051fb45bea679c6629c0b3468b854c 100644 --- a/frontend/src/metabase/modes/components/drill/UnderlyingRecordsDrill.ts +++ b/frontend/src/metabase/modes/components/drill/UnderlyingRecordsDrill.ts @@ -22,7 +22,8 @@ export const UnderlyingRecordsDrill: Drill = ({ question, clicked }) => { : ngettext(msgid`record`, `records`, rowCount); const actionTitle = ngettext( - msgid`See this ${tableTitle}`, + // extra argument is required to avoid a collision with a singular form translation (metabase#33079) + msgid`See this ${tableTitle}${""}`, `See these ${tableTitle}`, rowCount, );