Skip to content

Commit 7cbb45b

Browse files
authored
Merge pull request #395 from bitrise-io/update-translation-workflow
Change translation workflow trigger to manual
2 parents c2fa1c1 + 1c155c4 commit 7cbb45b

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

‎.github/workflows/translate-ja-docs.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# =====================================================================
22
# Translate changed English docs to Japanese on PRs
33
# =====================================================================
4+
5+
# !!!THIS WORKFLOW IS NOT USED. DO NOT READ ANY FURTHER: THE WORKFLOW IS KEPT FOR POSSIBLE FUTURE USE ONLY.!!!
6+
47
# When a PR changes English docs, translate ONLY the changed files to Japanese
58
# and commit the JA versions back to the PR branch. This keeps JA in
69
# lock-step with EN — it can never silently go stale. Added/modified pages
@@ -37,13 +40,14 @@
3740
name: Translate docs to Japanese
3841

3942
on:
40-
pull_request:
41-
types: [opened, synchronize]
42-
paths:
43-
- 'docs/**/*.md' # <-- adjust to your English docs location
44-
- 'docs/**/*.mdx'
45-
- 'src/partials/**/*.mdx' # reusable partials are translated too
46-
- 'docs/**/_category_.json' # sidebar labels feed translate_ui_strings.py
43+
workflow_dispatch:
44+
# pull_request:
45+
# types: [opened, synchronize]
46+
# paths:
47+
# - 'docs/**/*.md' # <-- adjust to your English docs location
48+
# - 'docs/**/*.mdx'
49+
# - 'src/partials/**/*.mdx' # reusable partials are translated too
50+
# - 'docs/**/_category_.json' # sidebar labels feed translate_ui_strings.py
4751

4852
# A fast-follow push to the same PR (a very ordinary thing to do — push,
4953
# notice something, push again) starts a new run while the previous one may
@@ -64,6 +68,7 @@ permissions:
6468

6569
jobs:
6670
check-key:
71+
if: github.event_name == 'pull_request'
6772
runs-on: ubuntu-latest
6873
outputs:
6974
enabled: ${{ steps.key.outputs.enabled }}

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ Anything reused across pages: a setup-prerequisites paragraph, a "how to open th
341341

342342
### Japanese translations of partials
343343

344-
Every partial is also translated: `src/partials/<slug>.mdx` → `i18n/ja/partials/<slug>.mdx`, by `translate_docs.py` (the workflow watches `src/partials/` too). Translated pages import the Japanese copy (`@site/i18n/ja/partials/<slug>.mdx`) instead of the English one; list-context references are filled from the Japanese copy by `docusaurus.config.ts` for pages under `i18n/ja/`. Edit only the English partial — never the `i18n/ja/partials/` copy.
344+
Every partial is also translated: `src/partials/<slug>.mdx` → `i18n/ja/partials/<slug>.mdx`, by `translate_docs.py`, or by `scripts/ja_manual_translate.py` when no API key is available (`scripts/detect_ja_drift.py` lists the missing and stale partials and pages). Translated pages import the Japanese copy (`@site/i18n/ja/partials/<slug>.mdx`) instead of the English one; list-context references are filled from the Japanese copy by `docusaurus.config.ts` for pages under `i18n/ja/`. Edit only the English partial — never the `i18n/ja/partials/` copy.
345345

346346
### Japanese UI strings and frontmatter
347347

‎localization/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A self-updating system that (1) keeps a **UI copy library** in sync with the liv
2222
| `ja-preferred-translations.yaml` | Human-owned terminology-consistency map — one approved Japanese rendering per English term we *do* translate (e.g. "build number" → "ビルド番号"). Separate from the glossary because the glossary is regenerated weekly and would overwrite it. |
2323
| `JA-TRANSLATION-GUIDE.md` | House rules for the translation (register, orthography, terminology) with a LIVE/PROCESS/ROADMAP status legend. |
2424
| `.github/workflows/refresh-ui-library.yml` | Weekly + on-demand: rebuilds the library/glossary and opens a PR if anything changed — touching only `localization/`, a diff a human can actually review. |
25-
| `.github/workflows/translate-ja-docs.yml` | On docs PRs: translates the changed pages and commits the JA versions. **Ships disabled** — gated on the existence of the `ANTHROPIC_API_KEY` secret; until it's added, the job skips silently on every PR. |
25+
| `.github/workflows/translate-ja-docs.yml` | Translate-on-PR workflow. **Not used**: its `pull_request` trigger is commented out, so it never runs or appears as a check on PRs. To bring Japanese pages up to date, `scripts/detect_ja_drift.py` lists the missing and stale pages and `scripts/ja_manual_translate.py` translates them without an API key. |
2626
| `.github/workflows/ja-style-check.yml` + `.textlintrc.yaml` | Runs the JTF Japanese Standard Style Guide checker (textlint) on changed JA docs — the automated stand-in for a native reviewer on style/orthography, not meaning. |
2727

2828
## How it flows
@@ -66,7 +66,7 @@ A self-updating system that (1) keeps a **UI copy library** in sync with the liv
6666
2. Add `NT` to the `ALLOWED` set in `docusaurus.config.ts`'s markdown preprocessor — it escapes any JSX tag name not on that list, so without this a manual `<NT>` renders as literal escaped text instead of the component.
6767
3. Add the `CI_REPO_TOKEN` repo secret — a PAT or GitHub App token with **read** access to `bitrise-website`, `bitrise-workflow-editor`, `bitrise-codespaces`, `bitkit`, `bitrise-steplib` (the default `GITHUB_TOKEN` can't read other repos).
6868
4. Enable Actions. Run **Refresh UI copy library** once manually to seed `localization/`. No tagging pass is needed — the docs source stays as-is; protection is applied at translation time.
69-
5. When enough pages are migrated to keep `/ja/` in lock-step, add the `ANTHROPIC_API_KEY` repo secret — its existence is the ON switch for translate-on-PR. Until then the job skips silently on every docs PR.
69+
5. Translate-on-PR is switched off on purpose. To bring it back, restore the `pull_request` trigger in `translate-ja-docs.yml` and add the `ANTHROPIC_API_KEY` repo secret.
7070

7171
## Run locally (no CI)
7272

0 commit comments

Comments
 (0)