@@ -122,18 +122,42 @@ pub struct MacConfig {
122122 pub entitlements : Option < String > ,
123123}
124124
125- fn default_language ( ) -> String {
126- "en-US" . into ( )
125+ /// Configuration for a target language for the WiX build.
126+ #[ derive( Debug , PartialEq , Clone , Deserialize , Serialize ) ]
127+ #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
128+ #[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
129+ pub struct WixLanguageConfig {
130+ /// The path to a locale (`.wxl`) file. See <https://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/build_a_localized_version.html>.
131+ pub locale_path : Option < String > ,
132+ }
133+
134+ /// The languages to build using WiX.
135+ #[ derive( Debug , PartialEq , Clone , Deserialize , Serialize ) ]
136+ #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
137+ #[ serde( untagged) ]
138+ pub enum WixLanguage {
139+ /// A single language to build, without configuration.
140+ One ( String ) ,
141+ /// A list of languages to build, without configuration.
142+ List ( Vec < String > ) ,
143+ /// A map of languages and its configuration.
144+ Localized ( HashMap < String , WixLanguageConfig > ) ,
145+ }
146+
147+ impl Default for WixLanguage {
148+ fn default ( ) -> Self {
149+ Self :: One ( "en-US" . into ( ) )
150+ }
127151}
128152
129153/// Configuration for the MSI bundle using WiX.
130154#[ derive( Debug , Default , PartialEq , Clone , Deserialize , Serialize ) ]
131155#[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
132156#[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
133157pub struct WixConfig {
134- /// The installer language . See <https://docs.microsoft.com/en-us/windows/win32/msi/localizing-the-error-and-actiontext-tables>.
135- #[ serde( default = "default_language" ) ]
136- pub language : String ,
158+ /// The installer languages to build . See <https://docs.microsoft.com/en-us/windows/win32/msi/localizing-the-error-and-actiontext-tables>.
159+ #[ serde( default ) ]
160+ pub language : WixLanguage ,
137161 /// A custom .wxs template to use.
138162 pub template : Option < PathBuf > ,
139163 /// A list of paths to .wxs files with WiX fragments to use.
0 commit comments