diff --git a/apps/web/components/jira/jira-issue-watch-dialog.tsx b/apps/web/components/jira/jira-issue-watch-dialog.tsx index d918d758e8..0aea0d5994 100644 --- a/apps/web/components/jira/jira-issue-watch-dialog.tsx +++ b/apps/web/components/jira/jira-issue-watch-dialog.tsx @@ -28,7 +28,7 @@ import { computeEditorHeight, } from "@/components/settings/profile-edit/script-editor"; import { - JIRA_ISSUE_WATCH_PLACEHOLDERS, + jiraIssueWatchPlaceholders, DEFAULT_JIRA_ISSUE_WATCH_PROMPT, } from "@/components/jira/jira-issue-watch-placeholders"; import { STEP_DEFAULT, STEP_DEFAULT_LABEL, resolveProfileId } from "@/lib/watcher-profile-default"; @@ -39,6 +39,8 @@ import type { JiraIssueWatch, UpdateJiraIssueWatchInput, } from "@/lib/types/jira"; +import { useTranslation } from "react-i18next"; +import type { TFunction } from "i18next"; type Props = { open: boolean; @@ -88,6 +90,10 @@ function parseMaxInflightTasks(raw: string): number | null | "invalid" { return n; } +// JQL, not copy. Every token here is parsed by Jira — field names (`project`, +// `status`, `created`), operators and a project key — and the string is +// persisted on the watch and sent upstream verbatim. Translating any of it would +// produce a query Jira rejects. const DEFAULT_JQL = `project = PROJ AND status = "Open" ORDER BY created DESC`; function makeEmptyForm(workspaceId: string): FormState { @@ -192,6 +198,7 @@ function JQLField({ jql: string; onChange: (v: string) => void; }) { + const { t } = useTranslation(); const [result, setResult] = useState<{ ok: boolean; message: string } | null>(null); const [testing, setTesting] = useState(false); const handleTest = useCallback(async () => { @@ -199,13 +206,14 @@ function JQLField({ setResult(null); try { const res = await searchJiraTickets({ jql, maxResults: 5 }, { workspaceId }); - setResult({ ok: true, message: `Matched ${res.tickets.length} ticket(s) in this page.` }); + // "ticket(s)" was an English plural hack; the count now selects the form. + setResult({ ok: true, message: t("jira:matchedTickets", { count: res.tickets.length }) }); } catch (err) { - setResult({ ok: false, message: `JQL error: ${String(err)}` }); + setResult({ ok: false, message: t("jira:jqlError", { error: String(err) }) }); } finally { setTesting(false); } - }, [workspaceId, jql]); + }, [workspaceId, jql, t]); return (