From 330060f9548fff9c029d146afd2f16fbe5815f92 Mon Sep 17 00:00:00 2001 From: Daniel Svitan Date: Wed, 22 Oct 2025 13:53:44 +0200 Subject: [PATCH] :globe_with_meridians: Adds i18n capabilities --- astro.config.mjs | 9 +- src/i18n/ui.ts | 18 ++ src/i18n/utils.ts | 7 + src/pages/[lang]/index.astro | 326 +++++++++++++++++++++++++++++++++++ src/pages/index.astro | 311 +-------------------------------- 5 files changed, 361 insertions(+), 310 deletions(-) create mode 100644 src/i18n/ui.ts create mode 100644 src/i18n/utils.ts create mode 100644 src/pages/[lang]/index.astro diff --git a/astro.config.mjs b/astro.config.mjs index db87ce6..2280995 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -10,5 +10,12 @@ export default defineConfig({ // @ts-ignore plugins: [tailwindcss()] }, - integrations: [vue()] + integrations: [vue()], + i18n: { + locales: ["en", "sk"], + defaultLocale: "en", + routing: { + prefixDefaultLocale: true, + } + } }); diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts new file mode 100644 index 0000000..bcd0671 --- /dev/null +++ b/src/i18n/ui.ts @@ -0,0 +1,18 @@ +export const languages = { + en: 'English', + sk: 'Slovak', +}; + +export const defaultLang = 'en'; + +export const ui = { + en: { + 'nav.home': 'Home', + 'nav.hello': 'Hello', + 'nav.twitter': 'Twitter', + }, + sk: { + 'nav.home': 'Start', + 'nav.hello': 'Hallo', + }, +} as const; diff --git a/src/i18n/utils.ts b/src/i18n/utils.ts new file mode 100644 index 0000000..b45e32d --- /dev/null +++ b/src/i18n/utils.ts @@ -0,0 +1,7 @@ +import {ui, defaultLang} from "./ui"; + +export function useTranslations(lang: keyof typeof ui) { + return function t(key: keyof typeof ui[typeof defaultLang]) { + return key in ui[lang] ? (ui[lang] as any)[key] : ui[defaultLang][key]; + } +} diff --git a/src/pages/[lang]/index.astro b/src/pages/[lang]/index.astro new file mode 100644 index 0000000..0173f94 --- /dev/null +++ b/src/pages/[lang]/index.astro @@ -0,0 +1,326 @@ +--- +import Layout from "../../layouts/Layout.astro"; +import ArrowLink from "../../components/ArrowLink.astro" +import {useTranslations} from "../../i18n/utils.ts"; + +const now = new Date(); +let years = now.getFullYear() - 2006 - 1; +if (now.getMonth() > 7 || (now.getMonth() === 7 && now.getDate() >= 23)) { + years++; +} +let a = years === 18 ? "an " : "a "; + +const {lang} = Astro.params; +const t = useTranslations(lang as "en" | "sk"); + +export function getStaticPaths() { + return [ + {params: {lang: "en"}}, + {params: {lang: "sk"},}, + ]; +} +--- + + + + +
+
+ +
+

Note: this page has been kept simple in favor of accessibility

+
+ +

Hi, I'm Daniel Svitaň, {a} {years} year-old aspiring + engineer

+

Residence: Bratislava, Slovakia

+
+ +

Contacts:

+ +
+ +

Socials:

+ + +
+ +

Experience:

+ + + + + + + + + + +

When

Occupation and details

July, 2024 - presentData Scientist
+ Faculty of Electronics and Informatics, Slovak Technical University in Bratislava (FEI STU) + +
    +
  • Created data labeling system for the ECG quality classification neural network
  • +
  • Contributed to the ECG quality classification neural network
  • +
  • Created quality classification system based on ECG quality classification neural + network +
  • +
  • Wrote the Tom & Jerry LabChart Text File Dynamic Sync Algorithm
  • +
+

+ Publications: + +

+
+ +
+ +

Education:

+ + + + + + + + + + + + + + + + + + + + +

When

Where

2024 - presentEvanjelické Lýceum Bratislava - 5-year Bilingual Gymnasium (high school)
2023 - 2024Spojená škola Svätej Rodiny v Bratislave - 8-year Gymnasium (high school)
2022 - 2023Del Mar High School in San Jose, California, United States of America
+ +
+ +

Skills:

+
    +
  • Languages: Slovak (native), English (C1), German (B1)
  • +
  • Data science: PyTorch (neural networks), Matplotlib, SciPy, NumPy
  • +
  • Sysadmin: Docker, Caddy, ZFS, Linux
  • +
  • Frontend: HTML, CSS/SCSS, JavaScript/TypeScript, TailWindCSS, React, Vue, Nuxt, Astro
  • +
  • Backend: Ktor (Kotlin), Fiber (Go), Echo (Go), FastAPI (Python), NestJS (TypeScript)
  • +
  • Database: MySQL, PostgreSQL, Redis/Valkey, Firestore, MongoDB
  • +
  • Math: Calculus (1), Statistics, Linear algebra
  • +
  • Other: Driver license type B (Slovak), LibreOffice
  • +
+ +

Having my own TrueNAS Scale server at home, I've self-hosted multiple apps and projects, + including Nextcloud, Immich, Gitea, Prometheus+Grafana, ngIRCd, WireGuard Easy, and many more.

+

I route them all through my Caddy reverse proxy, but since my server is behind NAT, I also have a VPS + that is connected to my server through a tunnel and routes all of the traffic to my server through that + tunnel.

+

I also protect myself against data loss with a RAIDZ1 ZFS pool, regular backups (monthly to an + off-site physical drive owned by me and every two days to a cloud storage box), and regular ZFS + Scrubs.

+

And everything is encrypted, my pool and both backups with a randomly generated binary file.

+

Needless to say, I've got some experience with system administration as well as Linux systems, since I + also daily drive Arch Linux.

+ +
+ +

Some of my projects:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Name

Reference

Description

Tags

SOČ 2024/2025 Paper + + + Research paper entitled "Faktory ovplyvňujúce študijné výsledky a identifikácia rizikových + skupín", which won first place in the regional round of the competition + + #statistics + #research +
State SOČ Cross Examination + + Cross examination of the Slovak State SOC Competition results and the analysis of the judges' + bias + + #statistics +
Door alarm + + A home-made door alarm based on ultrasound sensor distance measurements (in development) + #electronics + #go +
Green School / Zelená Škola + + + A website for a school club of environmentalists + #web-dev + #nuxt +
Automod + + A discord bot for my local community + #discord + #kotlin +
Pwetty + + A very, very simple json prettifier + #c + #assembly +
Keys + + A very simple client-server based keylogger for Windows, Linux, and MacOS + #go + #keylogger +
Adventná Výzva + + + An interactive game-like app for kids with an advent theme + #web-dev + #react +
+ +

And many other closed-source projects, especially contracts (like NatArt) and the + tens of projects at FEI STU (including multiple algorithms and labeling / data processing systems, + mostly concerned with bio-medical signals like ECG or PPG).

+ +
+ +

About me and my interests:

+

I spend most of my free time working on various projects of mine; I've recently decided to expand my + horizons and work on some projects that are not pure computer science. But other than that, I like to go + on walks, listen to music, and I occasionally play video games.

+

I also love going rollerblading and I used to play airsoft, but I haven't had the time to play recently. + And, believe it or not, I like to cook and read books as well.

+

When I grow up, I want to study mechanical engineering, since I take interest in engineering in general, + not just programming. I'm still not sure which university I want to go to, but chances are that it will + be somewhere in Germany, Benelux, or Scandinavia (or Czechia and Slovakia as a last resort). Both my + parents are successful engineers (chemical, not mechanical though), so I have a lot to live up + to.

+

But currently, I'm just trying to survive high school.

+ +
+ +

Note: the source code of this website is available + here +

+
+ +
+
+ diff --git a/src/pages/index.astro b/src/pages/index.astro index 3ff21ae..05365ff 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,315 +1,8 @@ --- import Layout from "../layouts/Layout.astro"; -import ArrowLink from "../components/ArrowLink.astro" - -const now = new Date(); -let years = now.getFullYear() - 2006 - 1 -if (now.getMonth() > 7 || (now.getMonth() === 7 && now.getDate() >= 23)) { - years++ -} -let a = years === 18 ? "an " : "a "; +import {defaultLang} from "../i18n/ui.ts"; --- - - -
-
- -
-

Note: this page has been kept simple in favor of accessibility

-
- -

Hi, I'm Daniel Svitaň, {a} {years} year-old aspiring - engineer

-

Residence: Bratislava, Slovakia

-
- -

Contacts:

- -
- -

Socials:

- - -
- -

Experience:

- - - - - - - - - - -

When

Occupation and details

July, 2024 - presentData Scientist
- Faculty of Electronics and Informatics, Slovak Technical University in Bratislava (FEI STU) - -
    -
  • Created data labeling system for the ECG quality classification neural network
  • -
  • Contributed to the ECG quality classification neural network
  • -
  • Created quality classification system based on ECG quality classification neural - network -
  • -
  • Wrote the Tom & Jerry LabChart Text File Dynamic Sync Algorithm
  • -
-

- Publications: - -

-
- -
- -

Education:

- - - - - - - - - - - - - - - - - - - - -

When

Where

2024 - presentEvanjelické Lýceum v Bratislave - 5-year Bilingual Gymnasium (high school)
2023 - 2024Spojená škola Svätej Rodiny v Bratislave - 8-year Gymnasium (high school)
2022 - 2023Del Mar High School in San Jose, California, United States of America
- -
- -

Skills:

-
    -
  • Languages: Slovak (native), English (C1), German (B1)
  • -
  • Data science: PyTorch (neural networks), Matplotlib, SciPy, NumPy
  • -
  • Sysadmin: Docker, Caddy, ZFS, Linux
  • -
  • Frontend: HTML, CSS/SCSS, JavaScript/TypeScript, TailWindCSS, React, Vue, Nuxt, Astro
  • -
  • Backend: Ktor (Kotlin), Fiber (Go), Echo (Go), FastAPI (Python), NestJS (TypeScript)
  • -
  • Database: MySQL, PostgreSQL, Redis/Valkey, Firestore, MongoDB
  • -
  • Math: Calculus (1), Statistics, Linear algebra
  • -
  • Other: Driver license type B (Slovak), LibreOffice
  • -
- -

Having my own TrueNAS Scale server at home, I've self-hosted multiple apps and projects, - including Nextcloud, Immich, Gitea, Prometheus+Grafana, ngIRCd, WireGuard Easy, and many more.

-

I route them all through my Caddy reverse proxy, but since my server is behind NAT, I also have a VPS - that is connected to my server through a tunnel and routes all of the traffic to my server through that - tunnel.

-

I also protect myself against data loss with a RAIDZ1 ZFS pool, regular backups (monthly to an - off-site physical drive owned by me and every two days to a cloud storage box), and regular ZFS - Scrubs.

-

And everything is encrypted, my pool and both backups with a randomly generated binary file.

-

Needless to say, I've got some experience with system administration as well as Linux systems, since I - also daily drive Arch Linux.

- -
- -

Some of my projects:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Name

Reference

Description

Tags

SOČ 2024/2025 Paper - - - Research paper entitled "Faktory ovplyvňujúce študijné výsledky a identifikácia rizikových - skupín", which won first place in the regional round of the competition - - #statistics - #research -
State SOČ Cross Examination - - Cross examination of the Slovak State SOC Competition results and the analysis of the judges' - bias - - #statistics -
Door alarm - - A home-made door alarm based on ultrasound sensor distance measurements (in development) - #electronics - #go -
Green School / Zelená Škola - - - A website for a school club of environmentalists - #web-dev - #nuxt -
Automod - - A discord bot for my local community - #discord - #kotlin -
Pwetty - - A very, very simple json prettifier - #c - #assembly -
Keys - - A very simple client-server based keylogger for Windows, Linux, and MacOS - #go - #keylogger -
Adventná Výzva - - - An interactive game-like app for kids with an advent theme - #web-dev - #react -
- -

And many other closed-source projects, especially contracts (like NatArt) and the - tens of projects at FEI STU (including multiple algorithms and labeling / data processing systems, - mostly concerned with bio-medical signals like ECG or PPG).

- -
- -

About me and my interests:

-

I spend most of my free time working on various projects of mine; I've recently decided to expand my - horizons and work on some projects that are not pure computer science. But other than that, I like to go - on walks, listen to music, and I occasionally play video games.

-

I also love going rollerblading and I used to play airsoft, but I haven't had the time to play recently. - And, believe it or not, I like to cook and read books as well.

-

When I grow up, I want to study mechanical engineering, since I take interest in engineering in general, - not just programming. I'm still not sure which university I want to go to, but chances are that it will - be somewhere in Germany, Benelux, or Scandinavia (or Czechia and Slovakia as a last resort). Both my - parents are successful engineers (chemical, not mechanical though), so I have a lot to live up - to.

-

But currently, I'm just trying to survive high school.

- -
- -

Note: the source code of this website is available - here -

-
- -
-
+