diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-04-02 14:41:49 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-04-02 14:58:00 -0700 |
| commit | 4449fcc5b8d104817c67135229682c66c3d892ca (patch) | |
| tree | 327f617de2e296ddb4e62c50bf07ec8b5dcf0a3e /src/WixToolset.Core/LocalizationParser.cs | |
| parent | 9cca339473d77c7036035f949239f5231c325968 (diff) | |
| download | wix-4449fcc5b8d104817c67135229682c66c3d892ca.tar.gz wix-4449fcc5b8d104817c67135229682c66c3d892ca.tar.bz2 wix-4449fcc5b8d104817c67135229682c66c3d892ca.zip | |
Enable codepages and languages to be set via .wxl files
Fixes wixtoolset/issues#5801
Diffstat (limited to 'src/WixToolset.Core/LocalizationParser.cs')
| -rw-r--r-- | src/WixToolset.Core/LocalizationParser.cs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/WixToolset.Core/LocalizationParser.cs b/src/WixToolset.Core/LocalizationParser.cs index dd5144ca..d6113fc6 100644 --- a/src/WixToolset.Core/LocalizationParser.cs +++ b/src/WixToolset.Core/LocalizationParser.cs | |||
| @@ -86,7 +86,8 @@ namespace WixToolset.Core | |||
| 86 | private static Localization ParseWixLocalizationElement(IMessaging messaging, XElement node) | 86 | private static Localization ParseWixLocalizationElement(IMessaging messaging, XElement node) |
| 87 | { | 87 | { |
| 88 | var sourceLineNumbers = SourceLineNumber.CreateFromXObject(node); | 88 | var sourceLineNumbers = SourceLineNumber.CreateFromXObject(node); |
| 89 | var codepage = -1; | 89 | int? codepage = null; |
| 90 | int? summaryInformationCodepage = null; | ||
| 90 | string culture = null; | 91 | string culture = null; |
| 91 | 92 | ||
| 92 | foreach (var attrib in node.Attributes()) | 93 | foreach (var attrib in node.Attributes()) |
| @@ -98,6 +99,9 @@ namespace WixToolset.Core | |||
| 98 | case "Codepage": | 99 | case "Codepage": |
| 99 | codepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers); | 100 | codepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers); |
| 100 | break; | 101 | break; |
| 102 | case "SummaryInformationCodepage": | ||
| 103 | summaryInformationCodepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers); | ||
| 104 | break; | ||
| 101 | case "Culture": | 105 | case "Culture": |
| 102 | culture = attrib.Value; | 106 | culture = attrib.Value; |
| 103 | break; | 107 | break; |
| @@ -143,7 +147,7 @@ namespace WixToolset.Core | |||
| 143 | } | 147 | } |
| 144 | } | 148 | } |
| 145 | 149 | ||
| 146 | return messaging.EncounteredError ? null : new Localization(codepage, culture, variables, localizedControls); | 150 | return messaging.EncounteredError ? null : new Localization(codepage, summaryInformationCodepage, culture, variables, localizedControls); |
| 147 | } | 151 | } |
| 148 | 152 | ||
| 149 | /// <summary> | 153 | /// <summary> |
| @@ -254,24 +258,12 @@ namespace WixToolset.Core | |||
| 254 | break; | 258 | break; |
| 255 | case "RightToLeft": | 259 | case "RightToLeft": |
| 256 | rightToLeft = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); | 260 | rightToLeft = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); |
| 257 | //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) | ||
| 258 | //{ | ||
| 259 | // attribs |= MsiInterop.MsidbControlAttributesRTLRO; | ||
| 260 | //} | ||
| 261 | break; | 261 | break; |
| 262 | case "RightAligned": | 262 | case "RightAligned": |
| 263 | rightAligned = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); | 263 | rightAligned = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); |
| 264 | //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) | ||
| 265 | //{ | ||
| 266 | // attribs |= MsiInterop.MsidbControlAttributesRightAligned; | ||
| 267 | //} | ||
| 268 | break; | 264 | break; |
| 269 | case "LeftScroll": | 265 | case "LeftScroll": |
| 270 | leftScroll = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); | 266 | leftScroll = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); |
| 271 | //if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) | ||
| 272 | //{ | ||
| 273 | // attribs |= MsiInterop.MsidbControlAttributesLeftScroll; | ||
| 274 | //} | ||
| 275 | break; | 267 | break; |
| 276 | default: | 268 | default: |
| 277 | Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); | 269 | Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); |
