From 6bbabf4c86f0677d1d7b8d50e194af097583caf4 Mon Sep 17 00:00:00 2001 From: Paulo Bernardo Date: Wed, 11 Sep 2024 17:28:12 -0300 Subject: [PATCH] fix: update missing translations --- i18next-scanner.config.js | 21 +- .../canvas/__snapshots__/Canvas.test.tsx.snap | 619 +- .../flow/actions/callbrain/CallBrainForm.tsx | 1 - .../__snapshots__/CallBrainForm.test.tsx.snap | 1 - .../UpdateContactForm.test.tsx.snap | 2 +- .../ExternalServiceRouterForm.tsx | 9 +- .../ExternalServiceRouterForm.test.tsx.snap | 10 +- src/components/flow/routers/random/helpers.ts | 12 +- .../classify/AutomaticClassifyRouterForm.tsx | 6 +- .../flow/routers/ticket/TicketRouterForm.tsx | 10 +- .../TicketRouterForm.test.tsx.snap | 1530 +- ...endWhatsAppProductRouterForm.test.tsx.snap | 27820 ++-------------- src/config/i18n/cs/resource.json | 1 - src/config/i18n/defaults.json | 217 +- src/config/i18n/es/resource.json | 146 +- src/config/i18n/fr/resource.json | 1 - src/config/i18n/mn/resource.json | 1 - src/config/i18n/pt-br/resource.json | 151 +- vite.config.js | 2 +- 19 files changed, 3004 insertions(+), 27556 deletions(-) diff --git a/i18next-scanner.config.js b/i18next-scanner.config.js index ba7136b27..b0aec9ea8 100644 --- a/i18next-scanner.config.js +++ b/i18next-scanner.config.js @@ -1,20 +1,25 @@ /* eslint-disable @typescript-eslint/no-var-requires */ -var typescriptTransform = require('i18next-scanner-typescript'); +const typescriptTransform = require('i18next-scanner-typescript'); // eslint-disable-next-line no-undef module.exports = { - input: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.test.*', '!src/i18n/**', '!**/node_modules/**'], + input: [ + 'src/**/*.{js,jsx,ts,tsx}', + '!src/**/*.test.*', + '!src/i18n/**', + '!**/node_modules/**', + ], output: './src/config/', options: { sort: true, debug: true, func: { list: ['i18n.t'], - extensions: ['.js', '.ts', '.tsx'] + extensions: ['.js', '.ts', '.tsx'], }, removeUnusedKeys: true, trans: { - component: 'Trans' + component: 'Trans', }, lngs: ['dev'], ns: ['defaults'], @@ -24,12 +29,12 @@ module.exports = { loadPath: 'i18n/[[ns]].json', savePath: 'i18n/[[ns]].json', jsonIndent: 2, - lineEnding: '\n' + lineEnding: '\n', }, interpolation: { prefix: '[[', - suffix: ']]' - } + suffix: ']]', + }, }, - transform: typescriptTransform({ extensions: ['.tsx'] }) + transform: typescriptTransform({ extensions: ['.tsx'] }), }; diff --git a/src/components/canvas/__snapshots__/Canvas.test.tsx.snap b/src/components/canvas/__snapshots__/Canvas.test.tsx.snap index 31d5ec264..1217acd60 100644 --- a/src/components/canvas/__snapshots__/Canvas.test.tsx.snap +++ b/src/components/canvas/__snapshots__/Canvas.test.tsx.snap @@ -1,156 +1,6 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Canvas > adjusts the height when updating dimensions 1`] = ` - -
-
-
-
-
-
-
-
-
-
-
-
- -
-
- - remove - -
-
- 100 - - percent - -
-
- - add - -
-
- - - - - Zoom -
- - -
-
-
-
-
-
-
- -
-
- - Start of flow - - - arrow_upward - -
-
- - - - - -
- - -
-
-
-
-
-
-
-
-
- -`; - -exports[`Canvas > adjusts the height when updating dimensions 2`] = `
adjusts the height when updating dimensions 2`] = ` >
- - - remove - - -
+ />
adjusts the height when updating dimensions 2`] = ` 100
- - - percent - - -
+ />
- - - add - - -
+ />
- - - - - -
@@ -305,26 +124,15 @@ exports[`Canvas > adjusts the height when updating dimensions 2`] = `
- - - arrow_upward - - -
+ />
- -
@@ -353,156 +161,6 @@ exports[`Canvas > adjusts the height when updating dimensions 2`] = ` `; exports[`Canvas > initializes the height to the lowest draggable 1`] = ` - -
-
-
-
-
-
-
-
-
-
-
-
- -
-
- - remove - -
-
- 100 - - percent - -
-
- - add - -
-
- - - - - Zoom -
- - -
-
-
-
-
-
-
- -
-
- - Start of flow - - - arrow_upward - -
-
- - - - - -
- - -
-
-
-
-
-
-
-
-
- -`; - -exports[`Canvas > initializes the height to the lowest draggable 2`] = `
initializes the height to the lowest draggable 2`] = ` >
- - - remove - - -
+ />
initializes the height to the lowest draggable 2`] = ` 100
- - - percent - - -
+ />
- - - add - - -
+ />
- - - - - -
@@ -657,26 +284,15 @@ exports[`Canvas > initializes the height to the lowest draggable 2`] = `
- - - arrow_upward - - -
+ />
- -
@@ -723,151 +339,6 @@ exports[`Canvas > reflows collisions 1`] = ` `; exports[`Canvas > render default 1`] = ` - -
-
-
-
-
-
-
-
-
-
-
- -
-
- - remove - -
-
- 100 - - percent - -
-
- - add - -
-
- - - - - Zoom -
- - -
-
-
-
-
-
-
- -
-
- - Start of flow - - - arrow_upward - -
-
- - - - - -
- - -
-
-
-
-
-
-
-
-
- -`; - -exports[`Canvas > render default 2`] = `
render default 2`] = ` >
- - - remove - - -
+ />
render default 2`] = ` 100
- - - percent - - -
+ />
- - - add - - -
+ />
- - - - - -
@@ -1017,26 +457,15 @@ exports[`Canvas > render default 2`] = `
- - - arrow_upward - - -
+ />
- - diff --git a/src/components/flow/actions/callbrain/CallBrainForm.tsx b/src/components/flow/actions/callbrain/CallBrainForm.tsx index 83ed6788b..9b6d93465 100644 --- a/src/components/flow/actions/callbrain/CallBrainForm.tsx +++ b/src/components/flow/actions/callbrain/CallBrainForm.tsx @@ -108,7 +108,6 @@ export class BrainForm extends React.Component< diff --git a/src/components/flow/actions/updatecontact/__snapshots__/UpdateContactForm.test.tsx.snap b/src/components/flow/actions/updatecontact/__snapshots__/UpdateContactForm.test.tsx.snap index 73d9322cc..ba78ec298 100644 --- a/src/components/flow/actions/updatecontact/__snapshots__/UpdateContactForm.test.tsx.snap +++ b/src/components/flow/actions/updatecontact/__snapshots__/UpdateContactForm.test.tsx.snap @@ -1187,7 +1187,7 @@ exports[`UpdateContactForm > should render field 1`] = ` data-v-bf6639b4="" data-v-df38a188="" hascloudycolor="false" - placeholder="" + placeholder="Enter a new value for Age" type="text" value="25" /> diff --git a/src/components/flow/routers/externalservice/ExternalServiceRouterForm.tsx b/src/components/flow/routers/externalservice/ExternalServiceRouterForm.tsx index b88a031be..67b12549c 100644 --- a/src/components/flow/routers/externalservice/ExternalServiceRouterForm.tsx +++ b/src/components/flow/routers/externalservice/ExternalServiceRouterForm.tsx @@ -337,12 +337,17 @@ export default class ExternalServiceRouterForm extends React.Component< {showExternalServices ? (

- Integration with... + + {i18n.t('forms.integration_with', 'Integration with...')} +

ChatGPT > render > should render 1`] = `

- Integration with... + Integration with...

ChatGPT > updates > should save changes 1`]

- Integration with... + Integration with...

Omie > render > should render 1`] = `

- Integration with... + Integration with...

Omie > updates > should save changes 1`] =

- Integration with... + Integration with...

Omie > updates > should save changes 2`] =

- Integration with... + Integration with...

{ - return { value: count + '', name: count + ' buckets' }; + return { + value: count + '', + name: count + i18n.t('forms.option_buckets', ' buckets'), + }; }, ); @@ -109,7 +113,11 @@ export const fillOutCategories = ( // add any that we still need return categories.concat( range(categories.length, buckets).map((idx: number) => { - return { uuid: createUUID(), name: `Bucket ${idx + 1}`, exit_uuid: null }; + return { + uuid: createUUID(), + name: `${i18n.t('forms.bucket', 'Bucket')} ${idx + 1}`, + exit_uuid: null, + }; }), ); }; diff --git a/src/components/flow/routers/smart/classify/AutomaticClassifyRouterForm.tsx b/src/components/flow/routers/smart/classify/AutomaticClassifyRouterForm.tsx index 0ce236232..af3632ec5 100644 --- a/src/components/flow/routers/smart/classify/AutomaticClassifyRouterForm.tsx +++ b/src/components/flow/routers/smart/classify/AutomaticClassifyRouterForm.tsx @@ -138,13 +138,11 @@ export default class AutomaticClassifyRouterForm extends React.Component< className={`${styles.label} u font secondary body-md color-neutral-cloudy`} > {i18n.t('forms.classifier_input_description')} - - {i18n.t(' @input.text')} - + @input.text
render > should render 1`] = ` class="_options_wrapper_08dd12" data-testid="temba_select_options_type" id="temba_select_options_type" - style="margin-top: 0px; width: -24px; display: none;" + style="margin-top: 0px; width: 0px; display: none;" >
render > should render 1`] = ` class="_options_wrapper_08dd12" data-testid="temba_select_expressions_type" id="temba_select_expressions_type" - style="margin-top: 0px; width: -24px; display: none;" + style="margin-top: 0px; width: 0px; display: none;" />
@@ -443,13 +443,13 @@ exports[`TicketRouterForm > render > should render 1`] = ` class="_options_wrapper_08dd12" data-testid="temba_select_options_topic" id="temba_select_options_topic" - style="margin-top: 0px; width: -24px; display: none;" + style="margin-top: 0px; width: 0px; display: none;" />
@@ -515,18 +515,6 @@ exports[`TicketRouterForm > render > should render 1`] = `
-
@@ -682,7 +670,7 @@ exports[`TicketRouterForm > render > should render 1`] = ` `; -exports[`TicketRouterForm > render > should render 2`] = ` +exports[`TicketRouterForm > updates > should save changes 1`] = `
render > should render 2`] = ` `; -exports[`TicketRouterForm > updates > should save changes 1`] = ` - -
-
-
-
-
- Open Ticket -
-
-
-
-
-
-
- When a contact arrives at this point in your flow... -
-
-
-
-
-
- -
- - - - - -
- -
-
-
- - -
-
- -
-
-
-
-
-
- -
- - - - - -
- -
-
-
- -
-
-
-
-
- -
- - - - - -
- -
-
-
- -
-
-
-
-
-
- -