Better I18NBetter I18N
iOS (Swift)

Getting Started

Native iOS i18n with the BetterI18n Swift SDK — reactive translations in SwiftUI.

BetterI18n's Swift SDK brings the same translation workflow you know from the JS SDK to native iOS apps. It supports iOS 15+, macOS 12+, and watchOS 8+.

The core primitive is I18nStore — an @ObservableObject that handles fetching, caching, and locale switching reactively. Wrap your root view with I18nProvider and every SwiftUI view in the tree gets access via @EnvironmentObject.

I18nProvider(core: BetterI18n(config: I18nConfig(
    project: "my-org/my-app",
    defaultLocale: "en"
))) {
    ContentView()
}

Features

Offline-first

Two-phase load: cached translations appear instantly, CDN refresh happens in the background.

Reactive

@Published locale, isLoaded, isRefreshing, and error — your UI updates automatically.

Locale switching

setLocale() persists the preference to storage and re-fetches translations for the new locale.

Widget support

AppGroup storage bridges translations to WidgetKit extensions without a network call.


Guides

On this page