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

Suggestion: Suggestions should be sorted based on locale #81

Open
mocsa opened this issue Mar 7, 2024 · 0 comments
Open

Suggestion: Suggestions should be sorted based on locale #81

mocsa opened this issue Mar 7, 2024 · 0 comments

Comments

@mocsa
Copy link

mocsa commented Mar 7, 2024

I suggest that the File Scanner Provider and the Word List Provider sorts its results based on a pre-set international locale.

Looking at the code, it seems both providers use dictionary_provider.ts. At the end of the getSuggestions() method it does this:

return result.sort((a, b) => a.displayName.length - b.displayName.length);

I suggest it does something like this, instead:

const mycollator = new Intl.Collator('de');
return result.sort((a, b) => mycollator.compare(a.displayName, b.displayName));

I think there should be a new configuration option where the user can specify the locale. I'm not sure if it is possible to obtain the current locale of Obsidian in JS, but even if it is, it would be better to make this selectable by the user. It is possible, that the user uses Obsidian in English but writes his/her notes in a different language.

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

No branches or pull requests

1 participant