Skip to content
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

Update AssignCulture Task to support existing Culture metadata #10026

Merged

Conversation

f-alizada
Copy link
Contributor

Fixes #9954

Context

Currently there is a difference in public documentation and actual implementation of AssignCulture task.

The difference:

If the incoming item from the Files parameter already contains a Culture metadata entry, the original metadata entry is used.

In fact the Culture is not respected.

Please see the comment: #9954 (comment)

Changes Made

Update the AssignCulture task to include the property that will allow switch the way existing Culture metadata is handled.

  • If RespectAlreadyAssignedItemCulture is set to false
    • the Culture will not be respected.
  • If RespectAlreadyAssignedItemCulture = true
    • set Culture metadata is respected and the CultureNeutralAssignedFiles will be populated with unchanged filename of Files.

Updated the Microsoft.Common.CurrentVersion.targets to make it possible to set the property on the project

Testing

Added unit test + manually tested on the local project.

@f-alizada
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@f-alizada
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@f-alizada f-alizada requested review from MichalPavlik, ladipro and baronfel and removed request for baronfel and rainersigwald April 17, 2024 15:46
Copy link
Member

@ladipro ladipro left a comment

Choose a reason for hiding this comment

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

Looks great!

src/Tasks/AssignCulture.cs Outdated Show resolved Hide resolved
src/Tasks.UnitTests/AssignCulture_Tests.cs Outdated Show resolved Hide resolved
src/Tasks.UnitTests/AssignCulture_Tests.cs Outdated Show resolved Hide resolved
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Valid BCP 47 tags in the resource file name not recognized
5 participants