-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sort locales according to their names #18211
Conversation
I think you might want non-case dependent sorting. |
Codecov Report
@@ Coverage Diff @@
## main #18211 +/- ##
==========================================
+ Coverage 45.63% 45.64% +0.01%
==========================================
Files 830 830
Lines 92017 92020 +3
==========================================
+ Hits 41991 42003 +12
+ Misses 43286 43281 -5
+ Partials 6740 6736 -4
Continue to review full report at Codecov.
|
The problem is that in most romance languages the language does not have an upper case letter. However I think it's valid in almost all languages that the first letter of a list should be capitalised if any of the others are capitalised so I think we can validly force ToTitle when rendering the languages as a list like this. |
Put the detected language as first or second one is better. |
* 'main' of https://github.com/go-gitea/gitea: Fix EasyMDE image paste bug during refactoring (go-gitea#18207) Sort locales according to their names (go-gitea#18211) Restore setting of ctx.Repo.Mirror (go-gitea#18205) [skip ci] Updated translations via Crowdin Show OAuth callback error message (go-gitea#18185)
* Sort locales according to their names * Fix documentation and sort case insensitive
Previously, it was pretty random where which language can be found in the user settings.
This PR fixes this by sorting locales once when initializing Gitea based on their names.
I thought that this change was too small and easy to open an issue for hence I implemented it quickly.
It is a breaking change if any implementation previously needed locales to be at specific indices, which I hope it didn't, especially as it is now clearer than before where which locale will be.According to a quick search, there should be nothing that needs a specific index.(Note: I manually disabled the max-width in the following screenshots to show the old vs. new comparison, that's not how Gitea behaves normally.)
Now, it is also visible that for some reason many locales have lowercase names while others have uppercase names.
Should we unify them to all be uppercased or lowercased (where possible)?
Previous appearance
(tested on a private Gitea 1.15.9 instance)
New appearance