Better I18NBetter I18N
Flutter

Getting Started

Native Flutter i18n with the better_i18n Dart SDK — CDN-driven translations with offline support.

Overview

better_i18n is a pure Dart + Flutter SDK that loads translations from the better-i18n CDN at runtime. It uses the same CDN infrastructure as the Expo and iOS SDKs — meaning your translations are managed in one place and delivered to all platforms.

  • CDN-driven — Translations update without app store releases
  • Offline-first — 4-tier fallback: memory → CDN → persistent storage → static data
  • Reactive UIBetterI18nProvider rebuilds widgets automatically on locale change
  • No codegen — No build steps, no generated files, no native modules

BetterI18nProvider handles everything — CDN fetch, caching, locale switching, and loading/error states. Use context.t('key') anywhere in the widget tree.

Features

Offline-First

4-tier fallback chain ensures translations are always available — even without network.

Reactive UI

Locale switches rebuild the widget tree instantly via ChangeNotifier.

Locale Switching

context.setI18nLocale('tr') — pre-loads translations before switching.

Testing Utilities

MemoryStorage and BetterI18nScope make widget testing straightforward.

No Codegen

Pure Dart — no build_runner, no generated files, no native modules required.

Quick Start

pubspec.yaml
dependencies:
  better_i18n: ^0.1.0
lib/main.dart
import 'package:better_i18n/better_i18n.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(
    BetterI18nProvider(
      project: 'your-org/your-project', 
      defaultLocale: 'en',
      child: const MyApp(),
    ),
  );
}
lib/home_screen.dart
import 'package:better_i18n/better_i18n.dart';
import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(context.t('common.welcome')), 
            Text(context.t('common.greeting', args: {'name': 'Osman'})), 
          ],
        ),
      ),
    );
  }
}

Guide

Comparison

FeatureFlutterExpoiOS
LanguageDartTypeScriptSwift
i18n librarybetter_i18ni18nextbetter-i18n-ios
UI frameworkFlutter widgetsReact NativeSwiftUI / UIKit
Offline supportBuilt-inBuilt-inBuilt-in
Reactive rebuildsChangeNotifierReact state@Observable / ObservableObject
Persistent cacheSharedPrefsStorageMMKV / AsyncStorageUserDefaults
No codegenYesYesYes

Choose Flutter for cross-platform mobile apps written in Dart. For React Native / Expo apps, see Expo. For native iOS, see iOS.

On this page