How to translate react-select's aria-live? #5632
-
Hi there! Therefore my question is: is there a way to set those messages in another language, like Portuguese? Below there is a screenshot of the outcomes. Note that even though NVDA reads the component in Portuguese, when it comes to showing how to select an option and how many options there are left, NVDA reads it in English. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Coming back just in case someone have the same doubt I had. Actually there is a manual alternative to solve this translation issue, using AriaLiveMessage. The documentation example wasn't so clear to me at the time, but it is quite simple. I was wondering if this solution could be automatic, getting the language specified within the project and manage to change texts, that's why I primirily started this discussion, however this implementation is satisfatory by now. |
Beta Was this translation helpful? Give feedback.
Coming back just in case someone have the same doubt I had. Actually there is a manual alternative to solve this translation issue, using AriaLiveMessage. The documentation example wasn't so clear to me at the time, but it is quite simple.
As you can see in the CustomAriaLive example, you can manage to create a similar defaultAriaLiveMessages object in your custom select component and translate it yourself. Then you can set the return to get the attribute like
ariaLiveMessages={defaultAriaLiveMessages}
.I was wondering if this solution could be automatic, getting the language specified within the project and manage to change texts, that's why I primirily started this discussion, however t…