Skip to content

Commit

Permalink
refactor: add types for translation params
Browse files Browse the repository at this point in the history
  • Loading branch information
mananjadhav committed Sep 30, 2024
1 parent c3afb4c commit 1f23a03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import type {
GoBackMessageParams,
GoToRoomParams,
ImportedTagsMessageParams,
ImportedTypesParams,
ImportFieldParams,
ImportMembersSuccessfullDescriptionParams,
ImportTagsSuccessfullDescriptionParams,
Expand Down Expand Up @@ -2769,7 +2770,7 @@ const translations = {
importTaxDescription: 'Import tax groups from NetSuite.',
importCustomFields: {
chooseOptionBelow: 'Choose an option below:',
label: (importedTypes: string[]) => `Imported as ${importedTypes.join(' and ')}`,
label: ({importedTypes}: ImportedTypesParams) => `Imported as ${importedTypes.join(' and ')}`,
requiredFieldError: ({fieldName}: RequiredFieldParams) => `Please enter the ${fieldName}`,
customSegments: {
title: 'Custom segments/records',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import type {
GoBackMessageParams,
GoToRoomParams,
ImportedTagsMessageParams,
ImportedTypesParams,
ImportFieldParams,
ImportMembersSuccessfullDescriptionParams,
ImportTagsSuccessfullDescriptionParams,
Expand Down Expand Up @@ -2804,7 +2805,7 @@ const translations = {
importTaxDescription: 'Importar grupos de impuestos desde NetSuite.',
importCustomFields: {
chooseOptionBelow: 'Elija una de las opciones siguientes:',
label: (importedTypes: string[]) => `Importados como ${importedTypes.join(' y ')}`,
label: ({importedTypes}: ImportedTypesParams) => `Importados como ${importedTypes.join(' y ')}`,
requiredFieldError: ({fieldName}: RequiredFieldParams) => `Por favor, introduzca el ${fieldName}`,
customSegments: {
title: 'Segmentos/registros personalizados',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ type AuthenticationErrorParams = {
connectionName: string;
};

type ImportedTypesParams = {
importedTypes: string[];
};

export type {
AuthenticationErrorParams,
ImportMembersSuccessfullDescriptionParams,
Expand Down Expand Up @@ -730,4 +734,5 @@ export type {
CharacterLengthLimitParams,
OptionalParam,
AssignCardParams,
ImportedTypesParams,
};

0 comments on commit 1f23a03

Please sign in to comment.