i18n: 11-language UI localization (Phase 0–2)#6
Merged
Merged
Conversation
PDIndexer/doc/ (Word-exported HTML help, PDIndexerManual(ja).pdf/docx,
PDIndexerAlgorithm.pdf; ~5.4 MB, 103 files) is fully superseded by the
docs/ MkDocs manual, so remove it from tracking and from the release.
- Migrate PDIndexerAlgorithm.pdf content (linear-LSQ cell refinement,
Marquardt fitting, Pseudo-Voigt / Pearson VII / Toraya-1990 split
profile functions with their derivatives, cubic-spline background) to a
new appendix page docs/src/{ja,en}/appendix/algorithms.md and wire it
into the mkdocs nav. `mkdocs build --strict` passes.
- Drop the doc\*.pdf CopyToOutputDirectory entries from PDIndexer.csproj;
WiX harvests the publish output, so the PDFs leave both the MSI and the
portable ZIP automatically.
The in-app "manual" menu repoint (FormPDF -> online Pages) lives in
FormMain.cs and is intentionally held back here: it depends on the
in-progress i18n Phase 0 helpers (HelpCulture/SupportedCultures) and will
land together with that work.
Side effect: GitHub's language bar stops over-counting HTML (the bulky
Word-export help dominated tracked bytes while *.Designer.cs is excluded
as generated).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tions) Phase 0 (app plumbing): - Bump Crystallography (be93c25) / Crystallography.Controls (b40c33e) submodules to adopt the L10n->Localization rename + folder reorg. - FormMain: dynamic language menu from SupportedCultures.All with Application.Restart()-based switching (PopulateLanguageMenu / UpdateLanguageMenuChecks / LanguageMenuItemCulture). - Gate F1/help + bundled-PDF URLs via HelpCulture()/manualReadyCultures (en/ja behavior unchanged, N-language ready). - Generalize --capture to SupportedCultures (Program.cs + GuiCapture.cs). Phase 1 (translations, 11 languages total): - tools/: i18n pipeline ported from ReciPro (gen_de_resx, check_resx_textonly, snap_neutral_font_tiers) + new harvest/units/langconf/apply scripts. - 117 culture resx (de/fr/es/pt/it/ru/zh-Hans/zh-Hant/ko x 13 forms), translated via translate+verify workflow using IUCr/Termonline glossaries. - text-only (layout falls back to neutral), lint 0 violations, build 0 errors, all 9 PDIndexer.resources.dll satellites, 100% key coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ic strings) Localizable=false の全フォーム (FormExportGSAS/FormLimitChanger/FormLPO/ FormCellFinder/FormAtomicPositionFinder/FormTwoThetaCalibration/FormPrintOption) の Designer 直書きラベルを中央レジストリ PDIndexerLocalizationData.cs (7 form / 115 entries, FullName キー) で多言語化し、CodeLocalizer が OnLoad で差替。 実行時にコードで組み立てる動的文字列 27 件を PdiText.cs (Loc アクセサ) へ集約: - ボタン状態 (Find!/Stop!/Start/Resume/Calibrate <-> NowCalibrating) を文字列比較から bool へ分離してから Loc 化 - status format / MessageBox 7本文+5タイトル / 日本語only 2件の英語 canonical 化 (Difraction typo 修正) / 起動スプラッシュ永続2件 - ボタン訳に合わせ buttonFind/buttonStart ツールチップから 'Stop!' を除去・リワード 起動スプラッシュ流動19件と FormMain の科学記号ラベル (q:/Int:/2θ/Energy/TOF) は 英語固定 (作者決定 / 記号・単位保持)。 submodule: Crystallography (AddProvider) / Crystallography.Controls (CodeLocalizer FullName) を origin/main へ push 済 (後方互換)。 tools: i18n_codescan / i18n_gen_codedata / i18n_gen_dynamic / i18n_apply_tooltips。 dotnet build 0 エラー。FormMain.Designer.cs/.resx は Codex の無関係 designer 差分の ため本コミットから除外。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
翻訳でテキスト長が変わったときラベル/ボタンが切れる・重なる箇所を、目視でなく 機械的に検出する。ReciPro の GuiCapture.Diagnose.cs を PDIndexer のフォーム構造 (FormMain + 配線済み子フォーム + reflection 単独フォーム) へ適合。各テキスト保持 コントロールの必要幅/高さと実寸を比較し TSV 出力。--capture と異なり CopyFromScreen を使わず画面外で測る。Program.cs に --diagnose [culture] [inflate%] を追加。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ported from CSManager's v.1.912 release findings: - prepare checkout used fetch-depth:0 (full history); only the commit time of GITHUB_SHA (HEAD) is needed, so fetch-depth:2 suffices and avoids prepare timeouts on heavy repos. - the release job has no checkout, so gh release create needs -R $GITHUB_REPOSITORY (else "fatal: not a git repository"). Only the prepare checkout and the release step are touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitHub Pages マニュアルを ReciPro と同方針の mkdocs-static-i18n 構成へ移行し、 11 言語化の配管を確立 (Phase 0 = EN/JA のみで配管を安定化、新言語は未追加)。 - requirements.txt: mkdocs-static-i18n==1.3.1 を pin (maintenance-mode のため固定) - docs/src/index.md → docs/src/en/index.md へ移設 (EN ホーム正本化)。 画像 ../assets、内部リンクの en/ 接頭辞剥がし - mkdocs.yml: i18n プラグイン (folder mode, en(default=ルート)/ja, fallback_to_default, reconfigure_material/search, ja nav_translations 15)。 navigation.tabs 撤去・nav を英語 1 本化・extra.alternate 撤去・language_switch.js 参照除去 - docs/hooks/legacy_en_redirects.py: 旧 /en/<slug>/ → ルート /<slug>/ の meta-refresh stub を post-build 生成 (mkdocs-redirects は再ホーム後ルートを target にできないため。ReciPro 実測の壁) - docs/overrides/main.html: 未訳=英語フォールバックを知らせるバナー (全 11 言語分岐を用意) - language_switch.js 削除 (reconfigure_material が現在ページ保持セレクタを自動構成) - FormMain.cs: F1/helpweb の URL を en ルート化 (en は接頭辞なし、ja=/ja/、将来言語=/<lang>/) - README.md: /en/8-macro/ → /8-macro/ ローカル mkdocs build --strict 通過。en ルート・ja /ja/・/en/ stub・言語セレクタ現在ページ保持・ バナー infra を site 出力で確認。dotnet build 0 エラー。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
マニュアル用スクショの見栄え改善 (作者指定)。 - GuiCapture: RepoRoot() を抽出し、RepresentativeProfilePath() (references/FE01-03.pdi、 git 管理外で不在なら null) を PrepareCaptureRepresentativeState へ渡す。 - FormMain.PrepareCaptureRepresentativeState: 代表プロファイルがあれば readProfile で読み込み、 空グラフでなく実測パターンで撮る。重ねる結晶は標準物質 Au/MgO/Si 複数から 「Fe2SiO4 (fayalite)」一つだけ (名前検索・index 非依存) へ変更 (FE01-03 は fayalite 試料で線がパターンと一致)。 スモークテスト (--capture en, RDP): FormMain で "capture crystal=Fe2SiO4 (fayalite)" を確認、 .pdi 読込は例外なく完了。CopyFromScreen 失敗は前面でない RDP セッションの既知環境制約 (実機前面で解消)。 dotnet build 0 エラー。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mkdocs-static-i18n に de/fr/es/it/ru/zh-Hans/zh-Hant/ko/pt を追加し、GUI と同じ 11 言語の Pages 配管を確立 (ページ本文はまだ未訳=fallback_to_default で英語フォールバック+バナー)。 - docs/mkdocs.yml: 9 言語ブロック (build: true, nav_translations 各 15)。共通ラベル (Home/Main window/Macro/Appendix/Troubleshooting) は ReciPro の検証済み訳に揃え、固有ラベル (Pattern profiles/Crystal parameter/Equation of states/Fitting diffraction peaks 等) は結晶学標準用語で訳出。 - docs/overrides/partials/languages/zh-Hans.html: Material の zh パーシャルを zh-Hans へ再エクスポート (locale 名を GUI CultureInfo 名 zh-Hans に合わせるため必要。ReciPro と同方針)。 ローカル mkdocs build --strict 通過 (全 11 locale ビルド・各言語 "Translated 15 navigation elements"・ de/ru 等の未訳ページに英語フォールバックバナー・言語セレクタ 11 件・zh-Hans パーシャル動作・ 検索 lang は lunr 対応の de/fr/es/it/ru/ko/pt を自動追加, zh-Hans/zh-Hant は除外)。 ⚠ 各言語のページ本文翻訳・スクショ (cap-<lang>-auto) はこの後 (撮影が前面セッションを要するため別ワークストリーム)。 本文翻訳前に push する場合は英語フォールバック公開の可否を要確認。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
翻訳でラベル/ボタンが切れる箇所を --diagnose で機械検出し、neutral resx の Size/Location 調整と Designer.cs のボタン幅拡大で解消。全ローカル修正で 共有 submodule は未編集。--diagnose 全11言語 Error 0、--capture ru で視覚検証。 - FormMain: tabControl 拡幅 + tabControl1 右移動(Panel1内・フォーム/プロット不変) - FormDataConverter: 子が Dock=Top のためフォーム ClientSize のみ拡張 - FormCrystal: groupBox2 拡幅 + ボタン + フォーム拡幅(groupBox3 の Fill=crystalControl を保持) - FormFitting: groupBox 拡幅 + 列右シフト + form 拡幅。左右ラジオ列(Симметричный/Расщеплённый)の重なりも解消(diagnose 盲点) - FormSequentialAnalysis: Copy/Save 2ボタンを縦積み(行に横余地なし) - FormProfileSetting/FormCellFinder: ボタン幅拡大 - FormLPO: ボタン拡幅 + a/b/c プロット群を右シフト・フォーム拡幅(重なり回避) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
check_resx_textonly.py --fix を PDIndexer アプリ root 限定で実行し、12個の ja.resx から layout(.Size/.Location/.Padding 等)を除去(.Text/.ToolTip 等は保持)。 ja は neutral レイアウトを継承し text-only ポリシーに準拠。lint 違反 596→108。 FormCrystal.ja.resx は strip すると共有 SymmetryControl の単位ラジオ(nm/Å)が ja フォントで neutral レイアウトに収まらず ClippedByParent になるため doc fallback で revert(残108違反はこの1ファイルのみ=共有 submodule 側課題)。--diagnose ja Error 0。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
buttonResume_Click の worker 起動時に buttonResume.Enabled=false を追加 (buttonStart_Click と対称)。二度押しで backgroundWorker が二重起動するのを防ぐ。 完了(RunWorkerCompleted)/停止時に再有効化。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ReciPro tools/check_md_translation.py を PDIndexer/tools へ移植 (Phase 4 ページ翻訳の品質ゲート)。 en 原文と各言語訳を突き合わせ、コード/数式(LaTeX multiset)/リンク先/画像パス(cap正規化)/明示アンカー/ frontmatter/見出し本数を凍結チェックし、不一致で非ゼロ終了。mkdocs --strict が拾わないアンカー切れの一次防衛線。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
--capture を全11言語 (en/ja/de/fr/es/it/ru/zh-Hans/zh-Hant/ko/pt) で実行し、各言語 49 枚の GUI スクリーンショットを生成 (cap-<lang>-auto)。代表状態は references/FE01-03.pdi (fayalite 実測 37 プロファイル) 読込 + Fe2SiO4 (fayalite) 単独選択で、回折線がパターンと一致した見栄えの良い図。 - de + 8 言語 (fr/es/it/ru/zh-Hans/zh-Hant/ko/pt) を新規追加、en/ja は新代表状態で再撮影し全言語統一。 - 各言語 done: ok=16 fail=0 (CopyFromScreen 成功、セッション前面)。各フォームの UI は対象言語の resx で ローカライズ表示 (例 de: Kristallparameter / Profilparameter / Zustandsgleichung)。 - _capture-log.tsv は一過性のため非コミット (従来どおり .gitkeep + *.png のみ追跡)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
de パイロット翻訳を Workflow (translate→敵対的検証) で実施。14ページ全 clean、
check_md_translation.py 14/14 OK、mkdocs build --strict 通過 (全11 locale)。画像は cap-de-auto へ retarget、
UI 用語は de.resx に整合 (Kristallparameter/Zustandsgleichungen 等)。
de パイロットが「ページ内アンカー drift」を炙り出した (codex 協議で対処確定):
- EN のリンク対象見出し4箇所に明示 {#stable-anchor} (= 現 auto-slug) を付与し、翻訳で見出し slug が
変わってもページ内リンクが解決するようにした (1-main-window: #horizontal-axis-tab /
3-crystal-parameter: #atom-info-tab, #calculate-intensity-ratio, #crystal-information)。EN 公開 URL は不変。
- de の対応見出しに同じ {#...} を手パッチ (再翻訳せず最小修正、codex 推奨)。
- tools/check_md_translation.py 強化 (codex 助言): ①コードフェンス本文の内容 multiset 検証
(8-macro.md の API/関数名改竄を捕捉) ②ページ内 #link が明示 {#anchor} に解決するか自己整合検査。
残り8言語 (fr/es/it/ru/zh-Hans/zh-Hant/ko/pt) は EN にアンカーが入ったので凍結で継承される。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fr/es を Workflow (translate→敵対的検証) で翻訳。画像 cap-<lang>-auto retarget、UI 用語は各 resx 整合、
ページ内アンカーは EN の明示 {#...} を凍結継承。check_md_translation.py 各14/14 OK、mkdocs build --strict 通過。
- fr: 14/14 敵対的検証 clean。
- es: 14/14 翻訳・ハーネス clean。うち4ページ (3-crystal/5-eos/7-sequential/8-macro) は週次利用上限
(Jul 1 12pm Tokyo リセット) で敵対的検証が未完 → Jul 1 以降に再検証予定。3-crystal のタブ見出し
残り2件 (Basic Info./Atom Info.) は fr パターンに合わせ手修正済 (Información básica/atómica)。
残り6言語 (it/pt/ru/ko/zh-Hans/zh-Hant) は週次上限のため Jul 1 以降。EN にアンカー整備済で凍結継承される。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
it/pt を Workflow (translate→敵対的検証) で翻訳。画像 cap-<lang>-auto retarget、UI 用語は各 resx 整合、
ページ内アンカーは EN の明示 {#...} を凍結継承。check_md_translation.py 各14/14 OK、mkdocs build --strict 通過。
- it: 14/14 敵対的検証 clean。
- pt: 14/14 敵対的検証 clean。検証中に GUI resx の欠落を発見 (FormSequentialAnalysis.pt.resx の
checkBoxLoop.Text が未訳で GUI が英語 "Loop" 表示、他10言語は訳済み) — ドキュメント側は正しい訳
("Ciclo") のままとし、resx 側の修正は別途 (GUI 側の担当領域)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ru を Workflow (translate→敵対的検証) で翻訳。画像 cap-ru-auto retarget、UI 用語は ru.resx 整合、
ページ内アンカーは EN の明示 {#...} を凍結継承。check_md_translation.py 14/14 OK、mkdocs build --strict 通過。
- 13/14 は初回パイプラインで検証 clean。1-main-window は英語残りの GUI メニュー項目多数を
実際の FormMain.ru.resx ラベルへ全訳修正 (File/Option/Macro/Help/Language サブ見出し・
ツールバー8項目・メニュー項目23件等)。
- 6-fitting-diffraction-peaks は初回検証がインフラエラーで未完だったため単独で敵対的再検証
(エージェント a90cffd888f26434d)。文法誤り1件 (число の格) を修正、他は既存表記と整合確認し維持。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ko を Workflow (translate→敵対的検証) で翻訳。画像 cap-ko-auto retarget、UI 用語は ko.resx 整合、
ページ内アンカーは EN の明示 {#...} を凍結継承。check_md_translation.py 14/14 OK (1件手修正後)、
mkdocs build --strict 通過。14/14 敵対的検証 clean。
- 検証で用語統一 (「순차 분석」直訳→実際の GUI ラベル「연속 분석」) を index/7-sequential/8-macro へ適用。
横断的な訳漏れ (1-main-window のリンク表示テキスト1箇所) を追加で手修正。
- appendix/algorithms.md でハーネスが数式差分を検出 (KO が \delta\theta の前に \theta を独立した
数式スパンとして追加挿入、EN の "a change" に対応する余剰トークン) → EN の構造に合わせ除去し凍結一致に修正。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
zh-Hans/zh-Hant を Workflow (translate→敵対的検証) で翻訳。画像 cap-<lang>-auto retarget、
UI 用語は各 resx 整合 (簡体字/繁体字は別々に GUI 実ラベルへ照合、繁体字は台湾用語)、
ページ内アンカーは EN の明示 {#...} を凍結継承。check_md_translation.py 各14/14 OK、
mkdocs build --strict 通過。両言語とも 14/14 敵対的検証 clean。
- zh-Hans: 1-main-window の GUI ラベル (メニュー/ツールバー/タブ名) 多数を FormMain.zh-Hans.resx
実ラベルへ全訳修正。8-macro の Show samples→显示示例 修正。
- zh-Hant: 1-main-window の同種修正 (FormMain.zh-Hant.resx 準拠、檔案/選項/巨集/說明/語言 等)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
初回パイプラインで週次上限のため未検証だった es 4ページ (3-crystal-parameter/5-equation-of-states/ 7-sequential-analysis/8-macro) を単独エージェントで敵対的再検証。5-eos/8-macro は問題なし。 - 3-crystal-parameter: GUI タブラベル3箇所を実際の es.resx へ修正 (`Basic Info.`/`Atom Info.` の表内コード表記→`Info. básica`/`Info. átomos`、 `Periodic Table`→`Tabla periódica`、`Ignore scattering factor`→`Ignorar factor de dispersión`)。 - 7-sequential-analysis: d-spacing タブラベルを実際の FormSequentialAnalysis.es.resx へ修正 (`Espaciado d (Å)`→`Distancia interplanar (Å)`、見出し・画像キャプション・macro表の3箇所)。 これで de/fr/es/it/pt/ru/ko/zh-Hans/zh-Hant の9言語 × 14ページが全て敵対的検証 clean。 全11言語 (en/ja + 9言語) で mkdocs build --strict 通過を確認。 ⚠ 検証中に他言語の同型バグを発見 (このコミットでは未修正、別途対応): pt/7-sequential-analysis.md も d-spacing タブラベル不一致 (Espaçamento d→実際は Distância interplanar)。 it/ru/zh-Hans/zh-Hant の 3-crystal-parameter も Basic Info./Atom Info. 系のタブラベル不一致の可能性。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
es の敵対的再検証 (6f91648) で発見した同型バグを横展開。表内コードスパン・見出し・画像 alt 文・ ページ内リンク表示文の GUI ラベルを、実際に出荷されている各言語 resx の値へ統一 (アンカー id {#atom-info-tab} はバイト一致で維持)。 - pt/7-sequential-analysis.md: d-spacing タブ (`Espaçamento d`→`Distância interplanar`、 FormSequentialAnalysis.pt.resx tabPageDspacing.Text 準拠)。見出し・画像キャプション・macro表の3箇所。 - it/3-crystal-parameter.md: Basic Info./Atom Info. タブ (`Info base`/`Info atomi`、 CrystalControl.it.resx 準拠)。表・見出し・alt文・リンク表示文の4箇所。 - ru/3-crystal-parameter.md: 同種 (`Осн. инфо`/`Об атомах`、CrystalControl.ru.resx 準拠)。 - zh-Hans/3-crystal-parameter.md: 同種 (`基本信息`/`原子信息`、CrystalControl.zh-Hans.resx 準拠)。 - zh-Hant/3-crystal-parameter.md: 同種 (`基本資訊`/`原子資訊`、CrystalControl.zh-Hant.resx 準拠)。 check_md_translation.py 各14/14 OK、mkdocs build --strict (全11言語) 通過。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PDIndexer を ReciPro と同等の 11言語 UI(en, ja, de, fr, es, pt, it, ru, zh-Hans, zh-Hant, ko)へ多言語化する作業の Phase 0〜2。
Phase 0 — 配線
SupportedCultures.All駆動 +Application.Restart()再起動方式へHelpCulture()で gating、--captureを 11言語化Phase 1 — 翻訳 resx
Phase 2 — コード側多言語化(Localizable=false)
PDIndexerLocalizationData.cs(115 entries, FullName キー)+CodeLocalizerで実行時差替PdiText.cs(Loc アクセサ)へ集約。ボタン状態(Find!/Stop! 等)は文字列比較からboolへ分離してから Loc 化。MessageBox / 日本語only の英語 canonical 化 / 起動スプラッシュ永続表示共有 submodule(後方互換・push 済)
1cbb4e8:Localization.AddProvider(app-local provider 拡張点)c0a359f:CodeLocalizerを FullName 優先解決(4アプリ同名衝突回避)検証
dotnet build0エラー / 翻訳の placeholder・改行・全言語充足を検証スクリプトで 0問題注記
FormMain.Designer.cs/FormMain.resxの別作業(Designer 差分)は本 PR に含めていません7aac9f7を含みます(master 側で別途反映予定の場合は自動的に解消されます)🤖 Generated with Claude Code