Add Copilot Review instructions for localization workflow enforcement#533
Add Copilot Review instructions for localization workflow enforcement#533
Conversation
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>
There was a problem hiding this comment.
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.mdwith localization workflow rules and bilingual warning text. - Documented exception criteria for Crowdin syncs/bot PRs and added general resource/XAML review guidance.
| 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 |
There was a problem hiding this comment.
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.
| ### 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 | ||
|
|
There was a problem hiding this comment.
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).
| **✅ 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 |
There was a problem hiding this comment.
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.
|
|
||
| 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.) |
There was a problem hiding this comment.
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.
| - 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.) |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
Automates detection of direct modifications to translation files (non-en-US
.reswfiles), which should only be updated via Crowdin.Implementation
Created
.github/copilot-instructions.mdwith: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/*.reswfilesException handling: Bypasses warnings for Crowdin automated syncs (commit message substring match: "Updated app translations by Crowdin", case-insensitive) and bot accounts
Review guidelines:
x:Uid/x:Namevalidation)Workflow documentation: Contributor and reviewer checklists
Example Warning
When non-en-US resource files are modified:
Original prompt
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.