-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: show default language on index path (remove
/en
path) (#…
…197)
- Loading branch information
1 parent
cb9a685
commit 3db9234
Showing
33 changed files
with
220 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ const UserMenu = ({ | |
</a> | ||
</li> | ||
<li> | ||
<a href="/en"> | ||
<a href="/"> | ||
<svg | ||
width="32" | ||
height="32" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const languages = { | ||
en: 'English', | ||
de: 'German', | ||
}; | ||
|
||
const defaultLang = 'en'; | ||
|
||
export function getLangFromUrl(url: URL) { | ||
const [, lang] = url.pathname.split('/'); | ||
if (lang in languages) return lang as keyof typeof languages; | ||
return defaultLang; | ||
} | ||
|
||
export function getPathForLanguage(lang: keyof typeof languages, path: string) { | ||
return lang === defaultLang ? path : `/${lang}${path}`; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Cookie_Policy", "en"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section set:html={content.Cookie_Policy} /> | ||
</LegalLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Privacy_Policy", "en"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section class="legal__content" set:html={content.Privacy_Policy} /> | ||
</LegalLayout> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Cookie_Policy", "de"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section set:html={content.Cookie_Policy} /> | ||
</LegalLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Privacy_Policy", "de"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section class="legal__content" set:html={content.Privacy_Policy} /> | ||
</LegalLayout> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Legal_Notice", "de"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section set:html={content.legal_notice} /> | ||
</LegalLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import LegalLayout from "@layouts/LegalLayout.astro"; | ||
import getTranslatedContent from "@utils/directus.ts"; | ||
import "@styles/Legal.scss"; | ||
const content = await getTranslatedContent("Terms_Conditions", "de"); | ||
--- | ||
|
||
<LegalLayout> | ||
<section set:html={content.Terms_Conditions} /> | ||
</LegalLayout> | ||
|
||
<style> | ||
section { | ||
text-wrap: wrap; | ||
} | ||
</style> |
Oops, something went wrong.