My Biggest Mistake: Why You Should i18n Your Next.js App From Day One (A Vibe Coding Survival Guide)

My Biggest Mistake: Why You Should i18n Your Next.js App From Day One

I built a split-bill application called FAMI-KAN (originally for the Japanese market) using Next.js 15 App Router and Supabase. Since I built it mostly through “Vibe Coding” (coding iteratively with AI agents like Claude/Gemini), feature development was incredibly fast. I have absolutely zero professional programming experience, yet AI allowed me to build a fully functional product. I thought I was a genius.

Then, X (Twitter) expanded its multilingual features. Suddenly, global traffic was a real possibility. I realized: If people from around the world click my app link from X and see only Japanese, my user journey is completely broken.

So, I decided to translate my app into 8 languages.
“It should be easy with AI, right?” I thought.

I was dead wrong.
Not building with i18n (next-intl) from Day 1 was the biggest mistake of this project. Even with the power of Vibe Coding, migrating an existing, monolithic codebase was pure hell.

Here is the story of how I survived the migration, the unexpected limits of AI in this process, and how it worked out in the end.

The Nightmare: The 5,000-Line Component

In the beginning, I didn’t separate my UI text into JSON dictionaries. I just hardcoded Japanese strings directly into the components. My main event detail page (page.tsx) had ballooned to over 5,000 lines of complex, state-heavy React code.

My First Attempt: I asked the AI agent: “Find all Japanese text in this 5,000-line file and replace it with useTranslations().”

The AI’s Failure: The AI completely broke down. It hit context window limits, truncated the output, and hallucinated variables. The app wouldn’t even compile.

The Solution: I had to stop treating the AI like a magic wand.
Instead of asking AI to rewrite the React component directly, I asked the AI to write a Node.js AST (Abstract Syntax Tree) replacement script. I ran the script locally to safely extract and replace strings with t('...') in chunks. Lesson learned: Don’t let AI edit massive files directly; let AI write the tools to edit them.

Surviving Next.js 15: The “Knowledge Cutoff” Trap

Choosing a translation library was another hurdle. I went with next-intl because of its App Router support. However, my Vibe Coding approach hit a brick wall.

The AI’s Failure: Most AI models are trained on data up to 2023 or early 2024. Next.js 15 introduced a strict new rule: params in dynamic routes (like [locale]) must be a Promise. The AI kept generating old Next.js 14 code (params.locale), causing the compiler (tsc --noEmit) to scream at me with endless errors.

The Solution: As a non-programmer, I didn’t know how to fix it by reading the official docs. Instead, I had to blindly copy-paste the angry compiler errors back to the AI, over and over, forcing the AI to self-correct and update its own context through brute force. Lesson learned: Vibe Coding is amazing, but AI’s outdated knowledge will make you fight the modern compiler.

Protecting My Hard-Earned SEO

One of my biggest fears was destroying the SEO I had built for the Japanese market.

If I changed the root URL structure, my existing indexed pages and backlinks from blogs would die. I explicitly instructed the AI: “Do not touch the existing routing structure for Japanese. Only add /en/ or /es/ as subdirectories for other languages.”

Thanks to next-intl‘s middleware, I achieved this. The root / remains Japanese (protecting SEO), while /en/ handles the new English traffic. Additionally, the AI helped me build a dynamic sitemap.ts to output hreflang tags correctly.

Localization > Translation (When AI Got Too Creative)

My app generates sample demo data for first-time users.
In Japanese, the demo event was “The Tabei Family’s Trip to Okinawa.”

The Translation Issue: If I just literally translated it, English users would see “Trip to Okinawa.” Sure, they might know Tokyo or Kyoto, but Okinawa isn’t exactly relatable to everyone globally.

The Solution (The AI’s Surprising Play): I told the AI: “Make the demo data more natural for global users.”
I expected it to just use “Tokyo Trip” or “Kyoto Trip.” But to my surprise, the AI went full localization mode. It decided to completely rewrite the demo context for each language!

  • Spanish version: “The Garcia Family’s Trip to Cancún”
  • French version: “The Martin Family’s Trip to Nice”
  • Hindi version: “The Sharma Family’s Trip to Shimla”

It was hilarious that the AI completely ignored my original Japanese context, but honestly, it was the right move. This level of cultural empathy makes the app feel native to users around the world.

Bonus: Localizing for AI Crawlers (llms.txt)

Finally, we are in the era of Generative Engine Optimization (GEO). Users aren’t just searching Google; they are asking ChatGPT and Gemini.

I didn’t just translate the UI. I instructed the AI to create a /en/llms.txt and /en/llms-full.txt file for English AI crawlers. Now, when an English user asks an AI, “What is a good app to split travel costs based on ratios?”, the AI has direct, English-localized markdown context to read and recommend my app.

Conclusion

If you are starting a new Next.js project today, put next-intl in from Day 1. Even if you only support your native language. Hardcoding strings will punish you later.

Vibe coding is an incredible superpower. It allowed me—a solo developer with zero programming background—to push a massive 8-language update in a matter of days. But AI still has its limits, from context windows to outdated framework knowledge.

If you found this story helpful, you can check out FAMI-KAN here. I’ll also be launching on Product Hunt early next month, so any feedback on the English UI would be greatly appreciated!

(You can find me building in public on X at @vibe_archi)

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Designing Inspection Systems for Challenging Surfaces

Next Post

Everything Works, But Users Are Still Confused: What SaaS Teams Are Missing

Related Posts

「設計ミス」の社会を再編する:AIと共創する未来の働き方とシステム思考

こんにちは、Soraです。この記事をお読みいただき、ありがとうございます。突然ですが、少しだけ想像してみてください。朝、もう少しだけ布団の温もりを感じていたいのに、「仕事だから」と自分にムチを打って起き上がる。満員電車に身体を押し込まれ、会社に着けば成果を求められ、同僚のフォローに追われる。気づけば形式だけの会議が続き、帰宅する頃には自分のための時間はほとんど残っていない…。もし、こうした日々に少しでも心当たりがあるなら、ふと胸の奥で「このままで、本当にいいのだろうか?」という静かな声が聞こえることがあるのではないでしょうか。本稿では、その胸のざわめきを「個人の怠け」や「甘え」として片付けるのではなく、私たちを取り巻く社会そのものの「設計ミス」のシグナルとして捉え直すことを提案します。そして、その設計をどうすれば再編できるのか、具体的なデータも交えながら、皆さんと一緒に考えていきたいと思います。### 第一章|「労働=価値」という虚構の検証私たちはいつの間にか、「働くことが人間の価値を決める」という前提を内面化しています。しかし、この考え方は本当に自明なのでしょうか。いくつかのデータは、この前提が現代において大きな歪みを生んでいる可能性を示唆しています。 **異常に低い仕事への熱意:米ギャラップ社の調査によると、日本の「熱意あふれる社員」の割合はわずか5%。これは調査した139カ国中、最下位レベルです。多くの人が、仕事に対してポジティブな感情を持てずにいる現状が伺えます。* 構造的な高ストレス状態:厚生労働省の調査では、仕事で強いストレスを感じている労働者の割合は、常に半数を超えています。これは個人の精神的な強さの問題ではなく、労働環境そのものに構造的な問題が潜んでいることの現れです。* 先進国で低位の労働生産性:日本の時間当たり労働生産性は、OECD加盟38カ国中30位(2022年)と、長年低い水準にあります。長時間働き、高いストレスを感じているにもかかわらず、それが必ずしも高い成果に結びついていないのです。これらの事実は、「個人の努力が足りない」からではなく、「努力の方向性を規定する社会の設計そのもの」に無理が生じていることを示しているのではないでしょうか。### 第二章|人生を“準備期間”にしてしまうプログラム私たちの多くは、無意識のうちに次のような人生のレールに乗せられています。 **学生時代:より良い大学に入るための「準備」* 大学時代:より良い会社に入るための「準備」* 社会人時代:昇進や老後のための「準備」* 老後:人生の終わりを迎えるための「準備」人生が常に何かの「準備」の連続で、「今、この瞬間を生きる」ことが後回しにされてしまう。この構造を支えているのが、「安定こそが正義」「みんなと同じが安心」といった、思考停止を促す“プログラム”です。このプログラムは、私たちの感性を少しずつ麻痺させ、構造への疑問を抱かせないように作用します。**### 第三章|思考のOSを更新する「言語の再設計」社会のプログラムから抜け出し、自分自身の思考を取り戻す第一歩は、言葉を意識的に変えることです。固定観念を強化する言葉を、私は「毒語」と呼んでいます。この毒語を、本質を捉えた「対抗語彙」に置き換えることで、世界の見え方は大きく変わります。| 毒語(思考停止を招く言葉) | 対抗語彙(本質を捉える言葉) | 置き換えの狙い || :—…
Read More