{"record":{"id":"98d5559b37a79af6","repo":"Hmbown/CodeWhale","slug":"invalid-locale-value","errorCode":null,"errorMessage":"invalid locale '{value}'","messagePattern":"invalid locale '(.+?)'","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/config_ui.rs","lineNumber":1087,"sourceCode":"        match normalize_configured_locale(value) {\n            Some(\"auto\") => Ok(Self::Auto),\n            Some(\"en\") => Ok(Self::En),\n            Some(\"ja\") => Ok(Self::Ja),\n            Some(\"zh-Hans\") => Ok(Self::ZhHans),\n            Some(\"zh-Hant\") => Ok(Self::ZhHant),\n            Some(\"pt-BR\") => Ok(Self::PtBr),\n            Some(\"es-419\") => Ok(Self::Es419),\n            Some(\"vi\") => Ok(Self::Vi),\n            Some(\"ko\") => Ok(Self::Ko),\n            Some(\"ca\") => Ok(Self::Ca),\n            Some(\"de\") => Ok(Self::De),\n            Some(\"fr\") => Ok(Self::Fr),\n            Some(\"id\") => Ok(Self::Id),\n            Some(\"hi\") => Ok(Self::Hi),\n            Some(\"ru\") => Ok(Self::Ru),\n            Some(\"uk\") => Ok(Self::Uk),\n            Some(other) => bail!(\"unsupported locale '{other}'\"),\n            None => bail!(\"invalid locale '{value}'\"),\n        }\n    }\n}\n\nimpl UiThemeValue {\n    fn as_setting(self) -> &'static str {\n        match self {\n            Self::System => \"system\",\n            Self::Dark => \"dark\",\n            Self::Light => \"light\",\n            Self::Grayscale => \"grayscale\",\n            Self::CatppuccinMocha => \"catppuccin-mocha\",\n            Self::TokyoNight => \"tokyo-night\",\n            Self::Dracula => \"dracula\",\n            Self::GruvboxDark => \"gruvbox-dark\",\n            Self::Matrix => \"matrix\",\n            Self::Uwu => \"uwu\",\n            Self::Custom => \"custom\",","sourceCodeStart":1069,"sourceCodeEnd":1105,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/config_ui.rs#L1069-L1105","documentation":"Thrown by UiLocaleValue::from_setting when normalize_configured_locale returns None: after trim/case normalization the string could not be parsed as any locale at all. Note that empty and \"auto\"/\"system\" normalize to Some(\"auto\"), so this arm means a genuinely unrecognized value, not a blank one.","triggerScenarios":"Setting the locale config value to a string parse_locale cannot map, e.g. \"klingon\", \"123\", or a malformed tag like \"e__n\". Reached via from_setting on any config load or settings change.","commonSituations":"Hand-editing the config file with a typo; copying a locale name from another tool's format that Codewhale does not accept; scripts writing LC_ALL-style values (\"en_US.UTF-8\") into the locale setting.","solutions":["Correct the value to a supported tag (auto, en, ja, zh-Hans, zh-Hant, pt-BR, es-419, vi, ko, ca, de, fr, id, hi, ru, uk)","Check for typos, stray whitespace/quotes, or shell-format locale names in the config file","Use \"auto\" to let Codewhale detect the locale from the environment"],"exampleFix":"# before\nlocale = \"english\"\n\n# after\nlocale = \"en\"","handlingStrategy":"validation","validationCode":"fn parse_locale_or_auto(value: &str) -> Result<UiLocaleValue> {\n    UiLocaleValue::from_setting(value).with_context(|| {\n        format!(\n            \"locale '{value}' is not recognized; expected one of {}\",\n            crate::localization::configured_locale_values(\", \")\n        )\n    })\n}","typeGuard":"fn is_valid_locale(value: &str) -> bool {\n    crate::localization::normalize_configured_locale(value).is_some()\n}","tryCatchPattern":null,"preventionTips":["Never write raw environment locale names (LC_ALL style) into the setting; map them to supported tags first","Validate config values in one place at load time so the error carries the file and key context","Default to \"auto\" when a locale value is missing instead of inventing one"],"tags":["config","locale","rust","tui","invalid-value"],"backgroundTag":"unsupported-locale","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}