fix(admin-ui): sort supported languages alphabetically (#5479)
## What? Added sorting to the `supportedLanguages` array in `packages/admin-ui/ui/src/i18n/index.ts`. This makes sure the languages in the dropdown are sorted alphabetically.  ## Why? As we're supporting more languages in the admin UI, this list was getting messy. ## How? By using `sort()` and `localeCompare()` on array declaration. ## Testing Go to Medusa Admin locally, login and navigate to Settings > Personal information to test the language dropdown.
This commit is contained in:
5
.changeset/rotten-kids-cough.md
Normal file
5
.changeset/rotten-kids-cough.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
---
|
||||
|
||||
fix: sort supportedLanguages array
|
||||
@@ -66,7 +66,7 @@ export const supportedLanguages = [
|
||||
locale: "ru",
|
||||
name: "Русский"
|
||||
}
|
||||
]
|
||||
].sort((a, b) => a.locale.localeCompare(b.locale))
|
||||
|
||||
const adminPath = getFullAdminPath()
|
||||
const pathToLoadFrom = `${adminPath}public/locales/{{lng}}/{{ns}}.json`
|
||||
|
||||
Reference in New Issue
Block a user