diff --git a/src/components/Pressable/PressableWithDelayToggle.tsx b/src/components/Pressable/PressableWithDelayToggle.tsx index bb7d1759ba3f2..e630688391372 100644 --- a/src/components/Pressable/PressableWithDelayToggle.tsx +++ b/src/components/Pressable/PressableWithDelayToggle.tsx @@ -67,6 +67,9 @@ type PressableWithDelayToggleProps = PressableProps & { /** Icon height */ iconHeight?: number; + + /** Custom accessibility label that overrides the tooltipText-based label for both states */ + accessibilityLabel?: string; }; function PressableWithDelayToggle({ @@ -83,11 +86,12 @@ function PressableWithDelayToggle({ icon, ref, accessibilityRole = CONST.ROLE.BUTTON, + sentryLabel, shouldHaveActiveBackground, iconWidth = variables.iconSizeSmall, iconHeight = variables.iconSizeSmall, shouldUseButtonBackground = false, - sentryLabel, + accessibilityLabel: accessibilityLabelProp, }: PressableWithDelayToggleProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -108,8 +112,8 @@ function PressableWithDelayToggle({ // of a Pressable const PressableView = inline ? Text : PressableWithoutFeedback; const tooltipTexts = !isActive ? tooltipTextChecked : tooltipText; - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Fallback to visible text when tooltip is empty for screen readers - const processedAccessibilityLabel = tooltipTexts || (!isActive && textChecked ? textChecked : text) || ''; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Using || intentionally so empty string tooltip/text values fall through to the next fallback + const accessibilityLabel = accessibilityLabelProp || (!isActive ? tooltipTextChecked || textChecked : tooltipText || text) || text || ''; const shouldShowIcon = !!icon || (!isActive && !!resolvedIconChecked); const labelText = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Disabling this line for safeness as nullish coalescing works only if the value is undefined or null @@ -133,7 +137,7 @@ function PressableWithDelayToggle({ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment ref={ref as any} onPress={updatePressState} - accessibilityLabel={processedAccessibilityLabel} + accessibilityLabel={accessibilityLabel} suppressHighlighting={inline ? true : undefined} accessibilityRole={accessibilityRole} > diff --git a/src/languages/de.ts b/src/languages/de.ts index 86848d06001d8..77d48f1d5c4a1 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -2080,6 +2080,7 @@ const translations: TranslationDeepObject = { scanCode: 'Scanne den QR-Code mit deinem', authenticatorApp: 'Authentifizierungs-App', addKey: 'Oder füge diesen geheimen Schlüssel zu deiner Authentifizierungs-App hinzu:', + secretKey: 'geheimer Schlüssel', enterCode: 'Gib dann den sechsstelligen Code ein, der von deiner Authentifizierungs-App generiert wurde.', stepSuccess: 'Fertig', enabled: 'Zwei-Faktor-Authentifizierung aktiviert', diff --git a/src/languages/en.ts b/src/languages/en.ts index 861a1d0c6d25e..10572ed7654ca 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2123,6 +2123,7 @@ const translations = { scanCode: 'Scan the QR code using your', authenticatorApp: 'authenticator app', addKey: 'Or add this secret key to your authenticator app:', + secretKey: 'secret key', enterCode: 'Then enter the six-digit code generated from your authenticator app.', stepSuccess: 'Finished', enabled: 'Two-factor authentication enabled', diff --git a/src/languages/es.ts b/src/languages/es.ts index c5ad487e05b2a..8cb12051ca9d0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1947,6 +1947,7 @@ const translations: TranslationDeepObject = { scanCode: 'Escanea el código QR usando tu', authenticatorApp: 'aplicación de autenticación', addKey: 'O añade esta clave secreta a tu aplicación de autenticación:', + secretKey: 'clave secreta', enterCode: 'Luego introduce el código de seis dígitos generado por tu aplicación de autenticación.', stepSuccess: 'Finalizado', enabled: 'La autenticación de dos factores habilitada', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index d59681c811c2a..598a4ba2d2948 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -2087,6 +2087,7 @@ const translations: TranslationDeepObject = { authenticatorApp: 'application d’authentification', addKey: 'Ou ajoutez cette clé secrète à votre application d’authentification :', enterCode: 'Saisissez ensuite le code à six chiffres généré par votre application d’authentification.', + secretKey: 'clé secrète', stepSuccess: 'Terminé', enabled: 'Authentification à deux facteurs activée', congrats: 'Félicitations ! Vous bénéficiez désormais de cette sécurité supplémentaire.', diff --git a/src/languages/it.ts b/src/languages/it.ts index d70dfafb4ee0a..c45b87bc6e953 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -2077,6 +2077,7 @@ const translations: TranslationDeepObject = { scanCode: 'Scansiona il codice QR usando il tuo', authenticatorApp: 'app di autenticazione', addKey: 'Oppure aggiungi questa chiave segreta alla tua app di autenticazione:', + secretKey: 'chiave segreta', enterCode: 'Quindi inserisci il codice a sei cifre generato dalla tua app di autenticazione.', stepSuccess: 'Completato', enabled: 'Autenticazione a due fattori abilitata', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index b1708b38bbd67..71e7d9c67d9fa 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -2064,6 +2064,7 @@ const translations: TranslationDeepObject = { scanCode: '次の端末でQRコードをスキャンしてください:', authenticatorApp: '認証アプリ', addKey: 'または、この秘密キーを認証アプリに追加してください:', + secretKey: '秘密キー', enterCode: '次に、認証アプリで生成された6桁のコードを入力してください。', stepSuccess: '完了', enabled: '2要素認証が有効になりました', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 7de90468cf30c..cb4452c17a1d7 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -2074,6 +2074,7 @@ const translations: TranslationDeepObject = { scanCode: 'Scan de QR-code met je', authenticatorApp: 'authenticator-app', addKey: 'Of voeg deze geheime sleutel toe aan je authenticator-app:', + secretKey: 'geheime sleutel', enterCode: 'Voer vervolgens de zescijferige code in die is gegenereerd door je authenticator-app.', stepSuccess: 'Voltooid', enabled: 'Authenticatie in twee stappen ingeschakeld', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index eeb3fcacf9581..8c67ed2df379e 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -2074,6 +2074,7 @@ const translations: TranslationDeepObject = { scanCode: 'Zeskanuj kod QR za pomocą swojego', authenticatorApp: 'aplikacja uwierzytelniająca', addKey: 'Lub dodaj ten tajny klucz do swojej aplikacji uwierzytelniającej:', + secretKey: 'tajny klucz', enterCode: 'Następnie wprowadź sześciocyfrowy kod wygenerowany przez aplikację uwierzytelniającą.', stepSuccess: 'Zakończono', enabled: 'Włączono uwierzytelnianie dwuskładnikowe', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 62fbef1178f50..69cdea209e08e 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -2070,6 +2070,7 @@ const translations: TranslationDeepObject = { scanCode: 'Escaneie o código QR usando seu', authenticatorApp: 'aplicativo autenticador', addKey: 'Ou adicione esta chave secreta ao seu app autenticador:', + secretKey: 'chave secreta', enterCode: 'Em seguida, insira o código de seis dígitos gerado pelo seu app autenticador.', stepSuccess: 'Concluído', enabled: 'Autenticação em duas etapas ativada', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index b3f9b0391dfab..1e6ac56947347 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -2036,6 +2036,7 @@ const translations: TranslationDeepObject = { scanCode: '使用你的 扫描二维码', authenticatorApp: '身份验证器应用', addKey: '或者将此密钥添加到你的验证器应用:', + secretKey: '密钥', enterCode: '然后输入您的身份验证器应用生成的六位数字代码。', stepSuccess: '已完成', enabled: '已启用双重身份验证', diff --git a/src/pages/settings/Security/TwoFactorAuth/CopyCodesPage.tsx b/src/pages/settings/Security/TwoFactorAuth/CopyCodesPage.tsx index 00f75149eb649..41113767f1ae0 100644 --- a/src/pages/settings/Security/TwoFactorAuth/CopyCodesPage.tsx +++ b/src/pages/settings/Security/TwoFactorAuth/CopyCodesPage.tsx @@ -125,7 +125,7 @@ function CopyCodesPage({route}: TwoFactorAuthPageProps) { textStyles={[styles.buttonMediumText]} tooltipText="" tooltipTextChecked="" - accessibilityLabel={translate('twoFactorAuth.copy')} + accessibilityLabel={`${translate('twoFactorAuth.copy')}, ${translate('twoFactorAuth.stepCodes')}`} sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.COPY_CODES} /> diff --git a/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx b/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx index 5a301caefa40d..51586a608b9ec 100644 --- a/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx +++ b/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx @@ -125,12 +125,12 @@ function VerifyPage({route}: VerifyPageProps) { textChecked={translate('common.copied')} tooltipText="" tooltipTextChecked="" + accessibilityLabel={`${translate('twoFactorAuth.copy')}, ${translate('twoFactorAuth.secretKey')}`} icon={icons.Copy} inline={false} onPress={() => Clipboard.setString(account?.twoFactorAuthSecretKey ?? '')} styles={[styles.button, styles.buttonMedium, styles.twoFactorAuthCopyCodeButton]} textStyles={[styles.buttonMediumText]} - accessibilityLabel={translate('twoFactorAuth.copy')} sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.COPY} /> diff --git a/src/pages/settings/Subscription/SubscriptionPlan/SaveWithExpensifyButton/index.tsx b/src/pages/settings/Subscription/SubscriptionPlan/SaveWithExpensifyButton/index.tsx index 7a015ab7dca6c..a236ea39d80f9 100644 --- a/src/pages/settings/Subscription/SubscriptionPlan/SaveWithExpensifyButton/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionPlan/SaveWithExpensifyButton/index.tsx @@ -15,6 +15,7 @@ function SaveWithExpensifyButton() {