File tree 3 files changed +51
-4
lines changed
3 files changed +51
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ export default defineConfig({
14
14
defaultLocale : "en" ,
15
15
locales : [ "es" , "en" ] ,
16
16
routing : {
17
- prefixDefaultLocale : true ,
17
+ prefixDefaultLocale : false ,
18
+ redirectToDefaultLocale : true ,
18
19
} ,
19
20
} ,
20
21
} ) ;
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ import { languages } from "../i18n/ui";
28
28
>
29
29
<ul >
30
30
{
31
- Object .keys (languages ).map ((language ) => (
31
+ Object .keys (languages ).map ((languageCode ) => (
32
32
<li class = " languages-menu-option px-2 py-1.5 cursor-default hover:bg-gray-500/50 rounded-sm" >
33
- <a href = { ` /${languages [ language ] }/ ` } >{ language } </a >
33
+ <a href = { ` /${languageCode }/ ` } >{ languages [ languageCode ] } </a >
34
34
</li >
35
35
))
36
36
}
@@ -61,7 +61,7 @@ import { languages } from "../i18n/ui";
61
61
const languagesMenu = document.getElementById("languages-menu");
62
62
63
63
const getLanguagePreference = () => {
64
- return window.location.pathname.replaceAll("/", "") ;
64
+ return document.documentElement.lang ;
65
65
};
66
66
67
67
const updateIcon = (languagePreference) => {
Original file line number Diff line number Diff line change
1
+ ---
2
+ import Layout from " ../layouts/Layout.astro" ;
3
+ import " ../styles/global.css" ;
4
+ import ExperienceTimeline from " ../components/ExperienceTimeline.astro" ;
5
+ import SectionContainer from " ../components/SectionContainer.astro" ;
6
+ import BriefCaseIcon from " ../icons/BriefCase.astro" ;
7
+ import Footer from " ../components/Footer.astro" ;
8
+ import CodeIcon from " ../icons/Code.astro" ;
9
+ import Projects from " ../components/Projects.astro" ;
10
+ import Intro from " ../components/Intro.astro" ;
11
+ import { getLangFromUrl , useTranslations } from " ../i18n/utils" ;
12
+
13
+ const lang = getLangFromUrl (Astro .url );
14
+ const t = useTranslations (lang );
15
+ ---
16
+
17
+ <Layout
18
+ title ={ t (" page.title" ) as string }
19
+ description ={ t (" page.description" ) as string }
20
+ >
21
+ <main class =" px-4" >
22
+ <SectionContainer id =" intro" class =" pt-30 md:pt-44 pb-20 md:pb-30" >
23
+ <Intro />
24
+ </SectionContainer >
25
+ <SectionContainer id =" experience" >
26
+ <h2
27
+ class =" text-xl md:text-3xl font-semibold mb-6 flex gap-x-3 items-center"
28
+ >
29
+ <BriefCaseIcon class =" size-6 md:size-7" />
30
+ { t (" experiences.title" )}
31
+ </h2 >
32
+ <ExperienceTimeline />
33
+ </SectionContainer >
34
+ <SectionContainer id =" projects" >
35
+ <h2
36
+ class =" text-xl md:text-3xl font-semibold mb-6 flex gap-x-3 items-center"
37
+ >
38
+ <CodeIcon class =" size-6 md:size-7" />
39
+ { t (" projects.title" )}
40
+ </h2 >
41
+ <Projects />
42
+ </SectionContainer >
43
+
44
+ <Footer />
45
+ </main >
46
+ </Layout >
You can’t perform that action at this time.
0 commit comments