Skip to content

Commit fda1a41

Browse files
authored
fix: add separate translation for tab bar accessibility (#1815)
Signed-off-by: Christian <christian.lippa@ontario.ca>
1 parent 49389b9 commit fda1a41

5 files changed

Lines changed: 23 additions & 3 deletions

File tree

.changeset/eager-states-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@bifold/core': patch
3+
---
4+
5+
Add separate accessibility label for tab bar buttons

packages/core/src/localization/en/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,11 @@
810810
"Scan": "Scan",
811811
"Credentials": "Credentials"
812812
},
813+
"TabStackAccessibility": {
814+
"Home": "Notifications tab {{notifications}} notifications",
815+
"Scan": "Scan tab",
816+
"Credentials": "Credentials tab"
817+
},
813818
"RootStack": {
814819
"Contacts": "Contacts",
815820
"Settings": "Settings"

packages/core/src/localization/fr/fr.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,11 @@
803803
"Scan": "Numériser",
804804
"Credentials": "Justificatifs"
805805
},
806+
"TabStackAccessibility": {
807+
"Home": "Notifications tab {{notifications}} notifications (FR)",
808+
"Scan": "Scan tab (FR)",
809+
"Credentials": "Credentials tab (FR)"
810+
},
806811
"RootStack": {
807812
"Contacts": "Contacts",
808813
"Settings": "Paramètres"

packages/core/src/localization/pt-br/pt-br.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,11 @@
779779
"Scan": "Scanear",
780780
"Credentials": "Credenciais"
781781
},
782+
"TabStackAccessibility": {
783+
"Home": "Notifications tab {{notifications}} notifications (PT-BR)",
784+
"Scan": "Scan tab (PT-BR)",
785+
"Credentials": "Credentials tab (PT-BR)"
786+
},
782787
"RootStack": {
783788
"Contacts": "Contatos",
784789
"Settings": "Configurações"

packages/core/src/navigators/TabStack.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const TabStack: React.FC = () => {
174174
</AttachTourStep>
175175
),
176176
tabBarShowLabel: false,
177-
tabBarAccessibilityLabel: `${t('TabStack.Home')} (${notifications.length ?? 0})`,
177+
tabBarAccessibilityLabel: t('TabStackAccessibility.Home', { notifications: notifications?.length ?? 0 }),
178178
tabBarTestID: testIdWithKey(t('TabStack.Home')),
179179
tabBarBadge: notifications.length || undefined,
180180
tabBarBadgeStyle: {
@@ -248,7 +248,7 @@ const TabStack: React.FC = () => {
248248
</View>
249249
),
250250
tabBarShowLabel: false,
251-
tabBarAccessibilityLabel: t('TabStack.Scan'),
251+
tabBarAccessibilityLabel: t('TabStackAccessibility.Scan'),
252252
tabBarTestID: testIdWithKey(t('TabStack.Scan')),
253253
}}
254254
listeners={({ navigation }) => ({
@@ -291,7 +291,7 @@ const TabStack: React.FC = () => {
291291
</AttachTourStep>
292292
),
293293
tabBarShowLabel: false,
294-
tabBarAccessibilityLabel: t('TabStack.Credentials'),
294+
tabBarAccessibilityLabel: t('TabStackAccessibility.Credentials'),
295295
tabBarTestID: testIdWithKey(t('TabStack.Credentials')),
296296
}}
297297
/>

0 commit comments

Comments
 (0)