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

Languages should be sorted alphabetically based on what users see #3295

Closed
mmahmoudian opened this issue Oct 12, 2021 · 0 comments · Fixed by #3301
Closed

Languages should be sorted alphabetically based on what users see #3295

mmahmoudian opened this issue Oct 12, 2021 · 0 comments · Fixed by #3301

Comments

@mmahmoudian
Copy link

mmahmoudian commented Oct 12, 2021

Describe the bug
On the main website's dataset's page, the languages are sorted based on their ISO code, but the text is the actual language name in English. This makes it hard to find the language user is after. For instance I was looking for "Persian" among items starting with "P" and when I didn't find it I tried to find "Farsi" among "F"s and at the first look I failed to find it but I was sure that it exists because I myself contributed a lot, so I grep the page source code and found:

<option value="eu">Basque</option>
<option value="fa">Persian</option>
<option value="fi">Finnish</option>
<option value="fr">French</option>
<option value="fy-NL">Frisian</option>

This would affect a lot of languages including but not limited to Welsh (cy), Spanish (es),

So based on a quick analysis these are the distances that the current situation is compared to what users expect them to see:

image

As you can see the distance can be extremely far for some of the entries!

To Reproduce

  1. Open https://commonvoice.mozilla.org/en/datasets

Expected behavior
Languages are sorted alphabetically and based on the visible text to user and not the language codes that is not visible to user.

Screenshots

image

Desktop or Mobile (please complete the following information):

  • OS: Manjaro
  • Browser: Firefox
  • Version 93.0 (64-bit)

Additional Hardware (were you using headphones, an external speaker or an external microphone?):
--irrelevant--

Additional context
--irrelevant--

ChristianMMacy added a commit to ChristianMMacy/common-voice that referenced this issue Oct 17, 2021
This commit adds localized sort logic for the language dropdown. It
gets the language name for the locales and then uses localized
comparison so that non-Latin and accented characters are sorted
correctly.
ChristianMMacy added a commit to ChristianMMacy/common-voice that referenced this issue Oct 17, 2021
ChristianMMacy added a commit to ChristianMMacy/common-voice that referenced this issue Oct 19, 2021
This commit sets up a new hook that can be used to fetch a list of
sorted locales. The list is sorted based on the name of each locale,
localized for the current locale of the client.
ChristianMMacy added a commit to ChristianMMacy/common-voice that referenced this issue Oct 19, 2021
ChristianMMacy added a commit to ChristianMMacy/common-voice that referenced this issue Oct 20, 2021
phirework pushed a commit that referenced this issue Oct 20, 2021
…localization. (#3301)

* #3295: Add sort logic for locales.

This commit adds localized sort logic for the language dropdown. It
gets the language name for the locales and then uses localized
comparison so that non-Latin and accented characters are sorted
correctly.

* #3295: Remove unnecessary empty line additions.

* #3295: Add `useSortedLocales` hook; Specify `getString` type

This commit sets up a new hook that can be used to fetch a list of
sorted locales. The list is sorted based on the name of each locale,
localized for the current locale of the client.

* #3295: Leverage `useSortedLocales` hook for Datasets and LanguageSelect

* #3295: Insert spaces to make import style consistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant