import { jsx as _jsx } from "react/jsx-runtime";
import { IntlProvider, createIntl } from "react-intl";
import { DefaultLocale, resolveLocale, useResolveMessages } from "@gooddata/sdk-ui";
import { DEFAULT_MESSAGES, resolveMessages } from "./translations.js";
export function createInternalIntl(locale = DefaultLocale, messages) {
    // Create intl with empty messages - translations should be loaded via InternalIntlWrapper
    const config = {
        locale,
        messages,
    };
    return createIntl(config);
}
export function InternalIntlWrapper({ locale = DefaultLocale, children }) {
    const messages = useResolveMessages(resolveLocale(locale), resolveMessages, DEFAULT_MESSAGES);
    if (!messages[locale]) {
        return null;
    }
    return (_jsx(IntlProvider, { locale: locale, messages: messages[locale], children: children }));
}
//# sourceMappingURL=internalIntlProvider.js.map