Skip to content

Commit

Permalink
chore: add accessibilityLabel to language radio button for state (#1384)
Browse files Browse the repository at this point in the history
Signed-off-by: fc-santos <[email protected]>
  • Loading branch information
fc-santos authored Jan 10, 2025
1 parent 08e12a6 commit 5b9b85e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/legacy/core/App/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const translation = {
"code_en": "English",
"code_fr": "French",
"code_pt-BR": "Portuguese",
"Checked": "checked",
"NotChecked": "not checked",
},
"Error": {
"ReportThisProblem": "Report this problem",
Expand Down
2 changes: 2 additions & 0 deletions packages/legacy/core/App/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const translation = {
"code_en": "Anglais",
"code_fr": "Français",
"code_pt-BR": "Portugais",
"Checked": "coché",
"NotChecked": "non coché",
},
"Error": {
"ReportThisProblem": "Signaler ce problème",
Expand Down
2 changes: 2 additions & 0 deletions packages/legacy/core/App/localization/pt-br/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ const translation = {
"code_en": "Inglês",
"code_fr": "Francês",
"code_pt-BR": "Português",
"Checked": "selecionado",
"NotChecked": "não selecionado",
},
"Error": {
"ReportThisProblem": "Reportar este problema",
Expand Down
5 changes: 2 additions & 3 deletions packages/legacy/core/App/screens/Language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Language {
}

const Language = () => {
const { i18n } = useTranslation()
const { t, i18n } = useTranslation()
const { ColorPallet, TextTheme, SettingsTheme } = useTheme()
const [{ supportedLanguages }] = useServices([TOKENS.CONFIG])

Expand Down Expand Up @@ -67,9 +67,8 @@ const Language = () => {
<View style={[styles.section, styles.sectionRow]}>
<Text style={TextTheme.title}>{value}</Text>
<BouncyCheckbox
accessibilityLabel={''} // To avoid Voice Over reading the value twice (one time from the text component and another time from the BouncyCheckbox component)
accessibilityLabel={`${id === i18n.language ? t('Language.Checked') : t('Language.NotChecked')}`} // add on voice over the text checked / not checked after the text from value above
accessibilityRole="radio"
accessibilityState={{ checked: id === i18n.language }}
disableText
fillColor={ColorPallet.brand.secondaryBackground}
unfillColor={ColorPallet.brand.secondaryBackground}
Expand Down

0 comments on commit 5b9b85e

Please sign in to comment.