This commit is contained in:
snomiao
2025-09-13 11:49:30 +00:00
parent 76bd481666
commit f4c157d3c8
5 changed files with 209 additions and 3828 deletions

View File

@@ -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