diff --git a/inlang/source-code/editor/src/interface/editor/EditorHeader.tsx b/inlang/source-code/editor/src/interface/editor/EditorHeader.tsx index c730634576..42073066e7 100644 --- a/inlang/source-code/editor/src/interface/editor/EditorHeader.tsx +++ b/inlang/source-code/editor/src/interface/editor/EditorHeader.tsx @@ -54,14 +54,22 @@ function EditorHeader() { (user()?.isLoggedIn && "mr-14") } > - - @@ -73,9 +81,7 @@ function EditorHeader() { {link.name} - +
diff --git a/inlang/source-code/editor/src/interface/editor/Footer.tsx b/inlang/source-code/editor/src/interface/editor/Footer.tsx index 0c66083143..990608cbc4 100644 --- a/inlang/source-code/editor/src/interface/editor/Footer.tsx +++ b/inlang/source-code/editor/src/interface/editor/Footer.tsx @@ -39,7 +39,7 @@ export const getFinkResourcesLinks = () => { { name: "Submit Feedback", href: "https://github.com/orgs/opral/discussions/categories/-fink-general", - } + }, ] } @@ -99,9 +99,7 @@ const Footer = () => { {link.name} - +
diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/ParaglideJS.svelte b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/ParaglideJS.svelte index 8d35e7c7ba..aa29af1b2f 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/ParaglideJS.svelte +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/ParaglideJS.svelte @@ -69,7 +69,12 @@ defaultLanguageTag: i18n.config.defaultLanguageTag, }) - const translatedPath = getTranslatedPath(canonicalPath, language, i18n.config.translations, i18n.config.matchers) + const translatedPath = getTranslatedPath( + canonicalPath, + language, + i18n.config.translations, + i18n.config.matchers, + ) const newPathname = serializeRoute({ base: absoluteBase, @@ -102,14 +107,18 @@ {#if i18n.config.runtime.availableLanguageTags.length >= 1} {#each i18n.config.runtime.availableLanguageTags as lang} - {@const path = translatePath($page.url.pathname, lang, i18n.config.translations, - i18n.config.matchers, - { - base: absoluteBase, - availableLanguageTags: i18n.config.runtime.availableLanguageTags, - defaultLanguageTag: i18n.config.defaultLanguageTag, - prefixDefaultLanguage: i18n.config.prefixDefaultLanguage, - })} + {@const path = translatePath( + $page.url.pathname, + lang, + i18n.config.translations, + i18n.config.matchers, + { + base: absoluteBase, + availableLanguageTags: i18n.config.runtime.availableLanguageTags, + defaultLanguageTag: i18n.config.defaultLanguageTag, + prefixDefaultLanguage: i18n.config.prefixDefaultLanguage, + }, + )} {@const href = $page.url.host === "sveltekit-prerender" ? path : new URL(path, new URL($page.url)).href} diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/adapter.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/adapter.ts index 810aaa1d66..8c4e2cab79 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/adapter.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/adapter.ts @@ -151,18 +151,18 @@ export type I18nConfig = { export function createI18n(runtime: Paraglide, options?: I18nUserConfig) { const translations = resolvePathTranslations( options?.pathnames ?? {}, - runtime.availableLanguageTags + runtime.availableLanguageTags, ) if (dev) { const issues = validatePathTranslations( translations, runtime.availableLanguageTags, - options?.matchers ?? {} + options?.matchers ?? {}, ) if (issues.length) { console.warn( - `The following issues were found in your path translations. Make sure to fix them before deploying your app:` + `The following issues were found in your path translations. Make sure to fix them before deploying your app:`, ) console.table(issues) } @@ -270,7 +270,7 @@ export function createI18n(runtime: Paraglide, options?: I1 canonicalPath, lang, config.translations, - config.matchers + config.matchers, ) return serializeRoute({ @@ -304,7 +304,6 @@ export function createI18n(runtime: Paraglide, options?: I1 * ``` */ route(translatedPath: string) { - const normalizedBase = normaliseBase(base) const { path, lang, trailingSlash, dataSuffix } = getPathInfo(translatedPath, { diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.test.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.test.ts index 62bb3e9624..f8427e62f3 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.test.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.test.ts @@ -11,7 +11,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result).toEqual([]) }) @@ -26,7 +26,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -40,7 +40,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -54,7 +54,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -68,7 +68,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -82,7 +82,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(0) }) @@ -99,7 +99,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(0) }) @@ -113,7 +113,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -127,7 +127,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(0) }) @@ -144,7 +144,7 @@ describe("validatePathTranslations", () => { { int: () => true, float: () => true, - } + }, ) expect(result.length).toBe(1) }) @@ -158,7 +158,7 @@ describe("validatePathTranslations", () => { }, }, ["en", "de"], - {} + {}, ) expect(result.length).toBe(1) }) @@ -175,7 +175,7 @@ describe("validatePathTranslations", () => { { int: () => true, float: () => true, - } + }, ) expect(result.length).toBe(0) }) diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.ts index bfe464231f..a315e299df 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/config/validatePathTranslations.ts @@ -14,7 +14,7 @@ export type PathTranslationIssue = { export function validatePathTranslations( pathTranslations: PathTranslations, availableLanguageTags: readonly T[], - matchers: Record + matchers: Record, ): PathTranslationIssue[] { const issues: PathTranslationIssue[] = [] @@ -90,7 +90,7 @@ export function validatePathTranslations( issues.push({ path, message: `The following languages are missing translations: ${[...missingLanguages].join( - ", " + ", ", )}`, }) } diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/hooks/handleRedirects.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/hooks/handleRedirects.ts index 05b98da1f9..6dc2f675cc 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/hooks/handleRedirects.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/hooks/handleRedirects.ts @@ -12,7 +12,7 @@ import type { PathTranslations } from "../config/pathTranslations.js" export const handleRedirects: ( runtime: Paraglide, translations: PathTranslations, - matchers: Record + matchers: Record, ) => Handle = (runtime, translations, matchers) => async ({ event, resolve }) => { diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.test.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.test.ts index 0db2bd2856..31a25ff79c 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.test.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.test.ts @@ -17,7 +17,7 @@ describe("getCanonicalPath", () => { de: "/uber-uns", }, }, - {} + {}, ) expect(translatedPath).toBe("/") }) @@ -41,7 +41,7 @@ describe("getCanonicalPath", () => { de: "/baz", }, }, - {} + {}, ) expect(canonicalPath).toBe("/foo") }) @@ -61,7 +61,7 @@ describe("getCanonicalPath", () => { de: "/baz/[id]/[slug]", }, }, - {} + {}, ) expect(canonicalPath).toBe("/foo/123") }) @@ -81,7 +81,7 @@ describe("getCanonicalPath", () => { de: "/baz/[id]/[slug]", }, }, - {} + {}, ) expect(canonicalPath).toBe("/foo/123") }) @@ -96,7 +96,7 @@ describe("getCanonicalPath", () => { de: "/baz/[...rest]", }, }, - {} + {}, ) expect(canonicalPath).toBe("/foo/123/baz") }) @@ -111,7 +111,7 @@ describe("getCanonicalPath", () => { de: "/baz/[...rest]", }, }, - {} + {}, ) expect(canonicalPath).toBe("/foo") }) diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.ts index 34ffa91e27..401537c882 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getCanonicalPath.ts @@ -11,7 +11,7 @@ export function getCanonicalPath( translatedPath: string, lang: string, translations: PathTranslations, - matchers: Record + matchers: Record, ): string { for (const [canonicalPathDefinition, translationsForPath] of Object.entries(translations)) { if (!(lang in translationsForPath)) continue diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.test.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.test.ts index 4add4a8adb..e943036d7b 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.test.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.test.ts @@ -17,7 +17,7 @@ describe("getTranslatedPath", () => { de: "/baz", }, }, - {} + {}, ) expect(translatedPath).toBe("/bar") }) @@ -32,7 +32,7 @@ describe("getTranslatedPath", () => { de: "/baz/[id]/cvb", }, }, - {} + {}, ) expect(translatedPath).toBe("/bar/123/cvb") }) diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.ts index ebff1944f7..687fa6ce7a 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/getTranslatedPath.ts @@ -7,7 +7,7 @@ export function getTranslatedPath( canonicalPath: string, lang: string, translations: PathTranslations, - matchers: Record + matchers: Record, ) { const match = bestMatch(canonicalPath, Object.keys(translations), matchers) if (!match) return canonicalPath diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/match.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/match.ts index 686ca8e1f1..d9f455e0c8 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/match.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/match.ts @@ -4,7 +4,7 @@ import { exec, parse_route_id } from "./routing.js" export function bestMatch( canonicalPath: string, pathDefinitions: string[], - matchers: Record + matchers: Record, ): { params: Record; id: string } | undefined { let bestMatch: | { @@ -57,10 +57,10 @@ export function bestMatch( ? { id: bestMatch.id, params: bestMatch.params, - } + } : undefined } function removeTrailingSlash(path: string): string { return path.endsWith("/") ? path.slice(0, -1) : path -} \ No newline at end of file +} diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/routing.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/routing.ts index a35775cc77..f3285773cb 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/routing.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/matching/routing.ts @@ -62,8 +62,8 @@ export function parse_route_id(id: string): { ...content .slice(2) .split("-") - .map((code) => parseInt(code, 16)) - ) + .map((code) => parseInt(code, 16)), + ), ) } @@ -73,7 +73,7 @@ export function parse_route_id(id: string): { const match = /** @type {RegExpExecArray} */ param_pattern.exec(content) if (!match) { throw new Error( - `Invalid param: ${content}. Params and matcher names can only have underscores and alphanumeric characters.` + `Invalid param: ${content}. Params and matcher names can only have underscores and alphanumeric characters.`, ) } @@ -98,8 +98,8 @@ export function parse_route_id(id: string): { return "/" + result }) - .join("")}/?$` - ) + .join("")}/?$`, + ) return { pattern, params } } @@ -128,7 +128,7 @@ export function get_route_segments(route: string) { export function exec( match: RegExpMatchArray, params: RouteParam[], - matchers: Record + matchers: Record, ) { const result: Record = {} @@ -245,10 +245,10 @@ export function resolve_route(id: string, params: Record { availableLanguageTags: ["de", "en"], defaultLanguageTag: "en", prefixDefaultLanguage: "never", - } + }, ) expect(translatedPath).toBe(base + "/de/foo/bar") @@ -31,7 +31,7 @@ describe("translatePath", () => { availableLanguageTags: ["de", "en"], defaultLanguageTag: "en", prefixDefaultLanguage: "never", - } + }, ) expect(translatedPath).toBe(base + "/de/foo/bar/") @@ -48,7 +48,7 @@ describe("translatePath", () => { availableLanguageTags: ["de", "en"], defaultLanguageTag: "en", prefixDefaultLanguage: "never", - } + }, ) expect(translatedPath).toBe(base + "/de/foo/bar") @@ -65,7 +65,7 @@ describe("translatePath", () => { availableLanguageTags: ["de", "en"], defaultLanguageTag: "en", prefixDefaultLanguage: "never", - } + }, ) expect(translatedPath).toBe(base ? base + "/" : "/") diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/translatePath.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/translatePath.ts index 2572b0dcbc..559500d523 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/translatePath.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/path-translations/translatePath.ts @@ -18,7 +18,7 @@ export function translatePath( availableLanguageTags: readonly string[] defaultLanguageTag: string prefixDefaultLanguage: "always" | "never" - } + }, ) { const { path: targetedPathSource, @@ -36,7 +36,7 @@ export function translatePath( canonicalPath, targetLanguage, translations, - matchers + matchers, ) return serializeRoute({ diff --git a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/utils/serialize-path.ts b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/utils/serialize-path.ts index 60b82a5c6f..0980de3737 100644 --- a/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/utils/serialize-path.ts +++ b/inlang/source-code/paraglide/paraglide-js-adapter-sveltekit/src/runtime/utils/serialize-path.ts @@ -26,7 +26,6 @@ export function serializeRoute(opts: SerializePathOptions): string { } else { return resolvedPath } - } type SerializePathOptions = {