Skip to content

Update AssignCulture Task to support existing Culture metadata#10026

Merged
f-alizada merged 6 commits intodotnet:mainfrom
f-alizada:dev/f-alizada/assign-culture-task-updates
Apr 26, 2024
Merged

Update AssignCulture Task to support existing Culture metadata#10026
f-alizada merged 6 commits intodotnet:mainfrom
f-alizada:dev/f-alizada/assign-culture-task-updates

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

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@f-alizada
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@f-alizada f-alizada requested review from MichalPavlik, baronfel and ladipro 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!

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