{"record":{"id":"df6391213a4589f8","repo":"zed-industries/zed","slug":"no-localised-string-for-locale","errorCode":null,"errorMessage":"No localised string for {locale}","messagePattern":"No localised string for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/direct_write.rs","lineNumber":1839,"sourceCode":"#[inline]\nconst fn make_direct_write_tag(tag_name: &str) -> DWRITE_FONT_FEATURE_TAG {\n    DWRITE_FONT_FEATURE_TAG(make_open_type_tag(tag_name))\n}\n\n#[inline]\nfn get_name(string: IDWriteLocalizedStrings, locale: &HSTRING) -> Result<String> {\n    let mut locale_name_index = 0u32;\n    let mut exists = BOOL(0);\n    unsafe { string.FindLocaleName(locale, &mut locale_name_index, &mut exists as _)? };\n    if !exists.as_bool() {\n        unsafe {\n            string.FindLocaleName(\n                DEFAULT_LOCALE_NAME,\n                &mut locale_name_index as _,\n                &mut exists as _,\n            )?\n        };\n        anyhow::ensure!(exists.as_bool(), \"No localised string for {locale}\");\n    }\n\n    let name_length = unsafe { string.GetStringLength(locale_name_index) }? as usize;\n    let mut name_vec = vec![0u16; name_length + 1];\n    unsafe {\n        string.GetString(locale_name_index, &mut name_vec)?;\n    }\n\n    Ok(String::from_utf16_lossy(&name_vec[..name_length]))\n}\n\nfn get_system_subpixel_rendering() -> bool {\n    let mut value = c_uint::default();\n    let result = unsafe {\n        SystemParametersInfoW(\n            SPI_GETFONTSMOOTHINGTYPE,\n            0,\n            Some((&mut value) as *mut c_uint as *mut c_void),","sourceCodeStart":1821,"sourceCodeEnd":1857,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_windows/src/direct_write.rs#L1821-L1857","documentation":"Raised in `get_name` (DirectWrite font metadata helper) after `FindLocaleName` fails to find the requested locale AND the DEFAULT_LOCALE_NAME fallback lookup also reports no matching localized string — the IDWriteLocalizedStrings genuinely has no entry for either locale, so the requested font property (family/face name) cannot be resolved.","triggerScenarios":"Thrown at crates/gpui_windows/src/direct_write.rs:1839 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Iterate all GetLocaleNameLength/GetLocaleName entries and pick the first available instead of failing.","Fall back to index 0 of the localized strings collection as a last resort.","Return an empty/placeholder name rather than erroring for cosmetic metadata lookups.","Log the font identity alongside the error to identify the offending font file."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}