Skip to content
better-i18n.com
En esta página

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

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 Switchingcontext.setI18nLocale('tr') — pre-loads translations before switching.
  • Testing UtilitiesMemoryStorage 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(
      projectId: '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 #

  • Setup — Installation, configuration, and locale switching.
  • Offline & Caching — How the 4-tier fallback chain and persistent storage work.
  • API Reference — Complete API documentation for all exports.

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.

AI Tooling #

Now that you've integrated the SDK, your AI agent can check coverage, translate keys, and publish — all without leaving your editor.

  • MCP Server — Translate keys, check coverage, and publish — all from your editor via Cursor, Claude Code, or Windsurf.
  • Agent Skill — Permanent better-i18n knowledge for your AI agent — SDK patterns, CDN behavior, key conventions. No prompts needed each session.