Skip to content

Sort languages alphabetically in the preferences #10660#10675

Merged
Siedlerchr merged 20 commits into
JabRef:mainfrom
JannCamilo:fix-issue-10660
Dec 10, 2023
Merged

Sort languages alphabetically in the preferences #10660#10675
Siedlerchr merged 20 commits into
JabRef:mainfrom
JannCamilo:fix-issue-10660

Conversation

@theoo33

@theoo33 theoo33 commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

Fixes #10660

In the general tab in the preferences, the language list is now sorted.
image

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr

Copy link
Copy Markdown
Member

You probably need to look into the Collator https://docs.oracle.com/javase/tutorial/i18n/text/locale.html
cc @HoussemNasri

@HoussemNasri

HoussemNasri commented Nov 28, 2023

Copy link
Copy Markdown
Member

About languages that contain non-Latin characters not being sorted correctly, you can filter out non-Latin characters before sorting with s.replaceAll("[^\\p{IsLatin}]", "") . This way العربية (Arabic) becomes just Arabic.

@theoo33 theoo33 marked this pull request as ready for review December 6, 2023 09:35
@Siedlerchr

Copy link
Copy Markdown
Member

I took the liberty to make a small change, to return list instead of array

koppor
koppor previously approved these changes Dec 6, 2023
@koppor

koppor commented Dec 6, 2023

Copy link
Copy Markdown
Member

@JannCamilo @theoo33 Thank you for your work! We made small improvements. Especially a) using of Java standard types (List instead of []) and b) using of pre-compiled regular expressions to gain a bit of speed.

Comment thread src/main/java/org/jabref/logic/l10n/Language.java

@HoussemNasri HoussemNasri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, LGTM 👍

@Siedlerchr Siedlerchr added this pull request to the merge queue Dec 10, 2023
Merged via the queue into JabRef:main with commit 43817fd Dec 10, 2023
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.

Sort languages alphabetically in the preferences

4 participants