Skip to content

Commit 1f45459

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Localize Voiceover strings in Fabric (#37679)
Summary: Pull Request resolved: #37679 This reuses the localizations from the last diff on the stack, on top of the new logic added with D45797554. Changelog: [iOS][Fixed] - Localize Voiceover strings in Fabric Reviewed By: philIip Differential Revision: D46426571 fbshipit-source-id: 7e6adc9eff5e6387299e95b6ea5eba8e2607386a
1 parent 0e99b19 commit 1f45459

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#import <React/RCTAssert.h>
1515
#import <React/RCTBorderDrawing.h>
1616
#import <React/RCTConversions.h>
17+
#import <React/RCTLocalizedString.h>
1718
#import <react/renderer/components/view/ViewComponentDescriptor.h>
1819
#import <react/renderer/components/view/ViewEventEmitter.h>
1920
#import <react/renderer/components/view/ViewProps.h>
@@ -731,28 +732,38 @@ - (NSString *)accessibilityValue
731732
// these to screenreader users. (They should already be familiar with them
732733
// from using web).
733734
if ([roleString isEqualToString:@"checkbox"]) {
734-
[valueComponents addObject:@"checkbox"];
735+
[valueComponents addObject:RCTLocalizedString("checkbox", "checkable interactive control")];
735736
}
736737

737738
if ([roleString isEqualToString:@"radio"]) {
738-
[valueComponents addObject:@"radio button"];
739+
[valueComponents
740+
addObject:
741+
RCTLocalizedString(
742+
"radio button",
743+
"a checkable input that when associated with other radio buttons, only one of which can be checked at a time")];
739744
}
740745

741746
// Handle states which haven't already been handled.
742747
if (props.accessibilityState.checked == AccessibilityState::Checked) {
743-
[valueComponents addObject:@"checked"];
748+
[valueComponents
749+
addObject:RCTLocalizedString("checked", "a checkbox, radio button, or other widget which is checked")];
744750
}
745751
if (props.accessibilityState.checked == AccessibilityState::Unchecked) {
746-
[valueComponents addObject:@"unchecked"];
752+
[valueComponents
753+
addObject:RCTLocalizedString("unchecked", "a checkbox, radio button, or other widget which is unchecked")];
747754
}
748755
if (props.accessibilityState.checked == AccessibilityState::Mixed) {
749-
[valueComponents addObject:@"mixed"];
756+
[valueComponents
757+
addObject:RCTLocalizedString(
758+
"mixed", "a checkbox, radio button, or other widget which is both checked and unchecked")];
750759
}
751760
if (props.accessibilityState.expanded) {
752-
[valueComponents addObject:@"expanded"];
761+
[valueComponents
762+
addObject:RCTLocalizedString("expanded", "a menu, dialog, accordian panel, or other widget which is expanded")];
753763
}
764+
754765
if (props.accessibilityState.busy) {
755-
[valueComponents addObject:@"busy"];
766+
[valueComponents addObject:RCTLocalizedString("busy", "an element currently being updated or modified")];
756767
}
757768

758769
if (valueComponents.count > 0) {

0 commit comments

Comments
 (0)