React Native Assignment– 9
Accessibility & Internationalization
Basic Questions
- Mark a tappable View as accessible by adding accessible and accessibilityRole=”button”; verify it’s focusable with a screen reader.
- Add accessibilityLabel=”Submit order” to a Pressable and confirm VoiceOver/TalkBack reads the label instead of raw text.
- Provide accessibilityHint=”Sends your order for processing” to the same control and validate the hint is announced.
- Tag a decorative image with accessibilityIgnoresInvertColors and accessible={false}; confirm it’s skipped by screen readers.
- Add accessibilityRole=”image” and a descriptive accessibilityLabel to a product image that conveys meaning.
- Enhance a TextInput with accessibilityLabel=”Email address” and accessibilityHint=”Required”; verify announcement.
- Group related elements (icon + text) into one accessible element (accessible wrapper) so they read as a single control.
- Set importantForAccessibility=”no-hide-descendants” on a hidden modal backdrop to remove it from the accessibility tree.
- Create a header Text with accessibilityRole=”header”; ensure rotor/quick nav jumps to it.
- Build a small form (name, email, submit) and ensure each field has clear labels and hints.
Intermediate Questions
- Enable VoiceOver (iOS) and record a short video demonstrating correct reading order on your form screen.
- Enable TalkBack (Android) and fix any incorrect focus order using importantForAccessibility on specific elements.
- Add accessibilityState={{ disabled: true }} to a disabled button and confirm readers announce “dimmed/disabled”.
- Implement accessibilityLiveRegion=”polite” for a cart total Text that updates after adding an item; verify the update is announced.
- Programmatically set screen reader focus to an error Text using AccessibilityInfo.setAccessibilityFocus(ref) after a failed submit.
- Provide auditory feedback: play a short sound (e.g., via Expo AV or Sound module) when a critical action completes; ensure it doesn’t block announcements.
- Build a custom AccessibleButton component that always applies accessibilityRole, Label, Hint, and State from props.
- Create a carousel and ensure only the active slide is accessible, others use no-hide-descendants.
- For a list item with dynamic badge counts, expose accessibilityLabel like “Messages, 5 new”; update via accessibilityLiveRegion on change.
- Add accessibilityActions (e.g., “activate”, “longpress”) to a card and handle them in onAccessibilityAction.
- Install and configure i18next (or react-native-i18n) with react-native-localize; create locales/en.json and locales/fr.json.
- Detect device locale and load translations; show a translatable “Hello, {{name}}” string with interpolation.
- Implement fallback language: if de is requested and missing, fall back to en.
- Move all user-facing strings from one screen into translation keys and replace hard-coded text.
- Format a date and a currency value using Intl.DateTimeFormat and Intl.NumberFormat; render both per locale.
- Add a language switcher (EN/FR) and hot-swap translations at runtime without app reload.
- Use pluralization in i18n (e.g., “1 item” vs “{{count}} items”) and verify correct forms.
- Add direction-aware styles: if RTL, swap paddings/margins for a list item row.
- Integrate I18nManager.forceRTL(true) in a dev-only toggle and remount the app to test mirrored layout.
- Ensure icons/chevrons flip correctly in RTL using transform: [{ scaleX: isRTL ? -1 : 1 }].
Advanced Questions
- Build an error summary banner that appears after form submit, receives keyboard focus, and lists field errors with anchors; use AccessibilityInfo.announceForAccessibility to announce “Form errors found”.
- Create a live region (“Downloading… 30%”) with throttled announcements so screen readers aren’t spammed; switch to “Download complete” at 100%.
- Implement custom navigation order on a complex screen: set importantForAccessibility and accessibilityElementsHidden to ensure logical traversal.
- Build an accessible modal: trap focus inside, hide background from accessibility tree, add proper roles/labels, and restore focus to the triggering control on close.
- Create a reusable withA11y HOC or hook (useA11yControl) that standardizes roles, labels, hints, and state across buttons/inputs; apply it to three components.
- Add locale-specific formatting for a checkout screen (dates, times, numbers, currencies) and verify with EN/FR/AR; ensure AR uses RTL and mirrored UI.
- Implement dynamic content with nested translations (e.g., “Pay {{amount}} by {{date}}”) and ensure Intl respects locale numerals (e.g., Arabic digits).
- Localize accessibility labels and hints too (not just visible text); confirm screen readers speak the localized strings.
- Build a feature-flagged RTL demo: toggle RTL at runtime, re-calc layout metrics, flip icons, and maintain scroll positions without jank.
- Final Hands-on Project:
- Convert a multi-screen mini-app to be fully accessible (labels, hints, roles, states, focus management, live regions)
- Support EN/FR + one RTL locale (e.g., AR) with live language switching and correct formatting for dates/currency
- Ensure proper screen reader order on iOS/Android, accessible modal, and accessible lists with dynamic badges
- Provide a test checklist (VoiceOver/TalkBack steps) and record short demos proving conformance (focus order, announcements, RTL mirroring).