diff --git a/src/components/CategoryPicker/index.tsx b/src/components/CategoryPicker/index.tsx index f0a1870a3c61..38ceeef243dd 100644 --- a/src/components/CategoryPicker/index.tsx +++ b/src/components/CategoryPicker/index.tsx @@ -147,7 +147,7 @@ function CategoryPicker({ value: searchValue, label: translate('common.search'), onChangeText: setSearchValue, - headerMessage: getHeaderMessageForNonUserList(categoryData.length > 0, debouncedSearchValue), + headerMessage: getHeaderMessageForNonUserList(translate, categoryData.length > 0, debouncedSearchValue), hint: offlineMessage, // Auto-focus is opt-in (inline-edit popover only) and skipped on touch surfaces to avoid popping the keyboard. disableAutoFocus: !(shouldAutoFocusSearchInput && canFocusInputOnScreenFocus()), diff --git a/src/components/DestinationPicker.tsx b/src/components/DestinationPicker.tsx index c75d0a77eb99..c50b36bdf062 100644 --- a/src/components/DestinationPicker.tsx +++ b/src/components/DestinationPicker.tsx @@ -76,7 +76,7 @@ function DestinationPicker({selectedDestination, policyID, onSubmit, ref}: Desti label: translate('common.search'), onChangeText: setSearchValue, disableAutoFocus: true, - headerMessage: getHeaderMessageForNonUserList(destinationData.length > 0, debouncedSearchValue), + headerMessage: getHeaderMessageForNonUserList(translate, destinationData.length > 0, debouncedSearchValue), }; return ( diff --git a/src/components/TagPicker/index.tsx b/src/components/TagPicker/index.tsx index 82db74d1bdc5..dbac0ff4a7e2 100644 --- a/src/components/TagPicker/index.tsx +++ b/src/components/TagPicker/index.tsx @@ -174,7 +174,7 @@ function TagPicker({ const textInputOptions = { value: searchValue, onChangeText: setSearchValue, - headerMessage: getHeaderMessageForNonUserList((sections?.at(0)?.data?.length ?? 0) > 0, searchValue), + headerMessage: getHeaderMessageForNonUserList(translate, (sections?.at(0)?.data?.length ?? 0) > 0, searchValue), label: translate('common.search'), // Auto-focus is opt-in (inline-edit popover only) and skipped on touch surfaces to avoid popping the keyboard. disableAutoFocus: !(shouldAutoFocusSearchInput && canFocusInputOnScreenFocus()), diff --git a/src/components/TaxPicker.tsx b/src/components/TaxPicker.tsx index 05a114ea97d9..4145937ba062 100644 --- a/src/components/TaxPicker.tsx +++ b/src/components/TaxPicker.tsx @@ -145,7 +145,7 @@ function TaxPicker({ label: translate('common.search'), value: searchValue, onChangeText: setSearchValue, - headerMessage: getHeaderMessageForNonUserList((sections.at(0)?.data?.length ?? 0) > 0, searchValue), + headerMessage: getHeaderMessageForNonUserList(translate, (sections.at(0)?.data?.length ?? 0) > 0, searchValue), }; const updatedSections = deletedTaxOption diff --git a/src/libs/OptionsListUtils/index.ts b/src/libs/OptionsListUtils/index.ts index 68ce51159020..da2567f52f1e 100644 --- a/src/libs/OptionsListUtils/index.ts +++ b/src/libs/OptionsListUtils/index.ts @@ -2908,9 +2908,9 @@ function getHeaderMessage(hasSelectableOptions: boolean, hasUserToInvite: boolea /** * Helper method for non-user lists (eg. categories and tags) that returns the text to be used for the header's message and title (if any) */ -function getHeaderMessageForNonUserList(hasSelectableOptions: boolean, searchValue: string): string { +function getHeaderMessageForNonUserList(translate: LocalizedTranslate, hasSelectableOptions: boolean, searchValue: string): string { if (searchValue && !hasSelectableOptions) { - return translateLocal('common.noResultsFound'); + return translate('common.noResultsFound'); } return ''; } diff --git a/src/pages/Debug/Report/DebugReportActions.tsx b/src/pages/Debug/Report/DebugReportActions.tsx index 756ea5c47e49..9c76fbf68f79 100644 --- a/src/pages/Debug/Report/DebugReportActions.tsx +++ b/src/pages/Debug/Report/DebugReportActions.tsx @@ -112,7 +112,7 @@ function DebugReportActions({reportID}: DebugReportActionsProps) { value: searchValue, label: translate('common.search'), onChangeText: setSearchValue, - headerMessage: getHeaderMessageForNonUserList(searchedReportActions.length > 0, debouncedSearchValue), + headerMessage: getHeaderMessageForNonUserList(translate, searchedReportActions.length > 0, debouncedSearchValue), }), [debouncedSearchValue, searchValue, searchedReportActions.length, setSearchValue, translate], ); diff --git a/src/pages/DynamicNewReportWorkspaceSelectionPage.tsx b/src/pages/DynamicNewReportWorkspaceSelectionPage.tsx index 95d47595016c..01a2561e242b 100644 --- a/src/pages/DynamicNewReportWorkspaceSelectionPage.tsx +++ b/src/pages/DynamicNewReportWorkspaceSelectionPage.tsx @@ -267,7 +267,7 @@ function DynamicNewReportWorkspaceSelectionPage({route}: NewReportWorkspaceSelec label: usersWorkspaces.length >= CONST.STANDARD_LIST_ITEM_LIMIT ? translate('common.search') : undefined, value: searchTerm, onChangeText: setSearchTerm, - headerMessage: getHeaderMessageForNonUserList(areResultsFound, debouncedSearchTerm), + headerMessage: getHeaderMessageForNonUserList(translate, areResultsFound, debouncedSearchTerm), }; return ( diff --git a/src/pages/EditReportFieldDropdown.tsx b/src/pages/EditReportFieldDropdown.tsx index 64af2b99cf86..038d01ca64de 100644 --- a/src/pages/EditReportFieldDropdown.tsx +++ b/src/pages/EditReportFieldDropdown.tsx @@ -62,7 +62,7 @@ function EditReportFieldDropdown({onSubmit, fieldKey, fieldValue, fieldOptions}: value: searchValue, label: translate('common.search'), onChangeText: setSearchValue, - headerMessage: getHeaderMessageForNonUserList(policyReportFieldData.length > 0, debouncedSearchValue), + headerMessage: getHeaderMessageForNonUserList(translate, policyReportFieldData.length > 0, debouncedSearchValue), }; return (