fix: Refactor i18n config and fix plugin search box styling issue (#22945)

This commit is contained in:
Wu Tianwei
2025-07-25 15:01:28 +08:00
committed by GitHub
parent 32df3b68c7
commit ad472d59e0
70 changed files with 96 additions and 85 deletions

View File

@@ -17,7 +17,7 @@ import {
getFormattedPlugin,
getMarketplaceCollectionsAndPlugins,
} from './utils'
import i18n from '@/i18n/i18next-config'
import i18n from '@/i18n-config/i18next-config'
import {
useMutationPluginsFromMarketplace,
} from '@/service/use-plugins'
@@ -109,6 +109,7 @@ export const useMarketplacePlugins = () => {
export const useMixedTranslation = (localeFromOuter?: string) => {
let t = useTranslation().t
// !localeFromOuter only support zh-Hans and en-US for now
if (localeFromOuter)
t = i18n.getFixedT(localeFromOuter)
@@ -121,8 +122,6 @@ export const useMarketplaceContainerScroll = (
callback: () => void,
scrollContainerId = 'marketplace-container',
) => {
const container = document.getElementById(scrollContainerId)
const handleScroll = useCallback((e: Event) => {
const target = e.target as HTMLDivElement
const {
@@ -135,6 +134,7 @@ export const useMarketplaceContainerScroll = (
}, [callback])
useEffect(() => {
const container = document.getElementById(scrollContainerId)
if (container)
container.addEventListener('scroll', handleScroll)
@@ -142,7 +142,7 @@ export const useMarketplaceContainerScroll = (
if (container)
container.removeEventListener('scroll', handleScroll)
}
}, [container, handleScroll])
}, [handleScroll])
}
export const useSearchBoxAutoAnimate = (searchBoxAutoAnimate?: boolean) => {