DEV Community

Keira Henry
Keira Henry

Posted on

Beyond Translation: A Developer's Guide to App Localization (i18n & l10n)

As developers, we spend countless hours optimizing our code, refining UI/UX, and ensuring our apps run flawlessly. But what happens when your app needs to scale globally?

Many developers mistake localization (l10n) for simple translation. They think wrapping strings in a t() function and dumping them into a JSON file is enough. In reality, proper application localization is a deeply technical challenge that involves architecture, formatting, and cultural adaptation.

Let’s dive into what it actually takes to localise an application properly and how you can prepare your codebase for global success.

1. Internationalization (i18n) vs. Localization (l10n)

Before writing any code, it’s crucial to understand the distinction:

  • Internationalization (i18n): This is the engineering phase. It’s how you design and build your application so that it can be adapted to various languages and regions without engineering changes.
  • Localization (l10n): This is the implementation phase. It’s the actual process of adapting the internationalized app for a specific region by translating text, changing date formats, adapting currencies, and adjusting layouts.

2. The Technical Hurdles of Localization

A. Dynamic UI and Right-to-Left (RTL) Layouts

If you are localizing languages like Arabic or Hebrew, you can't just flip the text alignment. The entire layout needs to be mirrored.

Modern CSS makes this much easier with CSS Logical Properties. Instead of using margin-left or padding-right, you should start using:

/* Old way */

.card {

  margin-left: 20px;

  text-align: left;

}

/* Modern, Localization-friendly way */

.card {

  margin-inline-start: 20px;

  text-align: start;

}

Using start and end instead of left and right ensures your layout adapts automatically when the HTML dir="rtl" attribute changes.

B. Pluralization and Gender Rules

Pluralization is a nightmare if hardcoded. While English only has two plural forms (one / other), languages like Arabic have six different grammatical numbers (zero, one, two, few, many, other).

Never do this:

// ❌ BAD PRACTICE

const message = `${count} ${count === 1 ? 'item' : 'items'} found`;

Instead, utilize native browser APIs like Intl.PluralRules or robust frameworks (like i18next or FormatJS) that handle complex pluralization schemas natively.

C. Date, Time, and Number Formatting

Different countries format numbers and dates uniquely. Hardcoding these formats will break the user experience.

// ✅ GOOD PRACTICE using native Intl API

const number = 123456.789;

console.log(new Intl.NumberFormat('de-DE').format(number)); // "123.456,789"

console.log(new Intl.NumberFormat('ar-EG').format(number)); // "١٢٣٤٥٦٫٧٨٩"

3. Integrating Localization into Your CI/CD Pipeline

For production-grade applications, managing raw translation files (.json, .po, .yaml) manually within Git is inefficient and prone to syntax errors.

The ideal workflow involves:

  1. Extraction: Automating the extraction of keys from your source code.
  2. Synchronization: Syncing these keys with a Translation Management System (TMS) via API or CLI.
  3. Professional Translation: Letting professional localization engineers handle the linguistic and cultural nuances.

When it comes to complex mobile and web ecosystems, partnering with established experts can save weeks of development time. Utilizing dedicated app localization services ensures that your technical infrastructure perfectly aligns with native linguistic accuracy, preventing UI breakage and broken workflows before your app hits the App Store or Google Play.

Summary Checklist for Developers

  • Use CSS Logical Properties (margin-inline-start, etc.) to support RTL effortlessly.
  • Avoid string concatenation; use placeholders for variables.
  • Never hardcode date, time, or currency formats—rely on the Intl API or robust libraries.
  • Establish a seamless pipeline to update locale assets without redeploying the core app.

Localizing an app is a true test of clean code architecture. By implementing these practices early on, you ensure your codebase remains maintainable, scalable, and ready for a global audience.

How do you handle localization in your current stack? Do you prefer native APIs or external frameworks? Let’s discuss in the comments below!

Top comments (0)