facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.9k stars 24.3k forks source link

Accessibility - Android talkback accessibilityRole translation #29457

Closed AndWhyWork closed 1 year ago

AndWhyWork commented 4 years ago

Description

When a component is give an accessibilityRole, e.g. 'button' it is read in English for talkback.

e.g. "Back (other language)" + "Button (English) + "Double tap to activate (other language)".

Note the "Back" string is from translated accessibilityLabel

I notice there was another post similar to this for iOS? https://github.com/facebook/react-native/issues/28328 Is there a way to pass a translation or something for this?

React Native version:

System: OS: Windows 10 10.0.18362 CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz Memory: 8.09 GB / 15.95 GB Binaries: Node: 12.16.3 - D:\Programs\nodejs\node.EXE Yarn: 1.22.4 - D:\Programs\Yarn\bin\yarn.CMD npm: 6.14.4 - D:\Programs\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: Not Found Python: 2.7.18 npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.1 => 0.63.1 npmGlobalPackages: react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Have some form of i18n setup, example guide
  2. Give component accessibilityRole e.g. 'button'
  3. Switch language to something other than english
  4. Use talkback

Expected Results

The accessibilityRole should be translated. The default talkback for pressable items "double tap to activate" is translated, I assume by Android?

chrisglein commented 4 years ago

Yes, does seem related to #28328 where the value needs to be english for the code to work (see https://reactnative.dev/docs/view#accessibilityrole), but then that value surfaces in a non translated way. Is this supposed to be handled by the native platform or RN? In the other issue (which went stale) there was some back and forth proposal for how to deal with this. Seems that may need to be resuscitated and perhaps moved to the discussions repo as things can often get lost on issues.

chrisglein commented 4 years ago

Looks like #28328 had a proposal but went stale. @TheSavior Should we encourage that discussion to happen elsewhere (didn't seem to gather attention on the issue)? Agreed with your statement that we should lean into what the native platform does. For example, the equivalent accessibility roles for Windows are here and it's expected without action from the app that those are localized for any screen readers. The cost is handled by language packages that user opts into at an OS level.

stale[bot] commented 3 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Waltari10 commented 3 years ago

We are developing an application where accessibility is important. This is occurring for us as well only on Android, and we would like to see it fixed.

lbaldy commented 3 years ago

I've been answering that question on stackoverflow for somebody: https://stackoverflow.com/questions/65560614/react-native-talkback-reads-component-accessibilityrole-in-wrong-language/65834129#65834129

nico22utn commented 3 years ago

Hi! Have you noticed another issue related with the accessibilityRole set with the header value? I'm not able to read it on Android. I have Samsung S10e.

lbaldy commented 3 years ago

@nico22utn is it not reading it at all or just reading it in the wrong language. Is it reading other labels everywhere else?

nico22utn commented 3 years ago

@nico22utn is it not reading it at all or just reading it in the wrong language. Is it reading other labels everywhere else?

Sorry for the bad explanation. It is not reading the header roles for Android. And I just wanna talk with you about that because I noticed that the accessibility was important for your app. Perhaps, you had noticed something like that.

I'm testing with a S10e / Android 10. It only happens on Android.

lbaldy commented 3 years ago

@nico22utn which version of react native are you on?

I see the header support for accessibility role was added with this commit https://github.com/facebook/react-native/pull/22447

nico22utn commented 3 years ago

@nico22utn which version of react native are you on?

I see the header support for accessibility role was added with this commit #22447 Before upgrading the version of RN, all the stuff related with accessibility worked well. Now, I have this version: "react-native": "0.63.4"

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.