-
Notifications
You must be signed in to change notification settings - Fork 672
fix: replace lobe-i18n with source-aware in-house locale pipeline #15062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6045f54
c40e2c6
03e07b1
2f9041f
b48f95a
fbde245
0bf1590
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,11 @@ name: 'i18n: Update Core' | |
| on: | ||
| # Manual dispatch for urgent translation updates | ||
| workflow_dispatch: | ||
| inputs: | ||
| allow_prune: | ||
| description: 'Confirm deletions larger than the prune threshold' | ||
| type: boolean | ||
| default: false | ||
|
Comment on lines
+7
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
rg -n -C2 \
'workflow_dispatch|allow_prune|github\.head_ref|github\.ref_name|git (fetch|checkout|push)' \
"$file"
if rg -n 'git (fetch|checkout|push).*github\.head_ref' "$file"; then
echo "Manual dispatch still uses the pull-request-only head_ref." >&2
exit 1
fiRepository: Comfy-Org/ComfyUI_frontend Length of output: 1937 🏁 Script executed: sed -n '1,120p' .github/workflows/i18n-update-core.yamlRepository: Comfy-Org/ComfyUI_frontend Length of output: 3706 🌐 Web query:
💡 Result: When manually triggering a workflow via the Citations:
🏁 Script executed: python3 - <<'PY'
from pathlib import Path
import re
p = Path(".github/workflows/i18n-update-core.yaml")
text = p.read_text()
manual_job = "github.event_name == 'workflow_dispatch'" in text
head_ref_commands = re.findall(r"git\s+(?:fetch|checkout|push)[^\n]*github\.head_ref", text)
ref_name_present = "github.ref_name" in text
print({
"manual_dispatch_enables_job": manual_job,
"commit_commands_using_head_ref": head_ref_commands,
"ref_name_present": ref_name_present,
})
PYRepository: Comfy-Org/ComfyUI_frontend Length of output: 418 Use the selected branch for manual dispatches. Manual runs leave 🤖 Prompt for AI AgentsSource: MCP tools |
||
| # Trigger on PRs to main and to release branches (core/x.y, cloud/x.y). | ||
| # Release branches need this so translations for backported locale keys are | ||
| # regenerated and baked into the version-bump PR, mirroring main. Additional | ||
|
|
@@ -22,6 +27,10 @@ jobs: | |
| uses: actions/checkout@v7 | ||
| with: | ||
| token: ${{ secrets.PR_GH_TOKEN }} | ||
| # Blobless full history: the locale pipeline lazily fetches the | ||
| # English source blobs recorded in src/locales/.source-manifest.json | ||
| fetch-depth: 0 | ||
| filter: blob:none | ||
|
|
||
| # Setup playwright environment | ||
| - name: Setup ComfyUI Frontend | ||
|
|
@@ -46,7 +55,12 @@ jobs: | |
| env: | ||
| PLAYWRIGHT_TEST_URL: http://localhost:5173 | ||
| - name: Update translations | ||
| run: pnpm locale && pnpm format | ||
| id: translate | ||
| # continue-on-error so completed entry files (written and recorded in | ||
| # the manifest even when another file fails) still get committed; the | ||
| # final step re-surfaces the failure | ||
| continue-on-error: true | ||
| run: pnpm locale ${{ inputs.allow_prune == true && '--allow-prune' || '' }} && pnpm format | ||
|
Comment on lines
+58
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
rg -n -C2 \
'id: translate|continue-on-error|pnpm locale|pnpm format|steps\.translate\.outcome' \
"$file"Repository: Comfy-Org/ComfyUI_frontend Length of output: 1026 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
sed -n '1,100p' "$file"
printf '\n--- package scripts ---\n'
rg -n -C2 '"(locale|format)"|locale|format' package.json pnpm-workspace.yaml 2>/dev/null || trueRepository: Comfy-Org/ComfyUI_frontend Length of output: 4582 🏁 Script executed: #!/usr/bin/env bash
set -u
run_case() {
local locale_status="$1"
local format_status="$2"
local outcome=success
if (( locale_status == 0 )); then
(( format_status == 0 )) || outcome=failure
else
outcome=failure
fi
printf 'pnpm locale=%s, pnpm format=%s -> steps.translate.outcome=%s\n' \
"$locale_status" "$format_status" "$outcome"
}
run_case 0 0
run_case 0 1
run_case 1 0Repository: Comfy-Org/ComfyUI_frontend Length of output: 356 Separate translation and formatting status If 🤖 Prompt for AI AgentsSource: MCP tools |
||
| env: | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| - name: Commit updated locales | ||
|
|
@@ -62,3 +76,8 @@ jobs: | |
| git add src/locales/ | ||
| git diff --staged --quiet || git commit -m "Update locales" | ||
| git push origin HEAD:${{ github.head_ref }} | ||
| - name: Fail if translation did not complete | ||
| if: steps.translate.outcome == 'failure' | ||
| run: | | ||
| echo "::error::pnpm locale failed; completed entry files were committed, the rest retry on the next run" | ||
| exit 1 | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,8 @@ | |
| "lint:unstaged": "git diff --name-only HEAD | grep -E '\\.(js|ts|vue|mts)$' | xargs -r eslint --cache", | ||
| "lint": "pnpm stylelint && oxlint src browser_tests --type-aware && eslint src --cache", | ||
| "lint:desktop": "pnpm --filter @comfyorg/desktop-ui run lint", | ||
| "locale": "lobe-i18n locale", | ||
| "locale": "tsx scripts/i18n/update-locales.ts", | ||
| "locale:check": "tsx scripts/i18n/update-locales.ts --check", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [quality] low SHOULD-FIX — |
||
| "oxlint": "oxlint src browser_tests --type-aware", | ||
| "prepare": "pnpm exec husky || true && git config blame.ignoreRevsFile .git-blame-ignore-revs || true", | ||
| "preview": "vite preview --config vite.config.mts", | ||
|
|
@@ -141,7 +142,6 @@ | |
| "@comfyorg/ingest-types": "workspace:*", | ||
| "@eslint/js": "catalog:", | ||
| "@intlify/eslint-plugin-vue-i18n": "catalog:", | ||
| "@lobehub/i18n-cli": "catalog:", | ||
| "@pinia/testing": "catalog:", | ||
| "@playwright/test": "catalog:", | ||
| "@sentry/vite-plugin": "catalog:", | ||
|
|
@@ -187,6 +187,7 @@ | |
| "markdown-table": "catalog:", | ||
| "mixpanel-browser": "catalog:", | ||
| "monocart-coverage-reports": "catalog:", | ||
| "openai": "catalog:", | ||
| "oxfmt": "catalog:", | ||
| "oxlint": "catalog:", | ||
| "oxlint-tsgolint": "catalog:", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2838
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 50383
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2119
Fetch the locale manifest history in both callers
Neither caller sets
fetch-depth: 0. Add it to both checkout steps, or makelocale:checkfail when a manifest blob is unavailable. Otherwise, changed-string detection is skipped and stale translations can pass CI.🤖 Prompt for AI Agents