|
14 | 14 | #import "RCTBorderCurve.h"
|
15 | 15 | #import "RCTBorderDrawing.h"
|
16 | 16 | #import "RCTI18nUtil.h"
|
| 17 | +#import "RCTLocalizedString.h" |
17 | 18 | #import "RCTLog.h"
|
18 | 19 | #import "RCTViewUtils.h"
|
19 | 20 | #import "UIView+React.h"
|
@@ -282,41 +283,44 @@ - (NSString *)accessibilityValue
|
282 | 283 | static NSDictionary<NSString *, NSString *> *rolesAndStatesDescription = nil;
|
283 | 284 |
|
284 | 285 | dispatch_once(&onceToken, ^{
|
285 |
| - NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"AccessibilityResources" ofType:@"bundle"]; |
286 |
| - NSBundle *bundle = [NSBundle bundleWithPath:bundlePath]; |
287 |
| - |
288 |
| - if (bundle) { |
289 |
| - NSURL *url = [bundle URLForResource:@"Localizable" withExtension:@"strings"]; |
290 |
| - rolesAndStatesDescription = [NSDictionary dictionaryWithContentsOfURL:url error:nil]; |
291 |
| - } |
292 |
| - if (rolesAndStatesDescription == nil) { |
293 |
| - // Falling back to hardcoded English list. |
294 |
| - NSLog(@"Cannot load localized accessibility strings."); |
295 |
| - rolesAndStatesDescription = @{ |
296 |
| - @"alert" : @"alert", |
297 |
| - @"checkbox" : @"checkbox", |
298 |
| - @"combobox" : @"combo box", |
299 |
| - @"menu" : @"menu", |
300 |
| - @"menubar" : @"menu bar", |
301 |
| - @"menuitem" : @"menu item", |
302 |
| - @"progressbar" : @"progress bar", |
303 |
| - @"radio" : @"radio button", |
304 |
| - @"radiogroup" : @"radio group", |
305 |
| - @"scrollbar" : @"scroll bar", |
306 |
| - @"spinbutton" : @"spin button", |
307 |
| - @"switch" : @"switch", |
308 |
| - @"tab" : @"tab", |
309 |
| - @"tablist" : @"tab list", |
310 |
| - @"timer" : @"timer", |
311 |
| - @"toolbar" : @"tool bar", |
312 |
| - @"checked" : @"checked", |
313 |
| - @"unchecked" : @"unchecked", |
314 |
| - @"busy" : @"busy", |
315 |
| - @"expanded" : @"expanded", |
316 |
| - @"collapsed" : @"collapsed", |
317 |
| - @"mixed" : @"mixed", |
318 |
| - }; |
319 |
| - } |
| 286 | + rolesAndStatesDescription = @{ |
| 287 | + @"alert" : RCTLocalizedString("alert", "important, and usually time-sensitive, information"), |
| 288 | + @"busy" : RCTLocalizedString("busy", "an element currently being updated or modified"), |
| 289 | + @"checkbox" : RCTLocalizedString("checkbox", "checkable interactive control"), |
| 290 | + @"combobox" : RCTLocalizedString( |
| 291 | + "combo box", |
| 292 | + "input that controls another element that can pop up to help the user set the value of that input"), |
| 293 | + @"menu" : RCTLocalizedString("menu", "offers a list of choices to the user"), |
| 294 | + @"menubar" : RCTLocalizedString( |
| 295 | + "menu bar", "presentation of menu that usually remains visible and is usually presented horizontally"), |
| 296 | + @"menuitem" : RCTLocalizedString("menu item", "an option in a set of choices contained by a menu or menubar"), |
| 297 | + @"progressbar" : |
| 298 | + RCTLocalizedString("progress bar", "displays the progress status for tasks that take a long time"), |
| 299 | + @"radio" : RCTLocalizedString( |
| 300 | + "radio button", |
| 301 | + "a checkable input that when associated with other radio buttons, only one of which can be checked at a time"), |
| 302 | + @"radiogroup" : RCTLocalizedString("radio group", "a group of radio buttons"), |
| 303 | + @"scrollbar" : RCTLocalizedString("scroll bar", "controls the scrolling of content within a viewing area"), |
| 304 | + @"spinbutton" : RCTLocalizedString( |
| 305 | + "spin button", "defines a type of range that expects the user to select a value from among discrete choices"), |
| 306 | + @"switch" : RCTLocalizedString("switch", "represents the states 'on' and 'off'"), |
| 307 | + @"tab" : RCTLocalizedString("tab", "an interactive element inside a tablist"), |
| 308 | + @"tablist" : RCTLocalizedString("tab list", "container for a set of tabs"), |
| 309 | + @"timer" : RCTLocalizedString( |
| 310 | + "timer", |
| 311 | + "a numerical counter listing the amount of elapsed time from a starting point or the remaining time until an end point"), |
| 312 | + @"toolbar" : RCTLocalizedString( |
| 313 | + "tool bar", |
| 314 | + "a collection of commonly used function buttons or controls represented in a compact visual form"), |
| 315 | + @"checked" : RCTLocalizedString("checked", "a checkbox, radio button, or other widget which is checked"), |
| 316 | + @"unchecked" : RCTLocalizedString("unchecked", "a checkbox, radio button, or other widget which is unchecked"), |
| 317 | + @"expanded" : |
| 318 | + RCTLocalizedString("expanded", "a menu, dialog, accordian panel, or other widget which is expanded"), |
| 319 | + @"collapsed" : |
| 320 | + RCTLocalizedString("collapsed", "a menu, dialog, accordian panel, or other widget which is collapsed"), |
| 321 | + @"mixed" : |
| 322 | + RCTLocalizedString("mixed", "a checkbox, radio button, or other widget which is both checked and unchecked"), |
| 323 | + }; |
320 | 324 | });
|
321 | 325 |
|
322 | 326 | // Handle Switch.
|
|
0 commit comments