mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-27 03:19:56 +00:00
Add translated setting names to the search index for improved localization support (#1865)
* feat: add translated setting names to the search index for improved localization support * nit --------- Co-authored-by: huchenlei <huchenlei@proton.me>
This commit is contained in:
@@ -183,12 +183,21 @@ const handleSearch = (query: string) => {
|
||||
return
|
||||
}
|
||||
|
||||
const queryLower = query.toLocaleLowerCase()
|
||||
const allSettings = flattenTree<SettingParams>(settingRoot.value)
|
||||
const filteredSettings = allSettings.filter(
|
||||
(setting) =>
|
||||
setting.id.toLowerCase().includes(query.toLowerCase()) ||
|
||||
setting.name.toLowerCase().includes(query.toLowerCase())
|
||||
)
|
||||
const filteredSettings = allSettings.filter((setting) => {
|
||||
const idLower = setting.id.toLowerCase()
|
||||
const nameLower = setting.name.toLowerCase()
|
||||
const translatedName = t(
|
||||
`settingsDialog.${normalizeI18nKey(setting.id)}.name`
|
||||
).toLocaleLowerCase()
|
||||
|
||||
return (
|
||||
idLower.includes(queryLower) ||
|
||||
nameLower.includes(queryLower) ||
|
||||
translatedName.includes(queryLower)
|
||||
)
|
||||
})
|
||||
|
||||
const groupedSettings: { [key: string]: SettingParams[] } = {}
|
||||
filteredSettings.forEach((setting) => {
|
||||
|
||||
Reference in New Issue
Block a user