diff --git a/src/components/AmountTextInput.tsx b/src/components/AmountTextInput.tsx index 58a9d0fcd5517..96395a6fa134b 100644 --- a/src/components/AmountTextInput.tsx +++ b/src/components/AmountTextInput.tsx @@ -83,7 +83,6 @@ function AmountTextInput({ submitBehavior="submit" selection={selection} onSelectionChange={onSelectionChange} - role={CONST.ROLE.PRESENTATION} onKeyPress={onKeyPress as (event: TextInputKeyPressEvent) => void} touchableInputWrapperStyle={touchableInputWrapperStyle} // On iPad, even if the soft keyboard is hidden, the keyboard suggestion is still shown. diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index 8348d0f5323c8..b5ba853f3b98a 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -131,7 +131,7 @@ function Banner({ (isNested ? CONST.ROLE.PRESENTATION : CONST.ROLE.BUTTON); +const getButtonRole: GetButtonRole = () => CONST.ROLE.BUTTON; // eslint-disable-next-line import/prefer-default-export export {getButtonRole}; diff --git a/src/components/DatePicker/CalendarPicker/index.tsx b/src/components/DatePicker/CalendarPicker/index.tsx index b46720c88c829..e0e0faea170a0 100644 --- a/src/components/DatePicker/CalendarPicker/index.tsx +++ b/src/components/DatePicker/CalendarPicker/index.tsx @@ -194,6 +194,7 @@ function CalendarPicker({ disabled={years.length <= 1} testID="currentYearButton" accessibilityLabel={translate('common.currentYear')} + role={CONST.ROLE.BUTTON} > @@ -279,6 +282,7 @@ function CalendarPicker({ tabIndex={day ? 0 : -1} accessible={!!day} dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} + role={CONST.ROLE.BUTTON} > {({hovered, pressed}) => ( ( [ @@ -754,7 +759,7 @@ function MenuItem({ disabled={disabled || isExecuting} ref={mergeRefs(ref, popoverAnchor)} role={role} - accessibilityLabel={title ? title.toString() : ''} + accessibilityLabel={accessibilityLabel ?? defaultAccessibilityLabel} accessible={shouldBeAccessible} tabIndex={tabIndex} onFocus={onFocus} diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index f1929f6321ed3..1e8296815d23b 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -7,6 +7,7 @@ import type {GestureResponderEvent, LayoutChangeEvent, StyleProp, TextStyle, Vie import useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager'; import useKeyboardShortcut from '@hooks/useKeyboardShortcut'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; +import useLocalize from '@hooks/useLocalize'; import usePrevious from '@hooks/usePrevious'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useStyleUtils from '@hooks/useStyleUtils'; @@ -287,6 +288,7 @@ function BasePopoverMenu({ const styles = useThemeStyles(); const theme = useTheme(); const StyleUtils = useStyleUtils(); + const {translate} = useLocalize(); // We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to apply correct popover styles // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth const {isSmallScreenWidth} = useResponsiveLayout(); @@ -344,6 +346,7 @@ function BasePopoverMenu({ const previousMenuItems = getPreviousSubMenu(); const previouslySelectedItem = previousMenuItems[enteredSubMenuIndexes[enteredSubMenuIndexes.length - 1]]; const hasBackButtonText = !!previouslySelectedItem?.backButtonText; + const backButtonTitle = hasBackButtonText ? previouslySelectedItem?.backButtonText : previouslySelectedItem?.text; return ( (isHovered ? theme.iconHovered : theme.icon)} style={hasBackButtonText ? styles.pv0 : undefined} additionalIconStyles={[{width: variables.iconSizeSmall, height: variables.iconSizeSmall}, styles.opacitySemiTransparent, styles.mr1]} - title={hasBackButtonText ? previouslySelectedItem?.backButtonText : previouslySelectedItem?.text} + title={backButtonTitle} + accessibilityLabel={`${translate('common.goBack')}, ${backButtonTitle}`} titleStyle={hasBackButtonText ? styles.createMenuHeaderText : undefined} shouldShowBasicTitle={hasBackButtonText} shouldCheckActionAllowedOnPress={false} diff --git a/src/components/SelectionList/ListItem/BaseListItem.tsx b/src/components/SelectionList/ListItem/BaseListItem.tsx index 787aeea6ccc46..dd216cb160b13 100644 --- a/src/components/SelectionList/ListItem/BaseListItem.tsx +++ b/src/components/SelectionList/ListItem/BaseListItem.tsx @@ -112,7 +112,7 @@ function BaseListItem({ }} disabled={isDisabled && !item.isSelected} interactive={item.isInteractive} - accessibilityLabel={item.accessibilityLabel ?? item.text ?? ''} + accessibilityLabel={item.accessibilityLabel ?? [item.text, item.text !== item.alternateText ? item.alternateText : undefined].filter(Boolean).join(', ')} role={getButtonRole(true)} isNested hoverDimmingValue={1} diff --git a/src/components/SelectionListWithSections/BaseListItem.tsx b/src/components/SelectionListWithSections/BaseListItem.tsx index ea490d7e6c3e1..f02d460e23795 100644 --- a/src/components/SelectionListWithSections/BaseListItem.tsx +++ b/src/components/SelectionListWithSections/BaseListItem.tsx @@ -107,7 +107,7 @@ function BaseListItem({ }} disabled={isDisabled && !item.isSelected} interactive={item.isInteractive} - accessibilityLabel={item.text ?? ''} + accessibilityLabel={[item.text, item.text !== item.alternateText ? item.alternateText : undefined].filter(Boolean).join(', ')} role={getButtonRole(true)} isNested hoverDimmingValue={1} diff --git a/src/languages/de.ts b/src/languages/de.ts index 67e2631356cb9..f93fced6e7141 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -970,7 +970,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Etwas suchen …', buttonMySettings: 'Meine Einstellungen', fabNewChat: 'Chat starten', - fabNewChatExplained: 'Chat starten (Schwebende Aktion)', + fabNewChatExplained: 'Aktionsmenü öffnen', fabScanReceiptExplained: 'Beleg scannen (Schwebende Aktion)', chatPinned: 'Chat angeheftet', draftedMessage: 'Entwurfsnachricht', diff --git a/src/languages/en.ts b/src/languages/en.ts index 2ad9bfc0b43ae..e7aa2907084c9 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -955,8 +955,8 @@ const translations = { buttonFind: 'Find something...', buttonMySettings: 'My settings', fabNewChat: 'Start chat', - fabNewChatExplained: 'Start chat (Floating action)', - fabScanReceiptExplained: 'Scan receipt (Floating action)', + fabNewChatExplained: 'Open actions menu', + fabScanReceiptExplained: 'Scan receipt', chatPinned: 'Chat pinned', draftedMessage: 'Drafted message', listOfChatMessages: 'List of chat messages', diff --git a/src/languages/es.ts b/src/languages/es.ts index c89e1ed8ce5e8..4a567bd6c15d8 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -698,8 +698,8 @@ const translations: TranslationDeepObject = { buttonFind: 'Encuentre algo...', buttonMySettings: 'Mi configuración', fabNewChat: 'Iniciar chat', - fabNewChatExplained: 'Iniciar chat (Acción flotante)', - fabScanReceiptExplained: 'Escanear recibo (Acción flotante)', + fabNewChatExplained: 'Abrir menú de acciones', + fabScanReceiptExplained: 'Escanear recibo', chatPinned: 'Chat fijado', draftedMessage: 'Mensaje borrador', listOfChatMessages: 'Lista de mensajes del chat', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index 34625e563998a..56fb1f775a42e 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -972,7 +972,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Rechercher quelque chose...', buttonMySettings: 'Mes paramètres', fabNewChat: 'Démarrer le chat', - fabNewChatExplained: 'Démarrer le chat (Action flottante)', + fabNewChatExplained: "Ouvrir le menu d'actions", fabScanReceiptExplained: 'Scanner un reçu (Action flottante)', chatPinned: 'Discussion épinglée', draftedMessage: 'Message rédigé', diff --git a/src/languages/it.ts b/src/languages/it.ts index 0a09f60c444ad..bfd2972b9cb8f 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -969,7 +969,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Trova qualcosa...', buttonMySettings: 'Le mie impostazioni', fabNewChat: 'Avvia chat', - fabNewChatExplained: 'Avvia chat (Azione flottante)', + fabNewChatExplained: 'Apri menu azioni', fabScanReceiptExplained: 'Scansiona ricevuta (Azione flottante)', chatPinned: 'Chat fissata', draftedMessage: 'Messaggio in bozza', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 86a0ded9a8a76..ce1a0f2003711 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -968,7 +968,7 @@ const translations: TranslationDeepObject = { buttonFind: '何かを検索…', buttonMySettings: 'マイ設定', fabNewChat: 'チャットを開始', - fabNewChatExplained: 'チャットを開始 (フローティングアクション)', + fabNewChatExplained: 'アクションメニューを開く', fabScanReceiptExplained: '領収書をスキャン', chatPinned: 'ピン留めされたチャット', draftedMessage: '下書きメッセージ', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 5f7d88b92c28e..d499f798575ec 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -969,7 +969,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Zoek iets...', buttonMySettings: 'Mijn instellingen', fabNewChat: 'Chat starten', - fabNewChatExplained: 'Chat starten (zwevende actie)', + fabNewChatExplained: 'Actiemenu openen', fabScanReceiptExplained: 'Bon scannen (Zwevende actie)', chatPinned: 'Chat vastgezet', draftedMessage: 'Conceptbericht', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 354c4a39ad14b..f92c16c60000f 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -969,7 +969,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Znajdź coś...', buttonMySettings: 'Moje ustawienia', fabNewChat: 'Rozpocznij czat', - fabNewChatExplained: 'Rozpocznij czat (Akcja pływająca)', + fabNewChatExplained: 'Otwórz menu akcji', fabScanReceiptExplained: 'Zeskanuj paragon (Akcja pływająca)', chatPinned: 'Czat przypięty', draftedMessage: 'Wiadomość robocza', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index cf2fb5ce0e85f..ef5a3f80584c7 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -968,7 +968,7 @@ const translations: TranslationDeepObject = { buttonFind: 'Encontre algo...', buttonMySettings: 'Minhas configurações', fabNewChat: 'Iniciar chat', - fabNewChatExplained: 'Iniciar chat (Ação flutuante)', + fabNewChatExplained: 'Abrir menu de ações', fabScanReceiptExplained: 'Digitalizar recibo (Ação flutuante)', chatPinned: 'Conversa fixada', draftedMessage: 'Mensagem rascunhada', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index cf90403b8bdf9..b8d1d06c44ab4 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -956,7 +956,7 @@ const translations: TranslationDeepObject = { buttonFind: '查找内容…', buttonMySettings: '我的设置', fabNewChat: '开始聊天', - fabNewChatExplained: '开始聊天(浮动操作)', + fabNewChatExplained: '打开操作菜单', fabScanReceiptExplained: '扫描收据(浮动操作)', chatPinned: '聊天已置顶', draftedMessage: '已起草的消息', diff --git a/src/pages/settings/Security/SecuritySettingsPage.tsx b/src/pages/settings/Security/SecuritySettingsPage.tsx index c90b07039067e..3e4e91133ee0a 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.tsx +++ b/src/pages/settings/Security/SecuritySettingsPage.tsx @@ -385,6 +385,7 @@ function SecuritySettingsPage() { {translate('common.learnMore')} diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index e0b7dbcb658f5..cc082fb5929ee 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -206,7 +206,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) { { if (isDisablingOrDeletingLastEnabledCategory(policy, policyCategories, [value])) { setIsCannotDeleteOrDisableLastCategoryModalVisible(true); @@ -222,7 +222,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) { { if (isDisablingOrDeletingLastEnabledCategory(policy, policyCategories, [value])) { setIsCannotDeleteOrDisableLastCategoryModalVisible(true); diff --git a/src/pages/workspace/reports/WorkspaceReportsPage.tsx b/src/pages/workspace/reports/WorkspaceReportsPage.tsx index 373f192819e61..a4a2a3d7bacff 100644 --- a/src/pages/workspace/reports/WorkspaceReportsPage.tsx +++ b/src/pages/workspace/reports/WorkspaceReportsPage.tsx @@ -1,7 +1,7 @@ import {FlashList} from '@shopify/flash-list'; import type {ListRenderItemInfo} from '@shopify/flash-list'; import {Str} from 'expensify-common'; -import React, {useEffect, useState} from 'react'; +import React, {useEffect, useMemo, useState} from 'react'; import {View} from 'react-native'; import ActivityIndicator from '@components/ActivityIndicator'; import ConfirmModal from '@components/ConfirmModal'; @@ -162,6 +162,13 @@ function WorkspaceReportFieldsPage({ ); + const reportFieldsAccessibilityLabel = useMemo(() => { + if (!hasSyncError && isConnectionVerified && currentConnectionName) { + return `${translate('workspace.common.reportFields')}, ${translate('workspace.reportFields.importedFromAccountingSoftware')} ${currentConnectionName} ${translate('workspace.accounting.settings')}`; + } + return `${translate('workspace.common.reportFields')}, ${translate('workspace.reportFields.subtitle')}`; + }, [hasSyncError, isConnectionVerified, currentConnectionName, translate]); + return ( { shouldAnimateAccordionSection.set(true); onToggle(isOn);