feat(iOS): set AccessibilityLanguage for correct accent#6493
feat(iOS): set AccessibilityLanguage for correct accent#6493diegolmello merged 32 commits intodevelopfrom
Conversation
|
Android Build Available Rocket.Chat Experimental 4.63.0.93294 |
|
iOS Build Available Rocket.Chat Experimental 4.63.0.87852 |
WalkthroughAdds accessibility wrappers and language attributes to message rendering, forwards an optional autoTranslateLanguage prop, introduces a translationLanguages mapping, and adds a localized "Message_translated_into_idiom" key across many locale files. Changes
Sequence Diagram(s)sequenceDiagram
participant Container as MessageContainer
participant Message as Message
participant LangMap as translationLanguages
participant A11y as A11y wrappers
participant SR as ScreenReader
Container->>Message: render(..., autoTranslateLanguage)
alt autoTranslateLanguage present
Message->>LangMap: lookup(autoTranslateLanguage)
LangMap-->>Message: languageName
Message->>A11y: wrap(messageContent, label includes languageName, set accessibilityLanguage)
else no autoTranslateLanguage
Message->>A11y: wrap(messageContent, default labels)
end
A11y->>SR: expose label & language attribute
Note right of SR `#D6EAF8`: Screen reader reads using provided language attribute
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)app/containers/message/Message.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
app/containers/message/Message.tsx(5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/containers/message/Message.tsx (1)
app/lib/database/model/Message.js (1)
Message(8-134)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: ESLint and Test / run-eslint-and-test
- GitHub Check: format
🔇 Additional comments (2)
app/containers/message/Message.tsx (2)
4-4: LGTM: Imports are appropriate for the accessibility enhancements.The
react-native-a11y-orderdependency is declared in package.json (v0.4.0), and thetranslationLanguagesconstant provides the language mapping needed for translated message announcements.Also applies to: 29-29
229-241: LGTM: A11y.Order wrapper correctly establishes reading sequence.The
A11y.OrderandA11y.Indexstructure properly organizes the focus order:
- Index 1: Touchable interaction wrapper
- Index 2: Message content (inside
Messagecomponent)This ensures screen readers traverse the message in the intended sequence.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
app/containers/message/__snapshots__/Message.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (26)
app/containers/message/Message.tsx(5 hunks)app/i18n/locales/ar.json(1 hunks)app/i18n/locales/bn-IN.json(1 hunks)app/i18n/locales/cs.json(1 hunks)app/i18n/locales/de.json(1 hunks)app/i18n/locales/en.json(1 hunks)app/i18n/locales/es.json(1 hunks)app/i18n/locales/fi.json(1 hunks)app/i18n/locales/fr.json(1 hunks)app/i18n/locales/hi-IN.json(1 hunks)app/i18n/locales/hu.json(1 hunks)app/i18n/locales/it.json(1 hunks)app/i18n/locales/ja.json(1 hunks)app/i18n/locales/nl.json(1 hunks)app/i18n/locales/nn.json(1 hunks)app/i18n/locales/no.json(1 hunks)app/i18n/locales/pt-BR.json(1 hunks)app/i18n/locales/pt-PT.json(1 hunks)app/i18n/locales/ru.json(1 hunks)app/i18n/locales/sl-SI.json(1 hunks)app/i18n/locales/sv.json(1 hunks)app/i18n/locales/ta-IN.json(1 hunks)app/i18n/locales/te-IN.json(1 hunks)app/i18n/locales/tr.json(1 hunks)app/i18n/locales/zh-CN.json(1 hunks)app/i18n/locales/zh-TW.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
- app/i18n/locales/zh-CN.json
- app/i18n/locales/sv.json
- app/i18n/locales/hu.json
- app/i18n/locales/de.json
- app/i18n/locales/te-IN.json
- app/i18n/locales/pt-PT.json
- app/i18n/locales/it.json
- app/i18n/locales/hi-IN.json
- app/i18n/locales/sl-SI.json
- app/i18n/locales/ru.json
- app/i18n/locales/ar.json
- app/i18n/locales/tr.json
- app/i18n/locales/ta-IN.json
- app/i18n/locales/no.json
- app/i18n/locales/pt-BR.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: ESLint and Test / run-eslint-and-test
- GitHub Check: format
🔇 Additional comments (5)
app/i18n/locales/fr.json (1)
407-407: Translation and formatting look good.The new French localization for accessibility messages is properly formatted, alphabetically positioned, and uses the template variable pattern correctly. This entry will enable correct screen reader pronunciation for translated messages on iOS.
app/i18n/locales/nn.json (1)
229-229: Localization key properly added.The new key
Message_translated_into_idiomwith value "Melding omsett til {{idiom}}" is correctly formatted, alphabetically positioned, and provides an accurate Norwegian Nynorsk translation for the accessibility feature. The placeholder follows established patterns in the file.app/i18n/locales/nl.json (1)
407-407: Localization key properly formatted and positioned.The new
Message_translated_into_idiomkey follows existing naming conventions, uses correct Dutch translation, and the template variable{{idiom}}aligns with the PR's translationLanguages mapping. JSON syntax is correct with proper comma placement.app/i18n/locales/en.json (1)
526-526: Verify placeholder variable name consistency.The new localization key uses
{{idiom}}as the placeholder, but in translation contexts, "idiom" typically refers to figurative expressions rather than languages. Given the PR's use ofautoTranslateLanguageandtranslationLanguagesterminology elsewhere, consider whether the placeholder should be{{language}}or similar for semantic clarity.To confirm alignment, please verify:
- What variable name the component passes to this localization key when rendering translated messages
- Whether other new localization keys in this PR use consistent terminology
- If "idiom" is an intentional choice to distinguish from the app's language settings
app/i18n/locales/zh-TW.json (1)
345-345: Translation addition is complete and properly integrated.The zh-TW locale key at line 345 is correctly implemented with full end-to-end support:
- translationLanguages mapping: Confirmed in
app/lib/constants/translationLanguages.tswith'zh-TW': 'Chinese (Traditional)'providing values for the{{idiom}}placeholder- Message component integration:
app/containers/message/Message.tsx(line 151) uses the key withi18n.t('Message_translated_into_idiom', { idiom: translatedLanguage }), properly passing the language name from the constant- Screen reader accessibility: The message is used in the accessibility label context for screen reader announcements (lines 148-154)
- Locale consistency: The translation exists across all supported locales with consistent formatting
No additional action needed.
Proposed changes
Enable Screen reader reads translated message with the right accent.
Issue(s)
https://rocketchat.atlassian.net/browse/MA-175
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
New Features
Accessibility
✏️ Tip: You can customize this high-level summary in your review settings.