Skip to content

Move hardcoded Aapt2Compile warning string to Resources.resx for localization - #12227

Merged
jonathanpeppers merged 4 commits into
mainfrom
copilot/fix-finder-move-warning-string
Jul 27, 2026
Merged

Move hardcoded Aapt2Compile warning string to Resources.resx for localization#12227
jonathanpeppers merged 4 commits into
mainfrom
copilot/fix-finder-move-warning-string

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Aapt2Compile emitted a hardcoded, uncoded warning when a resource directory no longer existed. This moves the message into the localization resources and follows the established coded-warning pattern.

Changes

  • Add localized resource XA4323: Ignoring directory '{0}' as it does not exist!
  • Emit the warning with Log.LogCodedWarning("XA4323", Properties.Resources.XA4323, fileOrDirectory)
  • Document XA4323 and add it to the warning index and documentation TOC
  • Update Copilot and Android reviewer instructions to require coded warnings/errors, localized resources, and message documentation

The warning text remains unchanged; it now includes the XA4323 code and can be localized.

Fixes #12226

…calization

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Move hardcoded Aapt2Compile warning string into Resources.resx for localization Move hardcoded Aapt2Compile warning string to Resources.resx for localization Jul 24, 2026
Copilot AI requested a review from jonathanpeppers July 24, 2026 02:36
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review July 24, 2026 13:20
Copilot AI review requested due to automatic review settings July 24, 2026 13:20
Comment thread src/Xamarin.Android.Build.Tasks/Tasks/Aapt2Compile.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves a hardcoded English warning message in the Aapt2Compile MSBuild task onto the existing Properties.Resources localization pipeline, aligning warning output with the repo’s localized resource conventions (per issue #12226).

Changes:

  • Add a new Aapt2IgnoringDirectory string resource (with {0} placeholder and comment) to the main English Resources.resx.
  • Update Resources.Designer.cs to expose the new strongly-typed resource property.
  • Replace the interpolated warning literal in Aapt2Compile with a resource-based formatted warning message.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Xamarin.Android.Build.Tasks/Tasks/Aapt2Compile.cs Switches the warning emission from an English literal to a localized resource string.
src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Adds the new Aapt2IgnoringDirectory resource entry with placeholder and translator comment.
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs Adds the generated accessor property for the new resource key.
Files not reviewed (1)
  • src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file

Comment thread src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs Outdated
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c1fe1fe3-edd9-4a1f-8616-8b5072aca8c4
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 24, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 24, 2026 16:28
@jonathanpeppers
jonathanpeppers merged commit d9e9a6a into main Jul 27, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-finder-move-warning-string branch July 27, 2026 12:30
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Move hardcoded Aapt2Compile warning string into Resources.resx for localization

4 participants