{"record":{"id":"43fa771c2e53979e","repo":"tauri-apps/tauri","slug":"language-not-found-it-must-be-one-of","errorCode":null,"errorMessage":"Language {} not found. It must be one of {}","messagePattern":"Language (.+?) not found\\. It must be one of (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":832,"sourceCode":"  // sign default extensions\n  if settings.windows().can_sign() {\n    for path in &fragment_extensions {\n      try_sign(path, settings)?;\n    }\n  }\n\n  for (path, extensions) in candle_inputs {\n    for ext in &extensions {\n      fragment_extensions.insert(ext.clone());\n    }\n    run_candle(settings, &wix_toolset_path, &output_path, path, extensions)?;\n  }\n\n  let mut output_paths = Vec::new();\n\n  for (language, language_config) in configured_languages.0 {\n    let language_metadata = language_map.get(&language).unwrap_or_else(|| {\n      panic!(\n        \"Language {} not found. It must be one of {}\",\n        language,\n        language_map\n          .keys()\n          .cloned()\n          .collect::<Vec<String>>()\n          .join(\", \")\n      )\n    });\n\n    let locale_contents = match language_config.locale_path {\n      Some(p) => fs::read_to_string(p)?,\n      None => format!(\n        r#\"<WixLocalization Culture=\"{}\" xmlns=\"http://schemas.microsoft.com/wix/2006/localization\"></WixLocalization>\"#,\n        language.to_lowercase(),\n      ),\n    };\n","sourceCodeStart":814,"sourceCodeEnd":850,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L814-L850","documentation":"Panic in the WiX MSI bundler. After running candle on the fragments, it iterates the configured languages (bundle > windows > wix > language) and looks each one up in the language map built from WiX's built-in locales plus configured WiX extensions; an unknown language aborts the build with the full list of valid keys.","triggerScenarios":"Configuring an MSI language that is not in the map: typos such as 'en_US' instead of 'en-US' (underscore vs hyphen), unsupported locales, or locales that require a WiX extension (e.g. ar-SA) that was not added under wix > extensions.","commonSituations":"See trigger scenarios.","solutions":["Use one of the language codes listed in the panic message, with hyphen separators (e.g. 'en-US')","For extension-backed languages, add the needed WiX extension to bundle > windows > wix > extensions and re-run","Remove or fix the offending entry in the wix language configuration (map or array form)"],"exampleFix":"// before (tauri.conf.json)\n\"bundle\": { \"windows\": { \"wix\": { \"language\": \"en_US\" } } } // panic: not in map\n\n// after\n\"bundle\": { \"windows\": { \"wix\": { \"language\": \"en-US\" } } }","handlingStrategy":"validation","validationCode":"// keep MSI languages to a vetted allowlist with hyphenated codes\nconst ALLOWED = new Set(['en-US', 'de-DE', 'fr-FR', 'ja-JP', 'zh-CN']);\nconst langs = wixLanguageIsArray ? wixLanguage : Object.keys(wixLanguage);\nlangs.forEach((l) => { if (!ALLOWED.has(l)) throw new Error(`unsupported MSI language: ${l}`); });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use BCP-47 style codes with a hyphen (en-US, not en_US)","For extension-backed locales, add the WiX extension to the wix config before enabling the language","Add new languages one at a time and let the panic's valid-list guide you"],"tags":["msi","wix","windows","locale","tauri-bundler","build"],"backgroundTag":"unsupported-locale","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}