Replies: 1 comment
-
Hi @lujohns! import { t /*, locale, loadTranslations */ } from '$lib/translations';
/** @type {import('./$types').RequestHandler} */
export async function GET() {
// Don't forget lo load translations if needed
// const lang = locale.get(); // or get from the request
// await loadTranslations(lang, 'some-context');
const output = t.get('some-context.key', { /* payload */ });
return new Response(output);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I haven't found a way to use this in endpoints? I am getting
TypeError: vite_ssr_import_4.t is not a function
thank you!
Beta Was this translation helpful? Give feedback.
All reactions