Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated iOS-only accessibilityLanguage prop #33090

Conversation

dgopsq
Copy link
Contributor

@dgopsq dgopsq commented Feb 11, 2022

Summary

This PR fixes #30891

This PR is going to add an accessibilityLanguage prop to all the available components. This props is currently working only on iOS and should follow the guidelines of the relative configuration.

I'm in no way an expert on native programming (especially Objective-C) so I'm open to changes / improvements 🙂

Changelog

[iOS] [Added] - Integrated the accessibilityLanguage prop to all the available components. The prop is available for any platform but it will work only on iOS.

Test Plan

This has been tested using both the Simulator, checking for the Language attribute, and using a physical device with the Voice Over enabled.

Screenshot 2022-02-11 at 13 17 32

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 11, 2022
@react-native-bot react-native-bot added Platform: iOS iOS applications. Type: Enhancement A new feature or enhancement of an existing feature. labels Feb 11, 2022
@analysis-bot
Copy link

analysis-bot commented Feb 11, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 46bc521
Branch: main

@analysis-bot
Copy link

analysis-bot commented Feb 11, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,187,593 -16,787
android hermes armeabi-v7a 7,789,339 -23,307
android hermes x86 8,558,375 -17,774
android hermes x86_64 8,510,871 -15,991
android jsc arm64-v8a 9,856,505 -16,789
android jsc armeabi-v7a 8,842,794 -23,310
android jsc x86 9,823,391 -17,766
android jsc x86_64 10,420,006 -15,989

Base commit: 46bc521
Branch: main

@dgopsq dgopsq marked this pull request as ready for review February 11, 2022 12:57
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 11, 2022
Copy link
Contributor

@robhogan robhogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dgopsq and thanks for the PR - this is a great first contribution!

I think we should add a platform hint to the comments to indicate that it's only implemented in iOS, and a docs PR would also be great, but this looks on the right track to me.

Co-authored-by: Rob Hogan <rh389@users.noreply.github.com>
@dgopsq
Copy link
Contributor Author

dgopsq commented Feb 11, 2022

Hi @dgopsq and thanks for the PR - this is a great first contribution!

I think we should add a platform hint to the comments to indicate that it's only implemented in iOS, and a docs PR would also be great, but this looks on the right track to me.

Thank you @rh389! A PR for the docs will follow soon 🙂

Copy link

@PrayaAmadigaPitasa PrayaAmadigaPitasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need documentation for new props

@dgopsq
Copy link
Contributor Author

dgopsq commented Feb 15, 2022

@PrayaAmadigaPitasa I've been a bit busy, in the next days I'll open the PR 🙂

By the way, I just noticed that the latest tests didn't pass on the CI but I cannot reproduce anything locally, and I don't think I'm seeing useful informations about the error, do you know what's the matter?

@dgopsq
Copy link
Contributor Author

dgopsq commented Feb 16, 2022

I opened facebook/react-native-website#2970 to address the documentation!

@dgopsq
Copy link
Contributor Author

dgopsq commented Feb 28, 2022

@rh389 @PrayaAmadigaPitasa Hello, sorry in advance for the notification, I just wanted to know if something else needs to be done on my part, if so let me know 🙂

@facebook-github-bot
Copy link
Contributor

@rh389 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@robhogan
Copy link
Contributor

Thanks @dgopsq, sorry for the delay. This looks good to me - imported for final review

@facebook-github-bot
Copy link
Contributor

@rh389 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @dgopsq in 7b05b09.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 7, 2022
@dvijeniii05
Copy link

dvijeniii05 commented Jul 15, 2022

Hi everyone!
I have a strange issue, where none of default React Native elements, such as View, Text, Touchable etc, they don't list accessibilityLanguage as a prop. None of them. Every other accessibility prop is available except Language.

Currently tried on 3 different "machines", 3 different projects, even a new one out of the box, and nothing.
Is there an issue with it? has the prop been removed?

@gaurav5430
Copy link

Hi everyone! I have a strange issue, where none of default React Native elements, such as View, Text, Touchable etc, they don't list accessibilityLanguage as a prop. None of them. Every other accessibility prop is available except Language.

Currently tried on 3 different "machines", 3 different projects, even a new one out of the box, and nothing. Is there an issue with it? has the prop been removed?

I have the same problem, is it something to do with react native version?

@gaurav5430
Copy link

@dgopsq how do you get the Advanced panel in accessibility inspector ?

@gaurav5430
Copy link

Hi everyone! I have a strange issue, where none of default React Native elements, such as View, Text, Touchable etc, they don't list accessibilityLanguage as a prop. None of them. Every other accessibility prop is available except Language.
Currently tried on 3 different "machines", 3 different projects, even a new one out of the box, and nothing. Is there an issue with it? has the prop been removed?

I have the same problem, is it something to do with react native version?

As i can see, this is available from version 69 onwards. I am still on 68

@dgopsq
Copy link
Contributor Author

dgopsq commented Jul 26, 2022

@dgopsq how do you get the Advanced panel in accessibility inspector ?

@gaurav5430 I didn't do anything special, I just had it from the start. As far as I can see it's not even possible to hide it so you should have it too! 🤔

Hi everyone! I have a strange issue, where none of default React Native elements, such as View, Text, Touchable etc, they don't list accessibilityLanguage as a prop. None of them. Every other accessibility prop is available except Language.

Currently tried on 3 different "machines", 3 different projects, even a new one out of the box, and nothing. Is there an issue with it? has the prop been removed?

@dvijeniii05 You're using TypeScript right? I just noticed that @types/react-native doesn't have the accessibilityLanguage prop. I'll try to make a PR as soon as possible 🙂

Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2023
Summary:
This PR fixes facebook#30891

This PR is going to add an `accessibilityLanguage` prop to all the available components. This props is currently working only on iOS and should follow the [guidelines of the relative configuration](https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage).

I'm in no way an expert on native programming (especially Objective-C) so I'm open to changes / improvements 🙂

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS.

Pull Request resolved: facebook#33090

Test Plan:
This has been tested using both the Simulator, checking for the `Language` attribute, and using a physical device with the Voice Over enabled.

<img width="1083" alt="Screenshot 2022-02-11 at 13 17 32" src="https://user-images.githubusercontent.com/5963683/153590415-65fcb4ff-8f31-4a0f-90e5-8eb1aae6aa3d.png">

Reviewed By: philIip

Differential Revision: D34523608

Pulled By: rh389

fbshipit-source-id: b5d77fc0b3d76ea8ed8f30c8385459ba98122ff6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS: Accessibility Language Support
9 participants