Skip to main content

2 posts tagged with "i18n"

View All Tags

Handling Affiliate Cookies and Internationalized Routing in Next.js Middleware

· 3 min read
samundrak
JavaScript Dev

When building complex Next.js applications, middleware becomes an essential place to handle cross-cutting concerns such as authentication, localization, and tracking. One common challenge is setting cookies conditionally while ensuring that the middleware returns the correct routing response—especially when dealing with internationalized routing (i18n).

In this article, I’ll walk you through a practical example where we:

  • Set an affiliate tracking cookie based on the request referer
  • Use next-i18n-router middleware to route users based on locale
  • Avoid common pitfalls that cause 404s or missing cookies

Building a Fully Multilingual Platform (English + Nepali)

· 3 min read
JavaScript Dev

Overview

Supporting multiple languages isn’t just about translating strings—it’s about designing your entire platform to speak more than one language from day one. For a civic-tech system targeting Nepali audiences as well as English-speaking researchers and diaspora users, bilingual support was non-negotiable.

In this article, I’ll explain how I implemented multilingual support across:

  • Database models and schema
  • API structure
  • React frontend rendering
  • SEO and routing strategy
  • Dynamic content like polls, charts, and tooltips

The Challenge: Making Multilingual the Default