Ignore accents in country names when using filter and spanish translation
KevinBarrera opened this issue · 0 comments
Issue Description
While using react-native-country-picker-modal
I found an issue while using withFilter
and translation
props.
As you might know there are some countries which names could include accent marks, among other punctuation marks, in some languages. The issue is that if I select spa
-> for spanish translation and type something within filter input it doesn't match the input with the countries because inpute does not include accents but names do.
(i.e) Having this:
<CountryPicker
translation="spa"
withFilter
...
/>
I got this behavior:
RPReplay_Final1667863955.mov
As you can see, if user types "M" "México" appears as one of possible options, but if I add an "e" -> "Me". "México" disappears from the list, I think it is because the accent, I've been looking for a way to get this ignoring the accent while filtering but cannot find the solution.
Steps to Reproduce / Code Snippets
- Install
"react-native-country-picker-modal": "^2.0.0"
- Currently using Expo ->
"expo": "^45.0.0",
- Type script ->
"typescript": "~4.3.5",
Expected Results
If user types "Me" "México" should appears within the options even if user does not type the accent when using "spanish" translation.
Additional Information
- Nodejs version: 16.13.2
- React version: 17.0.2
- React Native version: 0.68.2
- react-native-country-picker-modal version: 2.0.0
- Platform(s) (iOS, Android, web, or all?): iOS and Android
- TypeScript version: ~4.3.5