aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Localization.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Localization.cs')
-rw-r--r--src/WixToolset.Data/Localization.cs29
1 files changed, 22 insertions, 7 deletions
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
18 /// <summary> 18 /// <summary>
19 /// Instantiates a new localization object. 19 /// Instantiates a new localization object.
20 /// </summary> 20 /// </summary>
21 public Localization(int codepage, string culture, IDictionary<string, BindVariable> variables, IDictionary<string, LocalizedControl> localizedControls) 21 public Localization(int? codepage, int? summaryInformationCodepage, string culture, IDictionary<string, BindVariable> variables, IDictionary<string, LocalizedControl> localizedControls)
22 { 22 {
23 this.Codepage = codepage; 23 this.Codepage = codepage;
24 this.SummaryInformationCodepage = summaryInformationCodepage;
24 this.Culture = culture?.ToLowerInvariant() ?? String.Empty; 25 this.Culture = culture?.ToLowerInvariant() ?? String.Empty;
25 this.variables = new Dictionary<string, BindVariable>(variables); 26 this.variables = new Dictionary<string, BindVariable>(variables);
26 this.localizedControls = new Dictionary<string, LocalizedControl>(localizedControls); 27 this.localizedControls = new Dictionary<string, LocalizedControl>(localizedControls);
@@ -30,7 +31,13 @@ namespace WixToolset.Data
30 /// Gets the codepage. 31 /// Gets the codepage.
31 /// </summary> 32 /// </summary>
32 /// <value>The codepage.</value> 33 /// <value>The codepage.</value>
33 public int Codepage { get; private set; } 34 public int? Codepage { get; private set; }
35
36 /// <summary>
37 /// Gets the summary information codepage.
38 /// </summary>
39 /// <value>The summary information codepage.</value>
40 public int? SummaryInformationCodepage { get; private set; }
34 41
35 /// <summary> 42 /// <summary>
36 /// Gets the culture. 43 /// Gets the culture.
@@ -52,10 +59,17 @@ namespace WixToolset.Data
52 59
53 internal JsonObject Serialize() 60 internal JsonObject Serialize()
54 { 61 {
55 var jsonObject = new JsonObject 62 var jsonObject = new JsonObject();
63
64 if (this.Codepage.HasValue)
56 { 65 {
57 { "codepage", this.Codepage }, 66 jsonObject.Add("codepage", this.Codepage.Value);
58 }; 67 }
68
69 if (this.SummaryInformationCodepage.HasValue)
70 {
71 jsonObject.Add("summaryCodepage", this.SummaryInformationCodepage.Value);
72 }
59 73
60 jsonObject.AddIsNotNullOrEmpty("culture", this.Culture); 74 jsonObject.AddIsNotNullOrEmpty("culture", this.Culture);
61 75
@@ -94,7 +108,8 @@ namespace WixToolset.Data
94 108
95 internal static Localization Deserialize(JsonObject jsonObject) 109 internal static Localization Deserialize(JsonObject jsonObject)
96 { 110 {
97 var codepage = jsonObject.GetValueOrDefault("codepage", 0); 111 var codepage = jsonObject.GetValueOrDefault("codepage", null);
112 var summaryCodepage = jsonObject.GetValueOrDefault("summaryCodepage", null);
98 var culture = jsonObject.GetValueOrDefault<string>("culture"); 113 var culture = jsonObject.GetValueOrDefault<string>("culture");
99 114
100 var variables = new Dictionary<string, BindVariable>(); 115 var variables = new Dictionary<string, BindVariable>();
@@ -116,7 +131,7 @@ namespace WixToolset.Data
116 } 131 }
117 } 132 }
118 133
119 return new Localization(codepage, culture, variables, controls); 134 return new Localization(codepage, summaryCodepage, culture, variables, controls);
120 } 135 }
121 } 136 }
122} 137}