From af55e0acef9ba23d6a5ef8de953dcd0dedc3c6b7 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 15 Oct 2026 03:17:07 +0200 Subject: [PATCH] fix: name every format button for screen readers --- locales/rn/de.json | 4 ++++ locales/rn/en.json | 4 +++- src/screens/ComposeScreen.tsx | 24 +++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/locales/rn/de.json b/locales/rn/de.json index fb672bc5..f6698d8c 100644 --- a/locales/rn/de.json +++ b/locales/rn/de.json @@ -312,6 +312,10 @@ "send_now": "Jetzt senden", "send_timeout_body": "Die Nachricht wurde möglicherweise bereits versendet. Prüfen Sie Ihren Gesendet-Ordner, bevor Sie sie erneut senden.", "send_timeout_title": "Keine Antwort vom Server", + "toolbar": { + "insert_image": "Bild einfügen", + "remove_link": "Link entfernen" + }, "undo_send_label": "Senden in {seconds} s…", "upload_failed_short": "Upload fehlgeschlagen", "uploading": "Wird hochgeladen...", diff --git a/locales/rn/en.json b/locales/rn/en.json index bcddeee6..88a118da 100644 --- a/locales/rn/en.json +++ b/locales/rn/en.json @@ -323,7 +323,9 @@ "send_timeout_title": "No answer from the server", "toolbar": { "background_color": "Background color", - "remove_background_color": "Remove background color" + "insert_image": "Insert image", + "remove_background_color": "Remove background color", + "remove_link": "Remove link" }, "undo_send_label": "Sending in {seconds}s…", "upload_failed_short": "Upload failed", diff --git a/src/screens/ComposeScreen.tsx b/src/screens/ComposeScreen.tsx index caeef0e0..e64c461c 100644 --- a/src/screens/ComposeScreen.tsx +++ b/src/screens/ComposeScreen.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { View, Text, StyleSheet, TextInput, Pressable, ScrollView, - Keyboard, Dimensions, Platform, ActivityIndicator, Alert, Modal, Switch, + Keyboard, Platform, ActivityIndicator, Alert, Modal, Switch, } from 'react-native'; import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'; import { usePreventRemove } from '@react-navigation/native'; @@ -341,7 +341,9 @@ function ToolbarButton({ onPress={onPress} hitSlop={4} disabled={disabled} + accessibilityRole="button" accessibilityLabel={label} + accessibilityState={{ selected: !!active, disabled: !!disabled }} style={[styles.formatBtn, active && styles.formatBtnActive, disabled && styles.formatBtnDisabled]} > {icon} @@ -2463,8 +2465,10 @@ export default function ComposeScreen({ route, navigation }: Props) { keyboardShouldPersistTaps="always" > setTemplateSheetOpen(true)} + label={t('email_composer.use_template', 'Template')} icon={} /> setRequestReadReceipt((v) => !v)} + label={t('email_composer.read_receipt_off', 'Request a read receipt')} icon={} /> { void togglePlainTextMode(); }} label={plainTextMode @@ -2477,12 +2481,16 @@ export default function ComposeScreen({ route, navigation }: Props) { editorRef.current?.exec('bold')} + label={t('email_composer.toolbar.bold', 'Bold')} icon={} /> editorRef.current?.exec('italic')} + label={t('email_composer.toolbar.italic', 'Italic')} icon={} /> editorRef.current?.exec('underline')} + label={t('email_composer.toolbar.underline', 'Underline')} icon={} /> editorRef.current?.exec('strikeThrough')} + label={t('email_composer.toolbar.strikethrough', 'Strikethrough')} icon={} /> setColorTarget('text')} label={t('email_composer.toolbar.text_color', 'Text color')} @@ -2494,46 +2502,60 @@ export default function ComposeScreen({ route, navigation }: Props) { editorRef.current?.exec('formatBlock:H1')} + label={t('email_composer.toolbar.heading_1', 'Heading 1')} icon={} /> editorRef.current?.exec('formatBlock:H2')} + label={t('email_composer.toolbar.heading_2', 'Heading 2')} icon={} /> editorRef.current?.exec('insertUnorderedList')} + label={t('email_composer.toolbar.bullet_list', 'Bullet list')} icon={} /> editorRef.current?.exec('insertOrderedList')} + label={t('email_composer.toolbar.ordered_list', 'Ordered list')} icon={} /> editorRef.current?.exec('formatBlock:BLOCKQUOTE')} + label={t('email_composer.toolbar.quote', 'Quote')} icon={} /> setTableMenuOpen(true)} + label={t('email_composer.toolbar.table', 'Table')} icon={} /> editorRef.current?.exec('justifyLeft')} + label={t('email_composer.toolbar.align_left', 'Align left')} icon={} /> editorRef.current?.exec('justifyCenter')} + label={t('email_composer.toolbar.align_center', 'Align center')} icon={} /> editorRef.current?.exec('justifyRight')} + label={t('email_composer.toolbar.align_right', 'Align right')} icon={} /> : } /> { void insertInlineImage(); }} + label={t('email_composer.toolbar.insert_image', 'Insert image')} icon={} /> editorRef.current?.exec('removeFormat')} + label={t('email_composer.toolbar.clear_formatting', 'Clear formatting')} icon={} /> editorRef.current?.exec('undo')} + label={t('email_composer.toolbar.undo', 'Undo')} icon={} /> editorRef.current?.exec('redo')} + label={t('email_composer.toolbar.redo', 'Redo')} icon={} /> )}