From 4b21272eb68babe58e7da44f90b4aa69ebdce807 Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Wed, 11 Dec 2024 22:31:21 -0600 Subject: [PATCH] feat: translate "Starting job" message (#237) * feat: translate "Starting job" message * Create silent-toes-bow.md --- .changeset/silent-toes-bow.md | 8 ++++++++ packages/embedded-utils/src/utils/createListener.ts | 9 ++++++--- packages/javascript/src/listener.ts | 5 ++++- packages/react/src/hooks/legacy/usePortal.tsx | 2 +- packages/react/src/utils/constants.ts | 3 ++- packages/vue/src/utils/createSimpleListener.ts | 5 ++++- 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .changeset/silent-toes-bow.md diff --git a/.changeset/silent-toes-bow.md b/.changeset/silent-toes-bow.md new file mode 100644 index 00000000..cceb78b8 --- /dev/null +++ b/.changeset/silent-toes-bow.md @@ -0,0 +1,8 @@ +--- +'@flatfile/embedded-utils': patch +'@flatfile/javascript': patch +'@flatfile/react': patch +'@flatfile/vue': patch +--- + +This release translates the "Starting job" message diff --git a/packages/embedded-utils/src/utils/createListener.ts b/packages/embedded-utils/src/utils/createListener.ts index d822efb8..e7de96b9 100644 --- a/packages/embedded-utils/src/utils/createListener.ts +++ b/packages/embedded-utils/src/utils/createListener.ts @@ -4,9 +4,9 @@ import { FlatfileRecord } from '@flatfile/hooks' import { Browser, FlatfileEvent, FlatfileListener } from '@flatfile/listener' import { recordHook } from '@flatfile/plugin-record-hook' import { - SimpleOnboarding, - NewSpaceFromPublishableKey, DefaultSubmitSettings, + NewSpaceFromPublishableKey, + SimpleOnboarding, } from '../types' import { handlePostMessage } from './handlePostMessage' import { JobHandler } from './JobHandler' @@ -82,7 +82,10 @@ export const createSimpleListener = ({ configure.on('job:ready', async (event) => { const { jobId, spaceId, workbookId } = event.context try { - await api.jobs.ack(jobId, { info: 'Starting job', progress: 10 }) + await api.jobs.ack(jobId, { + info: 'jobs.messages.startingJob', + progress: 10, + }) const job = new JobHandler(jobId) const { data: workbookSheets } = await api.sheets.list({ diff --git a/packages/javascript/src/listener.ts b/packages/javascript/src/listener.ts index 9ac27d10..0962a802 100644 --- a/packages/javascript/src/listener.ts +++ b/packages/javascript/src/listener.ts @@ -73,7 +73,10 @@ export const createSimpleListener = ({ configure.on('job:ready', async (event) => { const { jobId, spaceId, workbookId } = event.context try { - await api.jobs.ack(jobId, { info: 'Starting job', progress: 10 }) + await api.jobs.ack(jobId, { + info: 'jobs.messages.startingJob', + progress: 10, + }) const job = new JobHandler(jobId) const { data: workbookSheets } = await api.sheets.list({ diff --git a/packages/react/src/hooks/legacy/usePortal.tsx b/packages/react/src/hooks/legacy/usePortal.tsx index ef15f945..2c314701 100644 --- a/packages/react/src/hooks/legacy/usePortal.tsx +++ b/packages/react/src/hooks/legacy/usePortal.tsx @@ -75,7 +75,7 @@ export const usePortal = ( const { jobId, spaceId, workbookId } = event.context try { await api.jobs.ack(jobId, { - info: 'Starting job', + info: 'jobs.messages.startingJob', progress: 10, }) diff --git a/packages/react/src/utils/constants.ts b/packages/react/src/utils/constants.ts index ab77a98c..d3aac627 100644 --- a/packages/react/src/utils/constants.ts +++ b/packages/react/src/utils/constants.ts @@ -32,7 +32,8 @@ export const OnSubmitAction = ( info: onSubmitSettings?.startingJobMessage === null ? undefined - : onSubmitSettings?.startingJobMessage ?? 'Starting job', + : onSubmitSettings?.startingJobMessage ?? + 'jobs.messages.startingJob', progress: 10, }) const job = new JobHandler(jobId) diff --git a/packages/vue/src/utils/createSimpleListener.ts b/packages/vue/src/utils/createSimpleListener.ts index 08a060f8..57974730 100644 --- a/packages/vue/src/utils/createSimpleListener.ts +++ b/packages/vue/src/utils/createSimpleListener.ts @@ -41,7 +41,10 @@ export const createSimpleListener = ({ configure.on('job:ready', async (event: FlatfileEvent) => { const { jobId, spaceId, workbookId } = event.context try { - await api.jobs.ack(jobId, { info: 'Starting job', progress: 10 }) + await api.jobs.ack(jobId, { + info: 'jobs.messages.startingJob', + progress: 10, + }) const job = new JobHandler(jobId) const { data: workbookSheets } = await api.sheets.list({