Skip to content

Commit ee4fe4f

Browse files
committed
feat(ui): add control ui locale sync pipeline
1 parent 21d5f7a commit ee4fe4f

8 files changed

Lines changed: 1242 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,11 @@ jobs:
743743
continue-on-error: true
744744
run: pnpm lint:ui:no-raw-window-open
745745

746+
- name: Check control UI locale sync
747+
id: control_ui_i18n
748+
continue-on-error: true
749+
run: pnpm ui:i18n:check
750+
746751
- name: Run gateway watch regression harness
747752
id: gateway_watch_regression
748753
continue-on-error: true
@@ -775,6 +780,7 @@ jobs:
775780
EXTENSION_PLUGIN_SDK_INTERNAL_BOUNDARY_OUTCOME: ${{ steps.extension_plugin_sdk_internal_boundary.outcome }}
776781
EXTENSION_RELATIVE_OUTSIDE_PACKAGE_BOUNDARY_OUTCOME: ${{ steps.extension_relative_outside_package_boundary.outcome }}
777782
NO_RAW_WINDOW_OPEN_OUTCOME: ${{ steps.no_raw_window_open.outcome }}
783+
CONTROL_UI_I18N_OUTCOME: ${{ steps.control_ui_i18n.outcome }}
778784
GATEWAY_WATCH_REGRESSION_OUTCOME: ${{ steps.gateway_watch_regression.outcome }}
779785
run: |
780786
failures=0
@@ -795,6 +801,7 @@ jobs:
795801
"extension-plugin-sdk-internal-boundary|$EXTENSION_PLUGIN_SDK_INTERNAL_BOUNDARY_OUTCOME" \
796802
"extension-relative-outside-package-boundary|$EXTENSION_RELATIVE_OUTSIDE_PACKAGE_BOUNDARY_OUTCOME" \
797803
"lint:ui:no-raw-window-open|$NO_RAW_WINDOW_OPEN_OUTCOME" \
804+
"ui:i18n:check|$CONTROL_UI_I18N_OUTCOME" \
798805
"gateway-watch-regression|$GATEWAY_WATCH_REGRESSION_OUTCOME"; do
799806
name="${result%%|*}"
800807
outcome="${result#*|}"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Control UI Locale Refresh
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
schedule:
8+
- cron: "23 4 * * *"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
concurrency:
15+
group: control-ui-locale-refresh
16+
cancel-in-progress: false
17+
18+
jobs:
19+
refresh:
20+
if: github.repository == 'openclaw/openclaw'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v6
25+
with:
26+
persist-credentials: true
27+
submodules: false
28+
29+
- name: Setup Node environment
30+
uses: ./.github/actions/setup-node-env
31+
with:
32+
install-bun: "false"
33+
use-sticky-disk: "false"
34+
35+
- name: Ensure translation provider secrets exist
36+
env:
37+
OPENAI_API_KEY: ${{ secrets.OPENCLAW_CONTROL_UI_I18N_OPENAI_API_KEY }}
38+
ANTHROPIC_API_KEY: ${{ secrets.OPENCLAW_CONTROL_UI_I18N_ANTHROPIC_API_KEY }}
39+
run: |
40+
set -euo pipefail
41+
if [ -z "${OPENAI_API_KEY:-}" ] && [ -z "${ANTHROPIC_API_KEY:-}" ]; then
42+
echo "Missing control UI i18n provider secret."
43+
exit 1
44+
fi
45+
46+
- name: Refresh control UI locale files
47+
env:
48+
OPENAI_API_KEY: ${{ secrets.OPENCLAW_CONTROL_UI_I18N_OPENAI_API_KEY }}
49+
ANTHROPIC_API_KEY: ${{ secrets.OPENCLAW_CONTROL_UI_I18N_ANTHROPIC_API_KEY }}
50+
run: pnpm ui:i18n:sync
51+
52+
- name: Commit and push locale updates
53+
env:
54+
TARGET_BRANCH: ${{ github.event.repository.default_branch }}
55+
run: |
56+
set -euo pipefail
57+
if git diff --quiet; then
58+
echo "No control UI locale changes."
59+
exit 0
60+
fi
61+
62+
git config user.name "github-actions[bot]"
63+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
64+
git add ui/src/i18n package.json scripts/control-ui-i18n.ts
65+
git commit -m "chore(ui): refresh control UI locale files"
66+
git push origin HEAD:"${TARGET_BRANCH}"

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@
10721072
"test:startup:bench:smoke": "node --import tsx scripts/bench-cli-startup.ts --preset real --case gatewayStatusJson --runs 1 --warmup 0 --output .artifacts/cli-startup-bench-smoke.json",
10731073
"test:startup:bench:update": "node scripts/test-update-cli-startup-bench.mjs",
10741074
"test:startup:memory": "node scripts/check-cli-startup-memory.mjs",
1075-
"test:ui": "pnpm lint:ui:no-raw-window-open && pnpm --dir ui test",
1075+
"test:ui": "pnpm ui:i18n:check && pnpm lint:ui:no-raw-window-open && pnpm --dir ui test",
10761076
"test:voicecall:closedloop": "node scripts/test-voicecall-closedloop.mjs",
10771077
"test:watch": "node scripts/run-vitest.mjs --config vitest.config.ts",
10781078
"tool-display:check": "node --import tsx scripts/tool-display.ts --check",
@@ -1083,6 +1083,8 @@
10831083
"tui:dev": "OPENCLAW_PROFILE=dev node scripts/run-node.mjs --dev tui",
10841084
"ui:build": "node scripts/ui.js build",
10851085
"ui:dev": "node scripts/ui.js dev",
1086+
"ui:i18n:check": "node --import tsx scripts/control-ui-i18n.ts check",
1087+
"ui:i18n:sync": "node --import tsx scripts/control-ui-i18n.ts sync --write",
10861088
"ui:install": "node scripts/ui.js install"
10871089
},
10881090
"dependencies": {

0 commit comments

Comments
 (0)