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

2173: Send language to iOS VoiceOver #2910

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

LeandraH
Copy link
Contributor

@LeandraH LeandraH commented Sep 2, 2024

Short description

As part of the test of our accessibility from Pfennigparade a while ago, we got the feedback that the app doesn't send the language chosen in the app to OS so that you might get e.g. German texts read with an English pronunciation.

Android does a good job of that natively already, and the prop accessibilityLanguage can be used to achieve the same thing in iOS.

Proposed changes

  • Added the prop accessibilityLanguage in many places.
  • Wrote a little function telling us what language the text in the header should be.

Side effects

  • I turned the Pressable in the NewsItemList into two Pressables that lead to the same place because the first half is in the language that the app is in and the second part ("Continue") is in the system language. I didn't see a visual or behavioural difference but maybe I missed something.

Testing

  1. Be on an iPhone (VoiceOver doesn't exist on emulators, yay.)
  2. Turn on VoiceOver
  3. Set the app language to one that is different from your phone's language
  4. Walk around through the app

Alternatively, you can edit the HeaderBox to show the title and the language, and that should be good enough for a test.

Resolved issues

Fixes: #2173

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Can you explain a little bit more when we have to set the language? Whenever the language is different than the system language, right? Wouldn't that include stuff like the webview as well? How did you check where you need to set this?

native/src/components/Header.tsx Outdated Show resolved Hide resolved
native/src/components/NewsListItem.tsx Outdated Show resolved Hide resolved
@LeandraH
Copy link
Contributor Author

Can you explain a little bit more when we have to set the language? Whenever the language is different than the system language, right? Wouldn't that include stuff like the webview as well? How did you check where you need to set this?

Exactly, we have to set the language for components that should be read out in the app language as opposed to the system language. I checked it manually by going through the app on my phone with VoiceOver enabled. Webview seems to be doing this correctly already.

native/src/components/Header.tsx Outdated Show resolved Hide resolved
native/src/components/Header.tsx Outdated Show resolved Hide resolved
native/src/components/Header.tsx Outdated Show resolved Hide resolved
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Nice job! Not tested

Copy link

codeclimate bot commented Oct 17, 2024

Code Climate has analyzed commit ab734f1 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 60.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 74.2% (0.0% change).

View more on Code Climate.

Copy link
Member

@ztefanie ztefanie left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, code looks good. Not tested, because i do not have a iphone.

💭 Should handle most cases properly, but we sometimes have edge cases, that still are handled wrongly, e.g. news that are send in german for all languages or things link this.

}
}

return { text: previousRoute.name, language: undefined } // system language
Copy link
Member

Choose a reason for hiding this comment

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

🔧 Feel free to fix this CodeScene issue, if you are motivated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IGAPP-1241: Send app language to OS for screen reader
3 participants