@@ -4,13 +4,16 @@ import type { BrandType } from 'src/types/variants';
44
55import Birdi from ' @assets/img/brands/birdi.webp' ;
66import LocaleSelect from ' ./i18n/LocaleSelect.astro' ;
7-
8- import { useTranslations , type Lang } from ' src/i18n' ;
7+ import { getRelativeLocaleUrl } from ' astro:i18n ' ;
8+ import { DEFAULT_LOCALE , useTranslations , type Lang } from ' src/i18n' ;
99import { Image } from ' astro:assets' ;
1010import ThemeIcon from ' ./ThemeIcon.astro' ;
1111
1212const t = useTranslations (Astro .currentLocale as Lang );
1313
14+ const currentLocale =
15+ (Astro .currentLocale as Lang | undefined ) ?? DEFAULT_LOCALE ;
16+
1417interface Props {
1518 variant? : BrandType ;
1619 noLinks? : boolean ;
@@ -23,7 +26,7 @@ const { variant, noLinks = false } = Astro.props;
2326 variant === ' radapls' ? (
2427 <header class = " header" id = " header" >
2528 <nav class = " nav container" >
26- <a href = " / " class = " nav__logo" data-astro-reload >
29+ <a href = { getRelativeLocaleUrl ( currentLocale , ' / ' ) } class = " nav__logo" >
2730 <Image
2831 class = " radapls-brand"
2932 src = { Logo }
@@ -38,7 +41,7 @@ const { variant, noLinks = false } = Astro.props;
3841 <div class = " nav__menu" id = " nav-menu" >
3942 <ul class = " nav__list grid" >
4043 <li class = " nav__item" >
41- <a href = " #About" class = " nav__link" data-astro-reload >
44+ <a href = " #About" class = " nav__link" >
4245 <svg
4346 class = " nav__icon"
4447 width = " 20"
@@ -64,7 +67,7 @@ const { variant, noLinks = false } = Astro.props;
6467 </a >
6568 </li >
6669 <li class = " nav__item" >
67- <a href = " #Skills" class = " nav__link" data-astro-reload >
70+ <a href = " #Skills" class = " nav__link" >
6871 <svg
6972 class = " nav__icon"
7073 width = " 20"
@@ -90,7 +93,7 @@ const { variant, noLinks = false } = Astro.props;
9093 </a >
9194 </li >
9295 <li class = " nav__item" >
93- <a href = " #Portfolio" class = " nav__link" data-astro-reload >
96+ <a href = " #Portfolio" class = " nav__link" >
9497 <svg
9598 class = " nav__icon"
9699 width = " 20"
@@ -116,7 +119,7 @@ const { variant, noLinks = false } = Astro.props;
116119 </a >
117120 </li >
118121 <li class = " nav__item" >
119- <a href = " #Contact" class = " nav__link" data-astro-reload >
122+ <a href = " #Contact" class = " nav__link" >
120123 <svg
121124 class = " nav__icon"
122125 width = " 20"
@@ -142,7 +145,7 @@ const { variant, noLinks = false } = Astro.props;
142145 </a >
143146 </li >
144147 <li class = " nav__item" >
145- <a href = " /blog " class = " nav__link" data-astro-reload >
148+ <a href = { getRelativeLocaleUrl ( currentLocale , ' blog ' ) } class = " nav__link" >
146149 <svg
147150 class = " nav__icon"
148151 width = " 20"
@@ -210,7 +213,7 @@ const { variant, noLinks = false } = Astro.props;
210213 <header class = " header" id = " header" >
211214 <nav class = " nav container" >
212215 <div class = " co-brand" >
213- <a href = " / " >
216+ <a href = { getRelativeLocaleUrl ( currentLocale , ' / ' ) } >
214217 <Image
215218 class = " radapls-brand"
216219 src = { Logo }
0 commit comments