<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mubeen Khan</title>
    <description>The latest articles on DEV Community by Mubeen Khan (@mubeenkhaaan).</description>
    <link>https://dev.to/mubeenkhaaan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4155949%2F8dec5289-676e-45d3-b966-980f4271e1db.png</url>
      <title>DEV Community: Mubeen Khan</title>
      <link>https://dev.to/mubeenkhaaan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mubeenkhaaan"/>
    <language>en</language>
    <item>
      <title>How I Shipped a Bilingual EN/ES Calculator Site on Next.js Static Generation</title>
      <dc:creator>Mubeen Khan</dc:creator>
      <pubDate>Thu, 01 Oct 2026 23:01:57 +0000</pubDate>
      <link>https://dev.to/mubeenkhaaan/how-i-shipped-a-bilingual-enes-calculator-site-on-nextjs-static-generation-4no1</link>
      <guid>https://dev.to/mubeenkhaaan/how-i-shipped-a-bilingual-enes-calculator-site-on-nextjs-static-generation-4no1</guid>
      <description>&lt;p&gt;I run UtilityHub — 12 free finance calculators + money guides, Next.js 15 on Vercel. Last week I shipped the whole thing in Spanish. Here's the architecture that made it (mostly) painless.&lt;/p&gt;

&lt;h2&gt;
  
  
  The routing trick: one [locale] segment + middleware
&lt;/h2&gt;

&lt;p&gt;Instead of next-intl, I used a single &lt;code&gt;app/[locale]&lt;/code&gt; segment with a tiny middleware:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/es/*&lt;/code&gt; → served as-is (locale = es)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/en/*&lt;/code&gt; → 308 redirect to the canonical unprefixed URL&lt;/li&gt;
&lt;li&gt;everything else → rewritten to &lt;code&gt;/en/*&lt;/code&gt; internally (URL stays clean)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;English keeps its clean URLs (&lt;code&gt;/tools/mortgage-calculator&lt;/code&gt;) — zero SEO risk to existing rankings — while Spanish gets real localized slugs (&lt;code&gt;/es/tools/calculadora-de-hipoteca&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Translations as data, not components
&lt;/h2&gt;

&lt;p&gt;All calculator copy (labels, explainers, FAQs, meta) lives in &lt;code&gt;lib/tools.es.js&lt;/code&gt;, mirroring the English &lt;code&gt;lib/tools.js&lt;/code&gt; schema. The math (&lt;code&gt;lib/calculations.js&lt;/code&gt;) is shared — translation never touches numbers. A Node schema-validation script checks all 12 entries: field parity, 4 FAQs each, numeric defaults byte-identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  hreflang without tears
&lt;/h2&gt;

&lt;p&gt;Every page emits reciprocal &lt;code&gt;en&lt;/code&gt; / &lt;code&gt;es&lt;/code&gt; / &lt;code&gt;x-default&lt;/code&gt; alternates, with slug mapping via a small &lt;code&gt;lib/slug-map.js&lt;/code&gt; (EN slug ↔ ES slug both directions).&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;59 static pages, one build, &lt;code&gt;&amp;lt;html lang&amp;gt;&lt;/code&gt; correct per locale, sitemap includes all &lt;code&gt;/es&lt;/code&gt; URLs. The Spanish mortgage calculator is live if you want to poke at it: &lt;a href="https://www.theutilityhub.online/es/tools/calculadora-de-hipoteca" rel="noopener noreferrer"&gt;https://www.theutilityhub.online/es/tools/calculadora-de-hipoteca&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Full English site: &lt;a href="https://www.theutilityhub.online" rel="noopener noreferrer"&gt;https://www.theutilityhub.online&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>seo</category>
      <category>i18n</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
