Skip to content

Commit

Permalink
- WiX4: Issue #1398: Underscore in String Id in wxl breaks localization
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-shilo committed Dec 14, 2023
1 parent 76870b6 commit 6e3463f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/ManagedUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ internal static string LocalizationFileFor(Project project)
var replacementIds = userLocalization.Root.Elements().Select(x => x.Attr("Id"));

baseLocalization.Root
.Elements().ToArray() // clone the copy so the collection is not impacted
.Elements()
.Where(x => replacementIds.Contains(x.Attr("Id")))
.ForEach(x => x.Remove());

userLocalization.Root
.Elements().ToArray() // clone the copy so the collection is not impacted
.Elements()
.ForEach(x =>
{
x.Remove();
Expand Down
3 changes: 2 additions & 1 deletion Source/src/WixSharp/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ public static IEnumerable<T> DistinctBy<T>(this IEnumerable<T> list, Func<T, obj
/// <returns></returns>
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> collection, Action<T> action)
{
foreach (T item in collection)
// clone the copy so the collection is not impacted by the action
foreach (T item in collection.ToArray())
{
action(item);
}
Expand Down

0 comments on commit 6e3463f

Please sign in to comment.