import { __awaiter } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
import { getTranslations } from 'next-intl/server';

const defaultFumaTranslations = {
    search: 'Search',
    searchNoResult: 'No results found',
    toc: 'On this page',
    tocNoHeadings: 'No Headings',
    lastUpdate: 'Last updated on',
    chooseLanguage: 'Choose a language',
    nextPage: 'Next Page',
    previousPage: 'Previous Page',
    chooseTheme: 'Theme',
    editOnGithub: 'Edit on GitHub',
};
function resolveTranslation(t, key) {
    const value = t.raw(key);
    return typeof value === 'string' ? value : defaultFumaTranslations[key];
}
function getFumaTranslations(locale) {
    return __awaiter(this, void 0, void 0, function* () {
        const t = yield getTranslations({ locale, namespace: 'fuma' });
        return {
            search: resolveTranslation(t, 'search'),
            searchNoResult: resolveTranslation(t, 'searchNoResult'),
            toc: resolveTranslation(t, 'toc'),
            tocNoHeadings: resolveTranslation(t, 'tocNoHeadings'),
            lastUpdate: resolveTranslation(t, 'lastUpdate'),
            chooseLanguage: resolveTranslation(t, 'chooseLanguage'),
            nextPage: resolveTranslation(t, 'nextPage'),
            previousPage: resolveTranslation(t, 'previousPage'),
            chooseTheme: resolveTranslation(t, 'chooseTheme'),
            editOnGithub: resolveTranslation(t, 'editOnGithub'),
        };
    });
}

export { getFumaTranslations };
