File tree 4 files changed +7
-14
lines changed
4 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- import { TECHNOLOGIES , type Technology } from " ../data/technologies" ;
2
+ import { TECHNOLOGIES } from " ../data/technologies" ;
3
3
import type { Experience } from " ../types" ;
4
4
5
5
interface Props extends Experience {}
Original file line number Diff line number Diff line change 2
2
import ArrowDownUpIcon from " ../icons/ArrowDownUp.astro" ;
3
3
import SpanishFlagIcon from " ../icons/SpanishFlag.astro" ;
4
4
import BritishFlagIcon from " ../icons/BritishFlag.astro" ;
5
-
6
- const THEMES = [" Español" , " English" ];
7
-
8
- const THEME_CODES = {
9
- Español: " es" ,
10
- English: " en" ,
11
- };
5
+ import { languages } from " ../i18n/ui" ;
12
6
---
13
7
14
8
<div class =" px-2" >
@@ -34,9 +28,9 @@ const THEME_CODES = {
34
28
>
35
29
<ul >
36
30
{
37
- THEMES . map ((theme ) => (
31
+ Object . keys ( languages ). map ((language ) => (
38
32
<li class = " languages-menu-option px-2 py-1.5 cursor-default hover:bg-gray-500/50 rounded-sm" >
39
- <a href = { ` /${THEME_CODES [ theme ]}/ ` } >{ theme } </a >
33
+ <a href = { ` /${languages [ language ]}/ ` } >{ language } </a >
40
34
</li >
41
35
))
42
36
}
@@ -101,7 +95,7 @@ const THEME_CODES = {
101
95
});
102
96
103
97
document.querySelectorAll(".languages-menu-option").forEach((element) => {
104
- element.addEventListener("click", (e ) => {
98
+ element.addEventListener("click", () => {
105
99
updateLanguage();
106
100
});
107
101
});
Original file line number Diff line number Diff line change 2
2
import SocialPill from " ./SocialPill.astro" ;
3
3
import OpenTabIcon from " ../icons/OpenTab.astro" ;
4
4
import GitHubIcon from " ../icons/GitHub.astro" ;
5
- import { TECHNOLOGIES , type Technology } from " ../data/technologies" ;
6
- import type { StringLiteralType } from " typescript" ;
5
+ import { TECHNOLOGIES } from " ../data/technologies" ;
7
6
import { getLangFromUrl , useTranslations } from " ../i18n/utils" ;
8
7
9
8
const lang = getLangFromUrl (Astro .url );
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
projectWefinz ,
13
13
} from "./projects" ;
14
14
15
- export const languages = {
15
+ export const languages : Record < string , string > = {
16
16
en : "English" ,
17
17
es : "Español" ,
18
18
} ;
You can’t perform that action at this time.
0 commit comments