Skip to content

Commit b9873a1

Browse files
committed
Start localizing the about page
Since I'm going to experiment with markdown stuff I'm going to use this commit as a restore point I can come back to in case I screw something up
1 parent 37edf1b commit b9873a1

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/lib/lang/en/about.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"pagename": "About",
3+
"header": "About",
4+
"watsonindustrieslogo.alttext": "Watson Industries logo",
5+
"description": ""
6+
}

src/lib/lang/localizationIndex.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
{
66
"key": "home",
77
"routes": ["/"]
8+
},
9+
{
10+
"key": "about",
11+
"routes": ["/about"]
812
}
913
]

src/routes/about/+page.svelte

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@
44
import watsonIndustriesLogo from "$lib/logos/watson-industries-dark.png";
55
66
export let data: PageData;
7+
8+
import { t } from '$lib/translations';
9+
const pageTitle = $t(
10+
"common.sitetitle",
11+
{
12+
sitename: $t("common.watsonindustries"),
13+
pagename: $t("about.pagename")
14+
} as any // TS moment
15+
);
716
</script>
817

918
<svelte:head>
10-
<title>Watson Industries - About</title>
19+
<title>{pageTitle}</title>
1120
</svelte:head>
1221

1322
<div class="w-screen bg-primary text-accent space-y-6 py-6">
14-
<h1 class="text-center text-5xl font-bold font-norwester">About</h1>
23+
<h1 class="text-center text-5xl font-bold font-norwester">{$t("about.header")}</h1>
1524
<div class="px-4">
1625
<img
1726
src={watsonIndustriesLogo}
18-
alt="HoloEN Minecraft Hyperloop"
27+
alt={$t("about.watsonindustrieslogo.alttext")}
1928
class="sm:max-w-4xl md:max-w-2xl xl:max-w-6xl max-h-80 max-w-screen mx-auto shadow-md rounded"
2029
/>
2130
</div>

0 commit comments

Comments
 (0)