Skip to content
Discussion options

You must be logged in to vote

Oh yes!

index.ts

const locale = 'en-us';
const translations = [
	{
		locale: locale,
		key: 'common',
		loader: async () => (await import('./common.json')).default
	},
	{
		locale: locale,
		key: 'global',
		loader: async () => await import('./global.json')
	},
	{
		locale: locale,
		key: 'auth',
		loader: async () => (await import('./auth.json')).default
	},
	{
		locale: locale,
		key: 'legal',
		loader: async () => (await import('./legal.json')).default
	}
];

export default translations;

I call translate in my +page.svelte => $t('auth.password')

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jarda-svoboda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #142 on September 12, 2023 21:36.