From 4bb99d4a7521f3182b3d8ea9833038dc067db118 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 2 Apr 2021 14:28:56 -0700 Subject: Move codepage from section and to package, module, patch symbols Contributes to wixtoolset/issues#5801 --- src/WixToolset.Data/Localization.cs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/WixToolset.Data/Localization.cs') diff --git a/src/WixToolset.Data/Localization.cs b/src/WixToolset.Data/Localization.cs index 7ce765f4..70c096de 100644 --- a/src/WixToolset.Data/Localization.cs +++ b/src/WixToolset.Data/Localization.cs @@ -18,9 +18,10 @@ namespace WixToolset.Data /// /// Instantiates a new localization object. /// - public Localization(int codepage, string culture, IDictionary variables, IDictionary localizedControls) + public Localization(int? codepage, int? summaryInformationCodepage, string culture, IDictionary variables, IDictionary localizedControls) { this.Codepage = codepage; + this.SummaryInformationCodepage = summaryInformationCodepage; this.Culture = culture?.ToLowerInvariant() ?? String.Empty; this.variables = new Dictionary(variables); this.localizedControls = new Dictionary(localizedControls); @@ -30,7 +31,13 @@ namespace WixToolset.Data /// Gets the codepage. /// /// The codepage. - public int Codepage { get; private set; } + public int? Codepage { get; private set; } + + /// + /// Gets the summary information codepage. + /// + /// The summary information codepage. + public int? SummaryInformationCodepage { get; private set; } /// /// Gets the culture. @@ -52,10 +59,17 @@ namespace WixToolset.Data internal JsonObject Serialize() { - var jsonObject = new JsonObject + var jsonObject = new JsonObject(); + + if (this.Codepage.HasValue) { - { "codepage", this.Codepage }, - }; + jsonObject.Add("codepage", this.Codepage.Value); + } + + if (this.SummaryInformationCodepage.HasValue) + { + jsonObject.Add("summaryCodepage", this.SummaryInformationCodepage.Value); + } jsonObject.AddIsNotNullOrEmpty("culture", this.Culture); @@ -94,7 +108,8 @@ namespace WixToolset.Data internal static Localization Deserialize(JsonObject jsonObject) { - var codepage = jsonObject.GetValueOrDefault("codepage", 0); + var codepage = jsonObject.GetValueOrDefault("codepage", null); + var summaryCodepage = jsonObject.GetValueOrDefault("summaryCodepage", null); var culture = jsonObject.GetValueOrDefault("culture"); var variables = new Dictionary(); @@ -116,7 +131,7 @@ namespace WixToolset.Data } } - return new Localization(codepage, culture, variables, controls); + return new Localization(codepage, summaryCodepage, culture, variables, controls); } } } -- cgit v1.2.3-55-g6feb