let runtimeI18nBinding = null;
function normalizeRuntimeI18n(value) {
    if (value && typeof value === 'object') {
        const candidate = value;
        if (typeof candidate.addResourceBundle === 'function') {
            return candidate;
        }
    }
    return null;
}
export function bindRuntimeI18n(instance) {
    runtimeI18nBinding = normalizeRuntimeI18n(instance);
}
export function unbindRuntimeI18n() {
    runtimeI18nBinding = null;
}
export function getPromptLocale() {
    const language = runtimeI18nBinding?.language || runtimeI18nBinding?.resolvedLanguage || '';
    return language.startsWith('zh') ? 'zh' : 'en';
}
//# sourceMappingURL=i18n.js.map