feature/build (#1)
Co-authored-by: Tobias Klemp <tobias.klemp@v-office.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -6,8 +6,22 @@
|
||||
Tolgee,
|
||||
DevTools,
|
||||
FormatSimple,
|
||||
type TolgeeStaticData,
|
||||
} from '@tolgee/svelte'
|
||||
import { TopBar } from '$lib/components/ui/topBar'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import type { Snippet } from 'svelte'
|
||||
|
||||
let { children, data }: { data: TolgeeStaticData; children: Snippet } =
|
||||
$props()
|
||||
|
||||
function getLang(lang: string) {
|
||||
return async (): Promise<Record<string, any>> => {
|
||||
const res = await fetch(`/lang/${lang}`)
|
||||
const translations = await res.json()
|
||||
return translations
|
||||
}
|
||||
}
|
||||
|
||||
const tolgee = Tolgee()
|
||||
.use(DevTools())
|
||||
@@ -16,14 +30,14 @@
|
||||
language: 'de',
|
||||
|
||||
// for development
|
||||
apiUrl: import.meta.env.VITE_TOLGEE_API_URL,
|
||||
apiKey: import.meta.env.VITE_TOLGEE_API_KEY,
|
||||
apiUrl: env.PUBLIC_TOLGEE_API_URL,
|
||||
apiKey: env.PUBLIC_TOLGEE_API_KEY,
|
||||
|
||||
// for production
|
||||
staticData: {},
|
||||
staticData: {
|
||||
de: data['de'] ?? getLang('de'),
|
||||
},
|
||||
})
|
||||
|
||||
let { children } = $props()
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
Reference in New Issue
Block a user