Skip to content

Commit

Permalink
Reword the guide words
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Internal] - Reword the guide words to make it more generic.

Considering the case that some languages are RTL so swiping right cannot guarantee to move to the link. iOS can handle the order of the words and accessibilityElements according to the language. But the accessibilityHint we hardcoded would be an issue. So we decided to reword it to be more generic.

Reviewed By: PeteTheHeat

Differential Revision: D22422498

fbshipit-source-id: 175711317961663d0b0b47e04d2ab600f63446fe
  • Loading branch information
ZHUANGPP authored and facebook-github-bot committed Jul 14, 2020
1 parent 550c66e commit 4320359
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,18 @@ - (instancetype)initWithString:(facebook::react::AttributedString)attributedStri
}

if (numberOfLinks > 0 && numberOfButtons > 0) {
firstElement.accessibilityHint = @"Links and buttons are found, swipe right to move to them.";
firstElement.accessibilityHint = @"Links and buttons are found, swipe to move to them.";

} else if (numberOfLinks > 0) {
NSString *firstElementHint = (numberOfLinks == 1)
? @"One link found, swipe right to move to the link."
: [NSString stringWithFormat:@"%ld links found, swipe right to move to the first link.", (long)numberOfLinks];
? @"One link found, swipe to move to the link."
: [NSString stringWithFormat:@"%ld links found, swipe to move to the first link.", (long)numberOfLinks];
firstElement.accessibilityHint = firstElementHint;

} else if (numberOfButtons > 0) {
NSString *firstElementHint = (numberOfButtons == 1)
? @"One button found, swipe right to move to the button."
: [NSString
stringWithFormat:@"%ld buttons found, swipe right to move to the first button.", (long)numberOfButtons];
? @"One button found, swipe to move to the button."
: [NSString stringWithFormat:@"%ld buttons found, swipe to move to the first button.", (long)numberOfButtons];
firstElement.accessibilityHint = firstElementHint;
}

Expand Down

0 comments on commit 4320359

Please sign in to comment.