Problem
GetMonoPlatformJar.RunTask passes a hardcoded English string to Log.LogCodedError ("XA0002", ...), even though an XA0002 resource already exists in Properties/Resources.resx with the identical text and is already translated into 16 languages. Because the call uses the literal instead of the resource, this error message is never localized.
Location
- File(s):
src/Xamarin.Android.Build.Tasks/Tasks/GetMonoPlatformJar.cs
- Line(s): 38
Current Code
Log.LogCodedError ("XA0002", "Could not find mono.android.jar");
Suggested Fix
Replace the hardcoded literal with the existing strongly-typed resource:
Log.LogCodedError ("XA0002", Properties.Resources.XA0002);
The XA0002 resource already exists in src/Xamarin.Android.Build.Tasks/Properties/Resources.resx with the value Could not find mono.android.jar (verified byte-for-byte identical), and the generated property Xamarin.Android.Tasks.Properties.Resources.XA0002 is already present in Resources.Designer.cs. Therefore no .resx, Resources.Designer.cs, or documentation changes are required — this is a single-line edit. The English output is unchanged; the fix simply enables the translations that already ship for the other cultures.
Guidelines
- Only modify the one line in
GetMonoPlatformJar.cs. Do NOT edit Resources.resx, Resources.Designer.cs, the non-English Resources.*.resx files, or Documentation/docs-mobile/messages/xa0002.md — they already contain the correct content.
- This matches the established pattern already used in the same project, e.g.
Tasks/Lint.cs:
Log.LogCodedError ("XA5205", Properties.Resources.XA5205_Lint, ToolName);
GetMonoPlatformJar is in namespace Xamarin.Android.Tasks; the resource class is Xamarin.Android.Tasks.Properties.Resources, so Properties.Resources.XA0002 resolves without adding any using directive. The file is already #nullable enable, and the proven Lint.cs call sites show this compiles without a nullable warning.
Acceptance Criteria
Fix-finder metadata
- Script:
08-string-literal-error-messages
- Score:
29/30 (actionability: 10, safety: 9, scope: 10)
Generated by Nightly Fix Finder · 687 AIC · ⌖ 49.5 AIC · ⊞ 40.4K · ◷
Problem
GetMonoPlatformJar.RunTaskpasses a hardcoded English string toLog.LogCodedError ("XA0002", ...), even though anXA0002resource already exists inProperties/Resources.resxwith the identical text and is already translated into 16 languages. Because the call uses the literal instead of the resource, this error message is never localized.Location
src/Xamarin.Android.Build.Tasks/Tasks/GetMonoPlatformJar.csCurrent Code
Suggested Fix
Replace the hardcoded literal with the existing strongly-typed resource:
The
XA0002resource already exists insrc/Xamarin.Android.Build.Tasks/Properties/Resources.resxwith the valueCould not find mono.android.jar(verified byte-for-byte identical), and the generated propertyXamarin.Android.Tasks.Properties.Resources.XA0002is already present inResources.Designer.cs. Therefore no.resx,Resources.Designer.cs, or documentation changes are required — this is a single-line edit. The English output is unchanged; the fix simply enables the translations that already ship for the other cultures.Guidelines
GetMonoPlatformJar.cs. Do NOT editResources.resx,Resources.Designer.cs, the non-EnglishResources.*.resxfiles, orDocumentation/docs-mobile/messages/xa0002.md— they already contain the correct content.Tasks/Lint.cs:GetMonoPlatformJaris in namespaceXamarin.Android.Tasks; the resource class isXamarin.Android.Tasks.Properties.Resources, soProperties.Resources.XA0002resolves without adding anyusingdirective. The file is already#nullable enable, and the provenLint.cscall sites show this compiles without a nullable warning.Acceptance Criteria
GetMonoPlatformJar.csline 38 usesProperties.Resources.XA0002instead of the hardcoded string"Could not find mono.android.jar".resx,Resources.Designer.cs, or documentation filesFix-finder metadata
08-string-literal-error-messages29/30(actionability: 10, safety: 9, scope: 10)