DEV Community

Cover image for Switch the App Language
YeLinAung for dust

Posted on Originally published at dust-codegen.pages.dev

Switch the App Language

Dust i18n code snapshot showing a language button and Flutter locale wiring

Switch the app language without restarting the page.

The shopping example reads the current locale from I18nScope.

The button picks en or my, then calls setLocale.

Widgets under the scope rebuild with the new locale.

MaterialApp uses the generated locale, supported locales, and delegates.

The same controller drives Dust text and Flutter's built-in localized widgets.

Docs used: switching locales and the shopping app language button.

Dust #I18n #Flutter #Dart

Top comments (0)