Skip to content

Commit f1640a7

Browse files
authored
Merge pull request #21 from kyoto-tech/og-trans
OpenGraph translations
2 parents 5bc2eee + 87b9387 commit f1640a7

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

src/i18n/ui.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export const ui = {
6060
"home.footer.github": "GitHub",
6161
"home.footer.discord": "Discord",
6262
"home.footer.meetup": "Meetup",
63+
64+
"meta.siteName": "Kyoto Tech Meetup",
65+
"meta.title": "Kyoto Tech Meetup — Connect, learn, and build together in Japan's cultural heart",
66+
"meta.description": "Gatherings for developers, designers, researchers, and founders exploring technology in Kyoto. Conversation-first meetups, community hack days, and collaborations in the city's tech scene.",
67+
"meta.imageAlt": "Community meetup in Kyoto for builders and technologists",
6368
},
6469
ja: {
6570
"a11y.skipToMain": "メインコンテンツへスキップ",
@@ -115,6 +120,11 @@ export const ui = {
115120
"home.footer.socialNavLabel": "ソーシャルリンク",
116121
"home.footer.github": "GitHub",
117122
"home.footer.discord": "Discord",
118-
"home.footer.meetup": "Meetup"
123+
"home.footer.meetup": "Meetup",
124+
125+
"meta.siteName": "Kyoto Tech Meetup",
126+
"meta.title": "Kyoto Tech Meetup — 日本の文化都市・京都でつながり、学び、つくるコミュニティ",
127+
"meta.description": "京都でテクノロジーを探求するデベロッパー、デザイナー、研究者、ファウンダーのための集まり。会話重視のミートアップ、コミュニティハックデー、コラボレーションを通じて、京都のテックシーンを盛り上げています。",
128+
"meta.imageAlt": "京都で開催される、テクノロジーに関心のある人たちのコミュニティミートアップ"
119129
},
120130
} as const;

src/layouts/Layout.astro

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
import "../styles/global.css";
3-
import { useTranslations } from "../i18n/utils";
3+
import { useTranslations } from '../i18n/utils';
4+
import { getRelativeLocaleUrl } from 'astro:i18n';
45
5-
const activeLang = Astro.currentLocale as keyof typeof import("../i18n/ui").ui;
6-
const t = useTranslations(activeLang);
6+
const activeLang = Astro.currentLocale;
7+
const t = useTranslations(activeLang || 'en');
78
---
89

910
<!doctype html>
@@ -15,32 +16,32 @@ const t = useTranslations(activeLang);
1516
<meta name="generator" content={Astro.generator} />
1617
<meta
1718
name="description"
18-
content="Gatherings for developers, designers, researchers, and founders exploring technology in Kyoto. Conversation-first meetups, community hack days, and collaborations in the city’s tech scene."
19+
content={t("meta.description")}
1920
/>
2021
<meta property="og:type" content="website" />
21-
<meta property="og:site_name" content="Kyoto Tech Meetup" />
22-
<meta property="og:title" content="Kyoto Tech Meetup — Connect, learn, and build together in Japan's cultural heart" />
22+
<meta property="og:site_name" content={t("meta.siteName")} />
23+
<meta property="og:title" content={t("meta.title")} />
2324
<meta
2425
property="og:description"
25-
content="Gatherings for developers, designers, researchers, and founders exploring technology in Kyoto. Conversation-first meetups, community hack days, and collaborations in the city’s tech scene."
26+
content={t("meta.description")}
2627
/>
27-
<meta property="og:url" content="https://kyoto-tech.github.io/" />
28+
<meta property="og:url" content=`https://kyoto-tech.github.io${getRelativeLocaleUrl(activeLang, "/")}` />
2829
<meta property="og:image" content="https://kyoto-tech.github.io/og/kyoto-tech-meetup.png" />
2930
<meta property="og:image:width" content="1200" />
3031
<meta property="og:image:height" content="630" />
31-
<meta property="og:image:alt" content="Community meetup in Kyoto for builders and technologists" />
32+
<meta property="og:image:alt" content={t("meta.imageAlt")} />
3233
<meta name="twitter:card" content="summary_large_image" />
33-
<meta name="twitter:title" content="Kyoto Tech Meetup — Connect, learn, and build together in Japan's cultural heart" />
34+
<meta name="twitter:title" content={t("meta.title")} />
3435
<meta
3536
name="twitter:description"
36-
content="Gatherings for developers, designers, researchers, and founders exploring technology in Kyoto. Conversation-first meetups, community hack days, and collaborations in the city’s tech scene."
37+
content={t("meta.description")}
3738
/>
3839
<meta name="twitter:image" content="https://kyoto-tech.github.io/og/kyoto-tech-meetup.png" />
39-
<meta name="twitter:image:alt" content="Community meetup in Kyoto for builders and technologists" />
40-
<title>Kyoto Tech Meetup</title>
41-
</head>
42-
<body>
43-
<a class="skip-link" href="#main-content">{t("a11y.skipToMain")}</a>
44-
<slot />
45-
</body>
46-
</html>
40+
<meta name="twitter:image:alt" content={t("meta.imageAlt")} />
41+
<title>{t("meta.siteName")}</title>
42+
</head>
43+
<body>
44+
<a class="skip-link" href="#main-content">{t("a11y.skipToMain")}</a>
45+
<slot />
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)