Skip to content
2 changes: 1 addition & 1 deletion src/components/AccountSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function AccountSwitcher({isScreenFocused}: AccountSwitcherProps) {
const error = getLatestError(errorFields?.connect?.[email]);
const personalDetails = getPersonalDetailByEmail(email);
return createBaseMenuItem(personalDetails, error, {
badgeText: translate('delegate.role', {role}),
badgeText: translate('delegate.role', role),
onSelected: () => {
if (isOffline) {
close(showOfflineModal);
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccountingConnectionConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function AccountingConnectionConfirmationModal({integrationToConnect, onCancel,

return (
<ConfirmModal
title={translate('workspace.accounting.connectTitle', {connectionName: integrationToConnect})}
title={translate('workspace.accounting.connectTitle', integrationToConnect)}
isVisible
onConfirm={onConfirm}
onCancel={onCancel}
prompt={translate('workspace.accounting.connectPrompt', {connectionName: integrationToConnect})}
prompt={translate('workspace.accounting.connectPrompt', integrationToConnect)}
confirmText={translate('workspace.accounting.setup')}
cancelText={translate('common.cancel')}
success
Expand Down
4 changes: 1 addition & 3 deletions src/components/AvatarPageFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type AvatarPageFooterProps = {
/** Translation key of the validation error to show, if any */
validationError?: TranslationPaths | null | '';

/** Params for the validation error translation */
/** Standalone params for the validation error translation */
phraseParam?: Record<string, unknown>;

/** Whether the save button is enabled */
Expand All @@ -32,8 +32,6 @@ function AvatarPageFooter({validationError, phraseParam = {}, isDirty, onSave}:
{!!validationError && (
<DotIndicatorMessage
style={styles.mv5}
// `phraseParam` is an open record but `translate` accepts only the params shape for the
// given key; the cast is safe because callers always pass params matching `validationError`.
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
messages={{validationError: translate(validationError, phraseParam as never)}}
type="error"
Expand Down
4 changes: 2 additions & 2 deletions src/components/AvatarWithImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function AvatarWithImagePicker({
const {translate} = useLocalize();
const {openCropper} = useAvatarCrop({maskType: editorMaskImage ? 'square' : undefined, onCropped: onImageSelected});

const setError = (error: TranslationPaths | null, phraseParam: Record<string, unknown>) => {
const setError = (error: TranslationPaths | null, phraseParam: Record<string, unknown> = {}) => {
setErrorData({
validationError: error,
phraseParam,
Expand Down Expand Up @@ -291,7 +291,7 @@ function AvatarWithImagePicker({
{!!errorData.validationError && (
<DotIndicatorMessage
style={styles.mt6}
// eslint-disable-next-line @typescript-eslint/naming-convention
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-type-assertion
messages={{0: translate(errorData.validationError, errorData.phraseParam as never)}}
type="error"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ function HeaderWithBackButton({
);

const middleContent = useMemo(() => {
const stepCounterTranslation = stepCounter ? translate('stepCounter', stepCounter.step, stepCounter.total, stepCounter.text) : undefined;
if (progressBarPercentage) {
const progressBarLabel = stepCounter ? `${translate('common.progressBarLabel')}, ${translate('stepCounter', stepCounter)}` : undefined;
const progressBarLabel = stepCounter ? `${translate('common.progressBarLabel')}, ${stepCounterTranslation}` : undefined;
return (
<>
{/* Reserves as much space for the middleContent as possible */}
Expand Down Expand Up @@ -156,7 +157,7 @@ function HeaderWithBackButton({
return (
<Header
title={title}
subtitle={stepCounter ? translate('stepCounter', stepCounter) : subtitle}
subtitle={stepCounterTranslation ?? subtitle}
textStyles={[titleColor ? StyleUtils.getTextColorStyle(titleColor) : {}, shouldUseHeadlineHeader && styles.textHeadlineH2]}
subTitleLink={subTitleLink}
numberOfTitleLines={1}
Expand Down
5 changes: 1 addition & 4 deletions src/components/InteractiveStepSubHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ function InteractiveStepSubHeader({stepNames, startStepIndex = 0, currentStepAcc
>
<InteractiveStepButton
stepNumber={index + 1}
stepLabel={translate('stepCounter', {
step: index + 1,
total: stepNames.length,
})}
stepLabel={translate('stepCounter', index + 1, stepNames.length)}
currentStepDescription={isCurrentStep ? currentStepAccessibilityDescription : undefined}
isCurrentStep={isCurrentStep}
isLockedStep={isLockedStep}
Expand Down
5 changes: 1 addition & 4 deletions src/components/InteractiveStepSubPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ function InteractiveStepSubPageHeader({stepNames, currentStepIndex, currentStepA
>
<InteractiveStepButton
stepNumber={index + 1}
stepLabel={translate('stepCounter', {
step: index + 1,
total: stepNames.length,
})}
stepLabel={translate('stepCounter', index + 1, stepNames.length)}
currentStepDescription={isCurrentStep ? currentStepAccessibilityDescription : undefined}
isCurrentStep={isCurrentStep}
isLockedStep={isLockedStep}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ function ExportPrimaryAction({reportID, onExportModalOpen}: ExportPrimaryActionP
}}
>
<Button.Text>
{translate('workspace.common.exportIntegrationSelected', {
{translate(
'workspace.common.exportIntegrationSelected',
// connectedIntegration is guaranteed non-null when EXPORT_TO_ACCOUNTING is the primary action
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
connectionName: connectedIntegration!,
})}
connectedIntegration!,
)}
</Button.Text>
</Button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ParentNavigationSubtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function ParentNavigationSubtitle({
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onPress={onPress}
accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
accessibilityLabel={translate('threads.parentNavigationSummary', reportName, workspaceName)}
style={[
pressableStyles,
styles.optionAlternateText,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReportActionItem/ExportWithDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function ExportWithDropdownMenu({
const options = [
{
value: CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION,
text: translate('workspace.common.exportIntegrationSelected', {connectionName}),
text: translate('workspace.common.exportIntegrationSelected', connectionName),
...optionTemplate,
},
{
Expand Down Expand Up @@ -122,7 +122,7 @@ function ExportWithDropdownMenu({
if (isExported) {
showConfirmModal({
title: translate('workspace.exportAgainModal.title'),
prompt: translate('workspace.exportAgainModal.description', {connectionName, reportName: report?.reportName ?? ''}),
prompt: translate('workspace.exportAgainModal.description', report?.reportName ?? '', connectionName),
confirmText: translate('workspace.exportAgainModal.confirmText'),
cancelText: translate('workspace.exportAgainModal.cancelText'),
}).then(({action}) => {
Expand Down
7 changes: 3 additions & 4 deletions src/hooks/useExportActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,9 @@ function useExportActions({reportID, policy, onPDFModalOpen}: UseExportActionsPa
},
},
[CONST.REPORT.EXPORT_OPTIONS.EXPORT_TO_INTEGRATION]: {
text: translate('workspace.common.exportIntegrationSelected', {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
connectionName: connectedIntegrationFallback!,
}),
// connectedIntegrationFallback is guaranteed when this export option is offered
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
text: translate('workspace.common.exportIntegrationSelected', connectedIntegrationFallback!),
icon: getIntegrationIcon(connectedIntegration ?? connectedIntegrationFallback, expensifyIcons),
displayInDefaultIconColor: true,
additionalIconStyles: styles.integrationIcon,
Expand Down
5 changes: 1 addition & 4 deletions src/hooks/useExportAgainModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ function useExportAgainModal(reportID: string | undefined, policyID: string | un

showConfirmModal({
title: translate('workspace.exportAgainModal.title'),
prompt: translate('workspace.exportAgainModal.description', {
connectionName: integrationForExport,
reportName,
}),
prompt: translate('workspace.exportAgainModal.description', reportName, integrationForExport),
confirmText: translate('workspace.exportAgainModal.confirmText'),
cancelText: translate('workspace.exportAgainModal.cancelText'),
}).then((result) => {
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/useLifecycleActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,7 @@ function useLifecycleActions({reportID, startApprovedAnimation, startAnimation,
const integrationNameFromExportMessage = isExported ? getIntegrationNameFromExportMessageUtils(reportActions) : null;

const connectedIntegration = getValidConnectedIntegration(policy);
const connectedIntegrationName = connectedIntegration
? translate('workspace.accounting.connectionName', {
connectionName: connectedIntegration,
})
: '';
const connectedIntegrationName = connectedIntegration ? translate('workspace.accounting.connectionName', connectedIntegration) : '';

const isAnyTransactionOnHold = hasHeldExpensesReportUtils(transactions);

Expand Down
5 changes: 1 addition & 4 deletions src/hooks/useSearchBulkActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1691,10 +1691,7 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) {
if (areAnyReportsExported) {
showConfirmModal({
title: translate('workspace.exportAgainModal.title'),
prompt: translate('workspace.exportAgainModal.description', {
connectionName: connectedIntegration,
reportName: exportedReportNames.join('\n'),
}),
prompt: translate('workspace.exportAgainModal.description', exportedReportNames.join('\n'), connectedIntegration),
confirmText: translate('workspace.exportAgainModal.confirmText'),
cancelText: translate('workspace.exportAgainModal.cancelText'),
shouldEnablePromptScroll: true,
Expand Down
Loading
Loading