Skip to content

Commit

Permalink
Fix localization collation.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Mar 12, 2024
1 parent 451525f commit 976ac44
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ public static IntermediateSymbolDefinition ByType(SymbolDefinitionType type)
case SymbolDefinitionType.FileSFPCatalog:
return SymbolDefinitions.FileSFPCatalog;

case SymbolDefinitionType.HarvestFiles:
return SymbolDefinitions.HarvestFiles;

case SymbolDefinitionType.Icon:
return SymbolDefinitions.Icon;

Expand Down
6 changes: 6 additions & 0 deletions src/test/burn/WixTestTools/PackageVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ public string GetProperty(string name)
return row.Value;
}

public string GetControlText(string dialog, string control)
{
var row = this.WiData.Tables["Control"].Rows.Cast<ControlRow>().Single(r => r.Dialog == dialog && r.Control == control);
return row.Text;
}

public bool IsInstalled()
{
var productCode = this.GetProperty("ProductCode");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<UpgradeCode>{4D188568-1CCF-4EEE-BC27-17C3DCC83E58}</UpgradeCode>
<ProductComponentsRef>true</ProductComponentsRef>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.UI.wixext" />
<PackageReference Include="WixToolset.Util.wixext" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->


<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Fragment>
<ComponentGroup Id="ProductComponents">
<Files Include="**" />
</ComponentGroup>

<ui:WixUI Id="WixUI_FeatureTree" />
<util:FailWhenDeferred />
</Fragment>
</Wix>
26 changes: 26 additions & 0 deletions src/test/msi/WixToolsetTest.MsiE2E/UIExtensionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolsetTest.MsiE2E
{
using Xunit;
using Xunit.Abstractions;

public class UIExtensionTests : MsiE2ETests
{
public UIExtensionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }

[Fact]
public void CanBuildLocalizedWixUIPackageWithDefaultUSEnglish()
{
var product = this.CreatePackageInstaller("LocalizedWixUI");

var nextButton = product.GetControlText("WelcomeDlg", "Next");
var cancelButton = product.GetControlText("ExitDialog", "Cancel");
var updateButton = product.GetControlText("VerifyReadyDlg", "Update");

Assert.Equal("&Next", nextButton);
Assert.Equal("Cancel", cancelButton);
Assert.Equal("&Update", updateButton);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private Localization Merge(Localization existingLocalization, Localization local
}
}

return new Localization(existingLocalization.Codepage ?? localization.Codepage, existingLocalization.SummaryInformationCodepage ?? localization.SummaryInformationCodepage, existingLocalization.Culture, variables, controls);
return new Localization(existingLocalization.Location, existingLocalization.Codepage ?? localization.Codepage, existingLocalization.SummaryInformationCodepage ?? localization.SummaryInformationCodepage, existingLocalization.Culture, variables, controls);
}
}
}

0 comments on commit 976ac44

Please sign in to comment.