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

Add coverage for LanguagesHelper#locale_name_for_sorting method #31701

Closed

Conversation

mjankowski
Copy link
Contributor

Rounding out various code paths.

@ClearlyClaire
Copy link
Contributor

Honestly I'm not even sure what the intent was behind those things, so I'm not sure this makes sense codifying them in a test.

@mjankowski
Copy link
Contributor Author

Fair enough- looks like they were added as part of a sorting change - https://github.com/mastodon/mastodon/pull/27158/files

My assumption was that there was some (valid) case where the inbound locale was either blank/nil/undefined or something and we wanted it to sort first.

If that's not true or this is handling an edge case that doesn't exist, I can remove the lines instead.

@ClearlyClaire
Copy link
Contributor

This is only ever called with LanguagesHelper::SUPPORTED_LOCALES.keys or I18n.available_locales as keys, so the blank case and und are never going to occur I think? And a language code being unknown is technically possible if we are not consistent when adding new entries, but should otherwise not happen either

@mjankowski mjankowski closed this Sep 3, 2024
@mjankowski mjankowski deleted the coverage-locale-name-sorting branch September 3, 2024 13:58
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.

2 participants