/**
 * Picks a localized string from a record keyed by locale code.
 *
 * Looks up the value for `language` first, then falls back to `en` and
 * `en_us`. Returns an empty string when none of those keys carry a
 * non-empty value, even if other locales are present in the record —
 * matching the behavior consumers rely on today.
 *
 * Useful for resolving values such as `Filter.name`, where strings are
 * provided per locale.
 *
 * @param strings - Record where keys are locale codes and values are
 * the localized strings.
 * @param language - The preferred locale code.
 */
export function localizeRecord(strings, language) {
    if (!strings) {
        return '';
    }
    return strings[language] || strings.en || strings.en_us || '';
}
