-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localize the text in the common target #10388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Though - I was not controllig in detail 1:1 equality of the literals in .targets with the new in resx files - I suppose they were copied over (with just applying format parameters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use CommonSdk
instead of CommonTarget
? It could be useful if you decide to do #1686?
Also, Message Code (like MSB3539
) should be separately specified to ensure searchability in these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Style nit: Method parameter should start with lower case.
Other that that, it's looking good.
We only localize the text, so, it's not strictly required to put With And if you want to indicate the |
Thanks for your explanation. I added that code in the comment. |
Yeah, I meant in RESX Comments field but this works just as fine. However, it requires anyone who adds a message task to consistently place the Also, |
Yes, your suggestions are reasonable. Since some warning or error messages before don't have the code such as CommonSdk.InvalidConfigurationTextWhenBuildingInsideVisualStudio, CommonSdk.DeploymentUnpublishable . @JanKrivanek and @YuliiaKovalova Should we add the code for every message? If so, I can update that next. |
@JanKrivanek No problem. As you said, these are just suggestions. And I |
😆 appology - quick typing. I promise I gave more time into considering the suggestion than into to typing that response! 😉 (it's tracked after all) |
Fixes #10171
Context
MsBuild produces unlocalized messages for some specific validation cases that happen in scope of target.
The example of the task usage: https://github.com/YuliiaKovalova/msbuild/blob/be21253d85f7766356880d376e26aaa69c34c4cd/src/Tasks/Microsoft.Common.CurrentVersion.targets#L862
Changes Made
Refactor the existing messages with the recently added task allows to produce localized messages:
https://github.com/dotnet/msbuild/blob/79dff86b18613cfe3510b719ac28e8a8c3e7f96c/src/Tasks/MSBuildInternalMessage.cs , produced by with hardcoded text.
Testing
Add test cases for each new resource, except for the resource CommonSdk.PropertyWithTrailingSlash, which is tested manually as followed picture.
Notes