fix: env variables
Some checks failed
CI / build-and-test (pull_request) Failing after 11m37s

This commit is contained in:
Tobias Klemp
2025-12-07 16:29:37 +01:00
parent e1f1e867d6
commit 6581cff44f
2 changed files with 7 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
import type { TolgeeStaticData } from '@tolgee/svelte' import type { TolgeeStaticData } from '@tolgee/svelte'
import { env } from '$env/dynamic/private' import { env } from '$env/dynamic/private'
import { TOLGEE_API_KEY, TOLGEE_API_URL } from '$env/static/private'
import { loadAsync } from 'jszip' import { loadAsync } from 'jszip'
class TranslationCacheItem { class TranslationCacheItem {
@@ -12,7 +11,7 @@ class TranslationCacheItem {
get isExpired(): boolean { get isExpired(): boolean {
const now = Date.now() const now = Date.now()
const TTL = Number(env.PRIVATE_TRANSLATION_CACHE_TTL) const TTL = Number(env.TRANSLATION_CACHE_TTL)
if (Number.isNaN(TTL)) return false if (Number.isNaN(TTL)) return false
@@ -64,7 +63,7 @@ class LanguageService {
} }
protected async fetchTranslations(languageCodes: string | string[]) { protected async fetchTranslations(languageCodes: string | string[]) {
const url = new URL(`${TOLGEE_API_URL}/v2/projects/2/export`) const url = new URL(`${env.TOLGEE_API_URL}/v2/projects/2/export`)
url.searchParams.append('format', 'JSON') url.searchParams.append('format', 'JSON')
url.searchParams.append('zip', 'true') url.searchParams.append('zip', 'true')
@@ -77,7 +76,7 @@ class LanguageService {
const response = await fetch(url, { const response = await fetch(url, {
method: 'GET', method: 'GET',
headers: { headers: {
'X-API-Key': TOLGEE_API_KEY, 'X-API-Key': env.TOLGEE_API_KEY,
Accept: 'application/*', Accept: 'application/*',
}, },
}) })

View File

@@ -9,10 +9,7 @@
type TolgeeStaticData, type TolgeeStaticData,
} from '@tolgee/svelte' } from '@tolgee/svelte'
import { TopBar } from '$lib/components/ui/topBar' import { TopBar } from '$lib/components/ui/topBar'
import { import { env } from '$env/dynamic/public'
PUBLIC_TOLGEE_API_KEY,
PUBLIC_TOLGEE_API_URL,
} from '$env/static/public'
import type { Snippet } from 'svelte' import type { Snippet } from 'svelte'
let { children, data }: { data: TolgeeStaticData; children: Snippet } = let { children, data }: { data: TolgeeStaticData; children: Snippet } =
@@ -32,9 +29,9 @@
.init({ .init({
language: 'de', language: 'de',
// // for development // for development
// apiUrl: PUBLIC_TOLGEE_API_URL, apiUrl: env.PUBLIC_TOLGEE_API_URL,
// apiKey: PUBLIC_TOLGEE_API_KEY, apiKey: env.PUBLIC_TOLGEE_API_KEY,
// for production // for production
staticData: { staticData: {