Skip to content

Commit dbf2c45

Browse files
committed
chore: updated locale glossaries and docs sync workflow
1 parent c45ab71 commit dbf2c45

File tree

16 files changed

+446
-6
lines changed

16 files changed

+446
-6
lines changed

.github/workflows/docs-locale-sync.yml

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ jobs:
1212
if: github.actor != 'opencode-agent[bot]'
1313
runs-on: blacksmith-4vcpu-ubuntu-2404
1414
permissions:
15-
id-token: write
1615
contents: write
1716
steps:
1817
- name: Checkout repository
1918
uses: actions/checkout@v4
2019
with:
20+
persist-credentials: false
2121
fetch-depth: 0
22+
ref: ${{ github.ref_name }}
2223

2324
- name: Setup Bun
2425
uses: ./.github/actions/setup-bun
@@ -51,9 +52,54 @@ jobs:
5152
uses: sst/opencode/github@latest
5253
env:
5354
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
55+
GITHUB_TOKEN: ${{ steps.committer.outputs.token }}
56+
OPENCODE_CONFIG_CONTENT: |
57+
{
58+
"permission": {
59+
"*": "deny",
60+
"read": {
61+
"*": "deny",
62+
"packages/web/src/content/docs": "allow",
63+
"packages/web/src/content/docs/*": "allow",
64+
"packages/web/src/content/docs/*.mdx": "allow",
65+
"packages/web/src/content/docs/*/*.mdx": "allow",
66+
".opencode": "allow",
67+
".opencode/agent": "allow",
68+
".opencode/agent/glossary": "allow",
69+
".opencode/agent/translator.md": "allow",
70+
".opencode/agent/glossary/*.md": "allow"
71+
},
72+
"edit": {
73+
"*": "deny",
74+
"packages/web/src/content/docs/*/*.mdx": "allow"
75+
},
76+
"glob": {
77+
"*": "deny",
78+
"packages/web/src/content/docs*": "allow",
79+
".opencode/agent/glossary*": "allow"
80+
},
81+
"task": {
82+
"*": "deny",
83+
"translator": "allow"
84+
}
85+
},
86+
"agent": {
87+
"translator": {
88+
"permission": {
89+
"*": "deny",
90+
"read": {
91+
"*": "deny",
92+
".opencode/agent/translator.md": "allow",
93+
".opencode/agent/glossary/*.md": "allow"
94+
}
95+
}
96+
}
97+
}
98+
}
5499
with:
55-
model: opencode/gpt-5.2
100+
model: opencode/gpt-5.3-codex
56101
agent: docs
102+
use_github_token: true
57103
prompt: |
58104
Update localized docs to match the latest English docs changes.
59105
@@ -67,10 +113,11 @@ jobs:
67113
2. You MUST use the Task tool for translation work and launch subagents with subagent_type `translator` (defined in .opencode/agent/translator.md).
68114
3. Do not translate directly in the primary agent. Use translator subagent output as the source for locale text updates.
69115
4. Run translator subagent Task calls in parallel whenever file/locale translation work is independent.
70-
5. Preserve frontmatter keys, internal links, code blocks, and existing locale-specific metadata unless the English change requires an update.
71-
6. Keep locale docs structure aligned with their corresponding English pages.
72-
7. Do not modify English source docs in packages/web/src/content/docs/*.mdx.
73-
8. If no locale updates are needed, make no changes.
116+
5. Use only the minimum tools needed for this task (read/glob, file edits, and translator Task). Do not use shell, web, search, or GitHub tools for translation work.
117+
6. Preserve frontmatter keys, internal links, code blocks, and existing locale-specific metadata unless the English change requires an update.
118+
7. Keep locale docs structure aligned with their corresponding English pages.
119+
8. Do not modify English source docs in packages/web/src/content/docs/*.mdx.
120+
9. If no locale updates are needed, make no changes.
74121
75122
- name: Commit and push locale docs updates
76123
if: steps.changes.outputs.has_changes == 'true'

.opencode/agent/glossary/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The global glossary in `translator.md` remains the source of truth for shared do
99
- One file per locale
1010
- Use lowercase locale slugs that match docs locales when possible (for example, `zh-cn.md`, `zh-tw.md`)
1111
- If only language-level guidance exists, use the language code (for example, `fr.md`)
12+
- Some repo locale slugs may be aliases/non-BCP47 for consistency (for example, `br` for Brazilian Portuguese / `pt-BR`)
1213

1314
## What To Put In A Locale File
1415

@@ -17,6 +18,7 @@ The global glossary in `translator.md` remains the source of truth for shared do
1718
- **Preferred Terms**: recurring UI/docs words with preferred translations
1819
- **Guidance**: tone, style, and consistency notes
1920
- **Avoid** (optional): common literal translations or wording we should avoid
21+
- If the repo uses a locale alias slug, document the alias in **Guidance** (for example, prose may mention `pt-BR` while config/examples use `br`)
2022

2123
Prefer guidance that is:
2224

@@ -58,3 +60,4 @@ Prefer guidance that is:
5860
- Mark entries as preferred when they may evolve
5961
- Keep examples short
6062
- Add or update the `Sources` section whenever you add a new rule
63+
- Prefer PR-backed guidance over invented term mappings; start with general guidance if no term-level corrections exist yet

.opencode/agent/glossary/ar.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ar Glossary
2+
3+
## Sources
4+
5+
- PR #9947: https://github.com/anomalyco/opencode/pull/9947
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
17+
18+
## Guidance
19+
20+
- Prefer natural Arabic phrasing over literal translation
21+
- Keep tone clear and direct in UI labels and docs prose
22+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
23+
- For RTL text, treat code, commands, and paths as LTR artifacts and keep their character order unchanged
24+
25+
## Avoid
26+
27+
- Avoid translating product and protocol names that are fixed identifiers
28+
- Avoid mixing multiple Arabic terms for the same recurring UI action once a preferred term is established

.opencode/agent/glossary/br.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# br Glossary
2+
3+
## Sources
4+
5+
- PR #10086: https://github.com/anomalyco/opencode/pull/10086
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Locale code `br` in repo config, code, and paths (repo alias for Brazilian Portuguese)
13+
14+
## Preferred Terms
15+
16+
These are PR-backed locale naming preferences and may evolve.
17+
18+
| English / Context | Preferred | Notes |
19+
| ---------------------------------------- | ------------------------------ | ------------------------------------------------------------- |
20+
| Brazilian Portuguese (prose locale name) | `pt-BR` | Use standard locale naming in prose when helpful |
21+
| Repo locale slug (code/config) | `br` | PR #10086 uses `br` for consistency/simplicity |
22+
| Browser locale detection | `pt`, `pt-br`, `pt-BR` -> `br` | Preserve this mapping in docs/examples about locale detection |
23+
24+
## Guidance
25+
26+
- This file covers Brazilian Portuguese (`pt-BR`), but the repo locale code is `br`
27+
- Use natural Brazilian Portuguese phrasing over literal translation
28+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
29+
- Keep repo locale identifiers as implemented in code/config (`br`) even when prose mentions `pt-BR`
30+
31+
## Avoid
32+
33+
- Avoid changing repo locale code references from `br` to `pt-br` in code snippets, paths, or config examples
34+
- Avoid mixing Portuguese variants when a Brazilian Portuguese form is established

.opencode/agent/glossary/bs.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# bs Glossary
2+
3+
## Sources
4+
5+
- PR #12283: https://github.com/anomalyco/opencode/pull/12283
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
These are PR-backed locale naming preferences and may evolve.
17+
18+
| English / Context | Preferred | Notes |
19+
| ---------------------------------- | ---------- | ------------------------------------------------- |
20+
| Bosnian language label (UI) | `Bosanski` | PR #12283 tested switching language to `Bosanski` |
21+
| Repo locale slug (code/config) | `bs` | Preserve in code, config, paths, and examples |
22+
| Browser locale detection (Bosnian) | `bs` | PR #12283 added `bs` locale auto-detection |
23+
24+
## Guidance
25+
26+
- Use natural Bosnian phrasing over literal translation
27+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
28+
- Keep repo locale references as `bs` in code/config, and use `Bosanski` for the user-facing language name when applicable
29+
30+
## Avoid
31+
32+
- Avoid changing repo locale references from `bs` to another slug in code snippets or config examples
33+
- Avoid translating product and protocol names that are fixed identifiers

.opencode/agent/glossary/da.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# da Glossary
2+
3+
## Sources
4+
5+
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
17+
18+
## Guidance
19+
20+
- Prefer natural Danish phrasing over literal translation
21+
- Keep tone clear and direct in UI labels and docs prose
22+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
23+
24+
## Avoid
25+
26+
- Avoid translating product and protocol names that are fixed identifiers
27+
- Avoid mixing multiple Danish terms for the same recurring UI action once a preferred term is established

.opencode/agent/glossary/de.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# de Glossary
2+
3+
## Sources
4+
5+
- PR #9817: https://github.com/anomalyco/opencode/pull/9817
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
17+
18+
## Guidance
19+
20+
- Prefer natural German phrasing over literal translation
21+
- Keep tone clear and direct in UI labels and docs prose
22+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
23+
24+
## Avoid
25+
26+
- Avoid translating product and protocol names that are fixed identifiers
27+
- Avoid mixing multiple German terms for the same recurring UI action once a preferred term is established

.opencode/agent/glossary/es.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# es Glossary
2+
3+
## Sources
4+
5+
- PR #9817: https://github.com/anomalyco/opencode/pull/9817
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
17+
18+
## Guidance
19+
20+
- Prefer natural Spanish phrasing over literal translation
21+
- Keep tone clear and direct in UI labels and docs prose
22+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
23+
24+
## Avoid
25+
26+
- Avoid translating product and protocol names that are fixed identifiers
27+
- Avoid mixing multiple Spanish terms for the same recurring UI action once a preferred term is established

.opencode/agent/glossary/fr.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# fr Glossary
2+
3+
## Sources
4+
5+
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
6+
7+
## Do Not Translate (Locale Additions)
8+
9+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
10+
- `OpenCode CLI`
11+
- `CLI`, `TUI`, `MCP`, `OAuth`
12+
- Commands, flags, file paths, and code literals (keep exactly as written)
13+
14+
## Preferred Terms
15+
16+
No PR-backed term mappings yet. Add entries here when review PRs introduce repeated wording corrections.
17+
18+
## Guidance
19+
20+
- Prefer natural French phrasing over literal translation
21+
- Keep tone clear and direct in UI labels and docs prose
22+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
23+
24+
## Avoid
25+
26+
- Avoid translating product and protocol names that are fixed identifiers
27+
- Avoid mixing multiple French terms for the same recurring UI action once a preferred term is established

.opencode/agent/glossary/ja.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ja Glossary
2+
3+
## Sources
4+
5+
- PR #9821: https://github.com/anomalyco/opencode/pull/9821
6+
- PR #13160: https://github.com/anomalyco/opencode/pull/13160
7+
8+
## Do Not Translate (Locale Additions)
9+
10+
- `OpenCode` (preserve casing in prose; keep `opencode` only in commands, package names, paths, or code)
11+
- `OpenCode CLI`
12+
- `CLI`, `TUI`, `MCP`, `OAuth`
13+
- Commands, flags, file paths, and code literals (keep exactly as written)
14+
15+
## Preferred Terms
16+
17+
These are PR-backed wording preferences and may evolve.
18+
19+
| English / Context | Preferred | Notes |
20+
| --------------------------- | ----------------------- | ------------------------------------- |
21+
| WSL integration (UI label) | `WSL連携` | PR #13160 prefers this over `WSL統合` |
22+
| WSL integration description | `WindowsのWSL環境で...` | PR #13160 improved phrasing naturally |
23+
24+
## Guidance
25+
26+
- Prefer natural Japanese phrasing over literal translation
27+
- Preserve technical artifacts exactly: commands, flags, code, URLs, model IDs, and file paths
28+
- In WSL integration text, follow PR #13160 wording direction for more natural Japanese phrasing
29+
30+
## Avoid
31+
32+
- Avoid `WSL統合` in the WSL integration UI context where `WSL連携` is the reviewed wording
33+
- Avoid translating product and protocol names that are fixed identifiers

0 commit comments

Comments
 (0)