11import { Icon } from "libs/ui/react/components/Icon/index.tsx" ;
22import { ResourceText } from "libs/ui/react/components/ResourceText/index.tsx" ;
3+ import { getResourceText } from "libs/ui/react/utils/index.ts" ;
34import { Tooltip } from "antd" ;
45import { memo , useState } from "react" ;
56import { useTranslation } from "react-i18next" ;
@@ -17,7 +18,7 @@ export const Navigation = memo(() => {
1718 const activeThemes = settings . value . activeThemes ;
1819 const devTools = settings . value . devTools ;
1920
20- const { t } = useTranslation ( ) ;
21+ const { t, i18n } = useTranslation ( ) ;
2122 const location = useLocation ( ) ;
2223
2324 const Mapper = ( route : RoutePath | null ) => {
@@ -81,7 +82,11 @@ export const Navigation = memo(() => {
8182 < div className = { cs . group } >
8283 { widgets . value
8384 . filter ( ( widget ) => ! widget . hidden )
84- . toSorted ( ( a , b ) => a . id . localeCompare ( b . id ) )
85+ . toSorted ( ( a , b ) => {
86+ const aName = getResourceText ( a . metadata . displayName , i18n . language ) ;
87+ const bName = getResourceText ( b . metadata . displayName , i18n . language ) ;
88+ return aName . localeCompare ( bName , i18n . language ) ;
89+ } )
8590 . map ( ( widget ) => (
8691 < Item
8792 key = { widget . id }
@@ -99,7 +104,11 @@ export const Navigation = memo(() => {
99104 < div className = { cs . separator } />
100105 < div className = { cs . group } >
101106 { themesDirectAccess
102- . toSorted ( ( a , b ) => a . id . localeCompare ( b . id ) )
107+ . toSorted ( ( a , b ) => {
108+ const aName = getResourceText ( a . metadata . displayName , i18n . language ) ;
109+ const bName = getResourceText ( b . metadata . displayName , i18n . language ) ;
110+ return aName . localeCompare ( bName , i18n . language ) ;
111+ } )
103112 . map ( ( theme ) => (
104113 < Item
105114 key = { theme . id }
0 commit comments