mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +00:00
restore
This commit is contained in:
@@ -48,15 +48,28 @@ test('collect-i18n-general', async ({ comfyPage }) => {
|
||||
Array.from(allLabels).map((label) => [normalizeI18nKey(label), label])
|
||||
)
|
||||
|
||||
const allCommandsLocale = Object.fromEntries(
|
||||
commands.map((command) => [
|
||||
// Load existing commands to preserve Desktop commands
|
||||
const existingCommands = JSON.parse(fs.readFileSync(commandsPath, 'utf-8'))
|
||||
|
||||
// Filter out Desktop commands from existing commands
|
||||
const desktopCommands = Object.fromEntries(
|
||||
Object.entries(existingCommands).filter(([key]) =>
|
||||
key.startsWith('Comfy-Desktop')
|
||||
)
|
||||
)
|
||||
|
||||
const allCommandsLocale = Object.fromEntries([
|
||||
// Keep Desktop commands that aren't in the current collection
|
||||
...Object.entries(desktopCommands),
|
||||
// Add/update commands from current collection
|
||||
...commands.map((command) => [
|
||||
normalizeI18nKey(command.id),
|
||||
{
|
||||
label: command.label,
|
||||
tooltip: command.tooltip
|
||||
}
|
||||
])
|
||||
)
|
||||
])
|
||||
|
||||
// Settings
|
||||
const settings = await comfyPage.page.evaluate(() => {
|
||||
@@ -79,8 +92,21 @@ test('collect-i18n-general', async ({ comfyPage }) => {
|
||||
}))
|
||||
})
|
||||
|
||||
const allSettingsLocale = Object.fromEntries(
|
||||
settings.map((setting) => [
|
||||
// Load existing settings to preserve Desktop settings
|
||||
const existingSettings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'))
|
||||
|
||||
// Filter out Desktop settings from existing settings
|
||||
const desktopSettings = Object.fromEntries(
|
||||
Object.entries(existingSettings).filter(([key]) =>
|
||||
key.startsWith('Comfy-Desktop')
|
||||
)
|
||||
)
|
||||
|
||||
const allSettingsLocale = Object.fromEntries([
|
||||
// Keep Desktop settings that aren't in the current collection
|
||||
...Object.entries(desktopSettings),
|
||||
// Add/update settings from current collection
|
||||
...settings.map((setting) => [
|
||||
normalizeI18nKey(setting.id),
|
||||
{
|
||||
name: setting.name,
|
||||
@@ -99,7 +125,7 @@ test('collect-i18n-general', async ({ comfyPage }) => {
|
||||
: undefined
|
||||
}
|
||||
])
|
||||
)
|
||||
])
|
||||
|
||||
const allSettingCategoriesLocale = Object.fromEntries(
|
||||
settings
|
||||
|
||||
Reference in New Issue
Block a user