DEV Community

Cover image for How I Generated a 500-Page Localized Site Using Only PowerShell
Oleksandr
Oleksandr

Posted on Originally published at landings.jsonexlab.com

How I Generated a 500-Page Localized Site Using Only PowerShell

As developers, we have a bad habit of over-engineering everything.

When I decided to build jsonexlab.com to sell my focused Notion templates, my first instinct was to spin up a Next.js app. I thought: "I'll need a database for the products, i18n for the languages, and a CMS for the blog."

But then I looked at the requirements. I wasn't building a complex SaaS with user authentication. I was building a static catalog of digital products.

So, I did something crazy. I deleted the Node.js setup, opened PowerShell, and wrote a script to generate raw HTML. Here is how I did it, and why it works.

The "No Framework" Stack

  • Hosting: Cloudflare Pages (Free tier, unlimited bandwidth).
  • Generation: PowerShell scripts.
  • Styles: Plain CSS.
  • Payments: Suby (Crypto).
  • Email: Web3Forms + Make.com + Brevo.

The result? A site with 500+ pages in 28 languages, zero hydration errors, zero JS bundles, and load times measured in milliseconds.

The Challenge: Translating 28 Languages

I wanted to sell my templates in Europe, Asia, and South America. That meant 28 different languages.

Doing this manually in React would have been a nightmare of JSON translation files. Instead, I wrote a PowerShell script that took my base English HTML file and applied a dictionary of translations to it.

Here is a simplified version of how the localization script works:


powershell
$translations = @{
    "es" = @{
        "You might also like" = "También te puede gustar";
        "Get PDF" = "Obtener PDF";
    }
    "de" = @{
        "You might also like" = "Das könnte dir auch gefallen";
        "Get PDF" = "PDF erhalten";
    }
}

foreach ($lang in $translations.Keys) {
    $html = [System.IO.File]::ReadAllText("base-template.html")

    foreach ($key in $translations[$lang].Keys) {
        $html = $html -replace [regex]::Escape($key), $translations[$lang][$key]
    }

    # Save to /es/index.html, /de/index.html, etc.
    [System.IO.File]::WriteAllText("$lang/index.html", $html)
}
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
alexcodebytes profile image
Oleksandr •

Writing that hreflang loop was an absolute nightmare.

I spent hours debugging why Google was ignoring my Spanish pages, only to realize I missed a single x-default tag on one product page. Doing multi-language SEO without a framework is painful but incredibly educational.

For those who have built localized sites: how do you manage hreflang tags? Do you automate them, or use a specific tool? Would love to hear your workflows! 👇