Files
klz-cables.com/.pnpm-store/v10/files/34/da130e4b6544544f68878037bfc689389662189e77e416cbf5142bfc211a1a4fd4ccbe92be7d3572475778144a19a6dafb43800d18ee204b184d7b6f91669a
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

29 lines
909 B
Plaintext

import { cache } from 'react';
import getConfig from './getConfig.js';
import getServerTranslator from './getServerTranslator.js';
// Maintainer note: `getTranslations` has two different call signatures.
// We need to define these with function overloads, otherwise TypeScript
// messes up the return type.
// Call signature 1: `getTranslations(namespace)`
// Call signature 2: `getTranslations({locale, namespace})`
// Implementation
async function getTranslations(namespaceOrOpts) {
let namespace;
let locale;
if (typeof namespaceOrOpts === 'string') {
namespace = namespaceOrOpts;
} else if (namespaceOrOpts) {
locale = namespaceOrOpts.locale;
namespace = namespaceOrOpts.namespace;
}
const config = await getConfig(locale);
return getServerTranslator(config, namespace);
}
var getTranslations_default = cache(getTranslations);
export { getTranslations_default as default };