Skip to content

Add Copilot Review instructions for localization workflow enforcement#533

Merged
0x5bfa merged 9 commits intomainfrom
copilot/add-copilot-review-instructions
Feb 12, 2026
Merged

Add Copilot Review instructions for localization workflow enforcement#533
0x5bfa merged 9 commits intomainfrom
copilot/add-copilot-review-instructions

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Automates detection of direct modifications to translation files (non-en-US .resw files), which should only be updated via Crowdin.

Implementation

Created .github/copilot-instructions.md with:

  • Localization rules: Detects changes to any of 42 non-en-US locale resource files, provides bilingual (日本語/English) warnings directing contributors to modify only en-US/*.resw files

  • Exception handling: Bypasses warnings for Crowdin automated syncs (commit message substring match: "Updated app translations by Crowdin", case-insensitive) and bot accounts

  • Review guidelines:

    • Resource key naming conventions (PascalCase, descriptive identifiers)
    • XAML localization patterns (x:Uid / x:Name validation)
    • Translator comment requirements
    • Hard-coded string classification (user-visible vs. technical)
  • Workflow documentation: Contributor and reviewer checklists

Example Warning

When non-en-US resource files are modified:

🚨 Translation resource files (non-en-US .resw files) have been modified.
Please do not directly modify translation resource files.

Files to modify: src/FluentHub.App/Strings/en-US/*.resw only
Translations are updated automatically via Crowdin.
Original prompt

目的

Copilot Reviewのカスタム指示ファイルを作成し、en-US以外のリソースファイルが変更されたPRに対して自動的にコメントを追加するようにします。

実装内容

.github/copilot-instructions.md ファイルを作成してください。

このファイルには以下の内容を含めてください:

  1. ローカライゼーションとリソースファイルに関するルール

    • en-US以外のリソースファイル(.reswまたは.resxファイル)の変更を検出
    • 検出された場合、PRに警告コメントを追加
  2. 監視対象のファイル

    • en-US以外のロケールディレクトリ内の.reswファイル
    • 言語コード(ja-JP, fr-FR, de-DE, zh-CNなど)を含むローカライズされたリソースファイル
  3. コメント内容

    • 翻訳リソースファイルは直接変更しないこと
    • en-USのリソースファイルのみを変更すべきこと
    • 他の言語の翻訳は翻訳管理システム(Crowdin等)を通じて更新されること
    • 日本語と英語の両方でメッセージを記載
  4. 例外ルール

    • 翻訳管理システムからの同期の場合は、このルールをバイパス可能
  5. 追加のレビューガイドライン

    • 新しい文字列が適切なキーと説明を持っているか確認
    • リソース文字列キーがプロジェクトの命名規則に従っているか確認
    • XAMLファイルがx:Uidまたはx:Name属性を使用してリソース文字列を正しく参照しているか確認

ファイル構造

.github/
└── copilot-instructions.md

期待される動作

このファイルが追加されると、Copilot Reviewは自動的に:

  • PRで変更されたファイルをスキャン
  • en-US以外のリソースファイルの変更を検出
  • 該当する場合、適切な警告コメントをPRに追加

これにより、翻訳の同期問題を防ぎ、適切なローカライゼーションワークフローを維持できます。

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 8 commits February 12, 2026 10:00
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com>
Copilot AI changed the title [WIP] Add custom instructions for Copilot Review Add Copilot Review instructions for localization workflow enforcement Feb 12, 2026
Copilot AI requested a review from 0x5bfa February 12, 2026 10:06
@0x5bfa 0x5bfa marked this pull request as ready for review February 12, 2026 10:09
Copilot AI review requested due to automatic review settings February 12, 2026 10:09
@0x5bfa 0x5bfa merged commit 35211a2 into main Feb 12, 2026
9 of 13 checks passed
@github-project-automation github-project-automation bot moved this from 📋 To do to ✅ Done in FluentHub Board Feb 12, 2026
@0x5bfa 0x5bfa deleted the copilot/add-copilot-review-instructions branch February 12, 2026 10:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Copilot Review instruction file intended to enforce the repo’s localization workflow by warning on direct edits to non-en-US resource files and providing reviewer/contributor checklists.

Changes:

  • Added .github/copilot-instructions.md with localization workflow rules and bilingual warning text.
  • Documented exception criteria for Crowdin syncs/bot PRs and added general resource/XAML review guidance.

Comment on lines +33 to +36
Do not flag this warning if:
- The commit message contains the phrase "Updated app translations by Crowdin" (case-insensitive substring match)
- The PR is from an automated bot account (e.g., `github-actions[bot]`, `crowdin-bot`, or similar automation accounts)
- The PR description explicitly mentions manual translation fix with justification
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception rule relies on checking commit messages ("Updated app translations by Crowdin"), but Copilot Review typically only has access to the PR diff/title/description and may not reliably see individual commit messages. This can cause false positives/negatives for Crowdin sync PRs. Consider rewriting the exception to use signals that are available to the reviewer (e.g., PR title/description text, file paths, or PR author/login/bot detection) instead of commit-message matching.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +63
### 2. XAML Resource References

When XAML files are modified along with resource files:

**✅ Verify:**
- XAML elements use `x:Uid` attribute to reference localized strings
- The `x:Uid` value matches the resource key prefix in the `.resw` file
- Alternative: Elements use `x:Name` with proper code-behind binding for dynamic content

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guidelines recommend using x:Uid for XAML localization, but there are no x:Uid (or even Uid=) usages in the current src/FluentHub.App XAML files, so this advice may not match the project’s established localization pattern. Align this section with how localization is actually done in the repo (or clarify that x:Uid would be a new preferred pattern and document the required wiring changes).

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +47
**✅ Good practices:**
- Each new string entry has a meaningful key that follows the project's naming convention
- String keys use PascalCase or descriptive identifiers (e.g., `MainPage_Title`, `Settings_Description`)
- Each resource string includes a `<comment>` element with context for translators
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section says string keys should be PascalCase (examples include MainPage_Title, Settings_Description), but the existing .resw keys in the repo predominantly use dotted property suffixes like AccountSettingsButton.Text and do not use underscores. To avoid encouraging inconsistent key naming, update the examples/rules to reflect the existing key format used in src/FluentHub.App/Strings/*/Resources.resw.

Copilot uses AI. Check for mistakes.

Watch for changes to resource files matching these patterns:
- `src/FluentHub.App/Strings/*/Resources.resw` (excluding `en-US`)
- Any `.resw` or `.resx` files in language code directories (e.g., `ja-JP`, `fr-FR`, `de-DE`, `zh-CN`, etc.)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The monitored file patterns mention “Any .resw or .resx files…”, but there are no .resx files in the repository today (localization appears to be .resw only). Keeping .resx here may lead to unnecessary review noise or confusion about supported resource formats. Consider limiting this to .resw, or explicitly stating .resx is not currently used but would also be subject to the same rule if introduced later.

Suggested change
- Any `.resw` or `.resx` files in language code directories (e.g., `ja-JP`, `fr-FR`, `de-DE`, `zh-CN`, etc.)
- Any `.resw` files in language code directories (e.g., `ja-JP`, `fr-FR`, `de-DE`, `zh-CN`, etc.)

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5719c576fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Do not flag this warning if:
- The commit message contains the phrase "Updated app translations by Crowdin" (case-insensitive substring match)
- The PR is from an automated bot account (e.g., `github-actions[bot]`, `crowdin-bot`, or similar automation accounts)
- The PR description explicitly mentions manual translation fix with justification

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove PR-description bypass for translation file edits

This exception lets any contributor suppress the localization warning by adding a sentence to the PR description, which defeats the stated enforcement goal that non-en-US translations should only be updated via Crowdin. In practice, a PR that directly edits src/FluentHub.App/Strings/<locale>/Resources.resw can avoid review feedback simply by claiming a manual fix, increasing the chance of unsynced translations being merged.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants