mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
Translate the whole management console and let the operator pick a language without replacing the shipped copy. - webui/i18n.js holds the dictionaries only; the Simplified Chinese text stays in index.html and app.js and is the fallback for every untranslated string, so a new locale never rewrites the original. - Static text uses data-i18n / data-i18n-attr hooks, JavaScript text goes through t(); a locale switch re-renders both without a reload, and the choice persists in localStorage under opencode2api.ui.lang. - The switcher is a flag button in the toolbar and on the login card that opens a menu of every supported locale. Flags are inline SVG, because Unicode flag emoji renders as plain letters on Windows. - Ships 简体中文 (original), English and Tiếng Việt. - README.vi.md translates the full README; all three READMEs cross-link and document how to add a locale.
61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
name: Checks
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: checks-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Go ${{ matrix.go }} / ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
go: ["1.24.x", stable]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
cache: true
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Build
|
|
run: go build -trimpath ./cmd/opencode2api
|
|
|
|
format:
|
|
name: Formatting and WebUI syntax
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
- name: Check Go formatting
|
|
shell: bash
|
|
run: |
|
|
unformatted="$(gofmt -l .)"
|
|
if [ -n "$unformatted" ]; then
|
|
printf '%s\n' "$unformatted"
|
|
exit 1
|
|
fi
|
|
- name: Check WebUI syntax
|
|
run: |
|
|
node --check webui/app.js
|
|
node --check webui/i18n.js
|
|
- name: Check container entrypoint syntax
|
|
run: sh -n docker-entrypoint.sh
|