sonnyplot.com
🌏

How to Make an Astro Site Multilingual (hreflang + i18n)

Here’s how to make an Astro site bilingual with hreflang — English and Korean. It’s the work I did while flipping this site so English is the default (/) and Korean lives at /kr/.

Why make English the default

Two reasons. One, English-speaking visitors vastly outnumber the rest, and ad rates (CPM) run higher there. Two, the writer of this site isn’t a person — it’s Claude — so maintaining two languages costs almost nothing. A human writing everything twice would never attempt it; I just have to ask. If you run a personal blog aiming for search and ad traffic, defaulting to English is worth serious thought.

How to set up i18n in Astro

  1. URL structure — put English at the root (/, /blog) and Korean under a /kr/ prefix (/kr/blog). Pass a lang prop into shared components so the same view renders in both languages
  2. Pair the posts (translationKey) — give the English and Korean versions the same translationKey in frontmatter so they know they’re a pair. That drives both the language-toggle chip at the top of each post and the hreflang tags
  3. hreflang — auto-inject <link rel="alternate" hreflang="en/ko/x-default"> into each post’s <head> so Google knows the two are language variants of the same page. x-default points to English
  4. 301-redirect old URLs — changing the language structure breaks existing links. Handle old /blog/… addresses with a 301 in the worker so visitors get forwarded. The mail should follow you when you move

The key is that these are rewritten naturally in each language, not machine-translated (machine translation hurts both quality and search). Because of that rule, I rewrote all six existing posts and the 39-entry quest log in English. The vending machine got an English edition too — Korean lyrics + romanization + an English gloss, three tiers per line — turning it into a little K-culture booth.

Everything else that day (briefly)

Two more things happened the same day. Just briefly:

  • Eolssigu Trot’s summer dropEolssigu Trot posted “10 Trot Songs to Blow Away the Heat” (a 47-minute summer medley). The concept: a woman in her 20s–30s, powerful vocals, upbeat love trot. Two rules were added to the trot-song-producer skill — ① if no main title is given, ask first (for the thumbnail’s center) ② match the singer’s styling and stage to the season and mood
  • The dig — Suno automation, 0 for 1 — until now, making songs meant hand-pasting lyrics and tags into Suno. I tried having Claude drive the browser (Claude in Chrome) and click for me. Song #1 worked (all the way to Create), but on #2 the Korean input garbled, it missed a form-confirm dialog, and above all it was slower than pasting by hand. Verdict: hand-pasting is faster for now, with the door left open to retry once Korean input is fixed. (The Digit Monster leaking numbers into vending-machine lyrics also got hunted that day — added 0–9 to the filter.)

The result

  • ✅ Bilingual English (/) / Korean (/kr/), auto language chip + hreflang, old URLs 301’d
  • ✅ Six posts and 39 quests rewritten in English, plus the vending machine’s English edition
  • ✅ Eolssigu Trot’s 10-song summer medley, two new skill rules
  • 🤖 Suno browser automation went 0 for 1 — hands are still faster
  • ⌨️ Lines of code I wrote: still zero

The lesson of the day was the automation dig — you feel like you could hand everything to the AI, but there are still clear stretches where your own hands are faster. You only learn where that line is by pressing the buttons yourself.

← Back to the log