zed-industries/zed · error

No localised string for {locale}

Error message

No localised string for {locale}

What it means

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.

Source

Thrown at crates/gpui_windows/src/direct_write.rs:1839

#[inline]
const fn make_direct_write_tag(tag_name: &str) -> DWRITE_FONT_FEATURE_TAG {
    DWRITE_FONT_FEATURE_TAG(make_open_type_tag(tag_name))
}

#[inline]
fn get_name(string: IDWriteLocalizedStrings, locale: &HSTRING) -> Result<String> {
    let mut locale_name_index = 0u32;
    let mut exists = BOOL(0);
    unsafe { string.FindLocaleName(locale, &mut locale_name_index, &mut exists as _)? };
    if !exists.as_bool() {
        unsafe {
            string.FindLocaleName(
                DEFAULT_LOCALE_NAME,
                &mut locale_name_index as _,
                &mut exists as _,
            )?
        };
        anyhow::ensure!(exists.as_bool(), "No localised string for {locale}");
    }

    let name_length = unsafe { string.GetStringLength(locale_name_index) }? as usize;
    let mut name_vec = vec![0u16; name_length + 1];
    unsafe {
        string.GetString(locale_name_index, &mut name_vec)?;
    }

    Ok(String::from_utf16_lossy(&name_vec[..name_length]))
}

fn get_system_subpixel_rendering() -> bool {
    let mut value = c_uint::default();
    let result = unsafe {
        SystemParametersInfoW(
            SPI_GETFONTSMOOTHINGTYPE,
            0,
            Some((&mut value) as *mut c_uint as *mut c_void),

View on GitHub (pinned to f4178619ac)

Solutions

  1. Iterate all GetLocaleNameLength/GetLocaleName entries and pick the first available instead of failing.
  2. Fall back to index 0 of the localized strings collection as a last resort.
  3. Return an empty/placeholder name rather than erroring for cosmetic metadata lookups.
  4. Log the font identity alongside the error to identify the offending font file.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/gpui_windows/src/direct_write.rs:1839 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/df6391213a4589f8. Report an issue: GitHub.