import { replaceWithEach } from './aria.js';
/**
 * Look up a localized string from window.BRIGHTSPOT.ui[namespace][key],
 * falling back to the provided English default.
 *
 * @param namespace - Component namespace (e.g., 'pagination')
 * @param key - String key within the namespace
 * @param fallback - English default when no global override exists
 * @param replacements - Positional values to substitute for sequential `___`
 *   (triple-underscore) placeholders in the resolved string.
 *   E.g., `l10n('ns', 'k', '___-___ of ___', [1, 10, 200])` → `"1-10 of 200"`
 */
export function l10n(namespace, key, fallback, replacements) {
    const ui = window.BRIGHTSPOT?.ui;
    const value = ui?.[namespace]?.[key] ?? fallback;
    if (replacements?.length) {
        return replaceWithEach(value, replacements.map(String));
    }
    return value;
}
//# sourceMappingURL=i18n.js.map