File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 11---
22import { Image } from " astro:assets" ;
3- import { getLanguages , getLanguageFromURL , useTranslations } from " ../i18n/utils" ;
3+ import { getLanguageFromURL , useTranslations } from " ../i18n/utils" ;
44import PageLayout from " ../layouts/PageLayout.astro" ;
5+ import { defaultLang , languages } from " ../i18n/ui" ;
56
6- Astro .params .lang = " en" ;
7+ const urlLang = getLanguageFromURL (Astro .url );
8+ const lang = urlLang && languages .includes (urlLang , 0 ) ?
9+ urlLang
10+ : defaultLang ;
711
8- getLanguages ().forEach (intl => {
9- if (getLanguageFromURL (Astro .url ) !== intl )
10- return ;
11-
12- Astro .params .lang = intl ;
13- });
14-
15- const tr = useTranslations (Astro .params .lang );
12+ const tr = useTranslations (lang );
1613---
1714
18- <PageLayout title =" retrozinndev | 404!" >
15+ <PageLayout title =" retrozinndev | 404!" { lang } >
1916 <div class =" not-found" >
2017 <div class =" flowbox" >
2118 <div class =" image-container" >
You can’t perform that action at this time.
0 commit comments