---
title: "flutter_auto_localizations"
description: "A Dart CLI tool that automates Flutter localization end to end. It parses ARB files, preserves ICU plural and select structure through machine translation, and generates the delegates and accessors, turning a multi-day chore into a command."
url: "https://dewmina.dev/projects/flutter-auto-localizations"
canonical: "https://dewmina.dev/projects/flutter-auto-localizations"
kind: "OPEN SOURCE"
year: "2024"
status: "Published on pub.dev"
role: "Author and maintainer"
author: "Dewmina Udayashan"
---

# flutter_auto_localizations

A Dart CLI that takes a project from one language to dozens without hand-editing ARB.

A Dart CLI tool that automates Flutter localization end to end. It parses ARB files, preserves ICU plural and select structure through machine translation, and generates the delegates and accessors, turning a multi-day chore into a command.

**My role:** Author and maintainer

**Status:** Published on pub.dev

**Links:** [pub.dev](https://pub.dev/packages/flutter_auto_localizations) · [Source](https://github.com/DewminaUdayashan/flutter_auto_localizations)

**Stack:** Dart, CLI, Google Translate

## The problem

Machine translation and ICU message syntax are natural enemies. A plural or select block is a small program embedded in a string, and a translation API happily returns a fluent sentence with the braces rearranged and the argument names translated, which compiles to nothing or, worse, compiles and renders wrong for exactly one locale. The tool had to translate the prose and leave the program alone.

## The approach

- **Parse, don't regex.** A real ARB parser walks the file and isolates translatable prose from ICU structure and placeholders, so the syntax survives a round trip through a translation API intact.
- **Translate the text, preserve the program.** Google Translate is applied only to the extracted prose segments; braces, argument names, plural categories and select cases are reassembled afterwards.
- **Generate what Flutter expects.** Localization delegates and typed string accessors are emitted in the shape flutter gen-l10n consumers already use, so adopting it changes nothing downstream.

## System architecture

- **ARB parser.** Key extraction with ICU plural and select structure held separately from prose
- **Translation stage.** Prose-only calls to the translation API, with placeholders masked
- **Code generation.** Delegates and typed accessors matching the standard Flutter localization surface

## Engineering decisions

### Machine translation is a first draft, and the tool should say so

The output is for development, review and testing. It unblocks building a multi-locale app before a translator is hired, rather than pretending to replace one. Framing it that way is the difference between a useful tool and a shipped mistranslation.

---

Written by Dewmina Udayashan. Full site: https://dewmina.dev
