Skip to main content

Localization

Notice

This page is archived and might not reflect the latest version of the FlutterFire plugins. You can find the latest information on GitHub:

https://github.com/firebase/flutterfire/blob/master/packages/flutterfire_ui/doc/auth/localization.md

FlutterFire UI for Auth supports localization, so every single text label can be customized.

If your app supports only a single language, and you want to override labels โ€“ you will need to provide a custom class that implements DefaultLocalizations, for example:

import 'package:flutterfire_ui/i10n.dart';
class LabelOverrides extends DefaultLocalizations {
const LabelOverrides();
@override
String get emailInputLabel => 'Enter your email';
@override
String get passwordInputLabel => 'Enter your password';
}

Once created, pass the instance of LabelOverrides to the localizationsDelegates list in your MaterialApp/CupertinoApp:

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
localizationsDelegates: [
// Creates an instance of FirebaseUILocalizationDelegate with overridden labels
FlutterFireUILocalizations.withDefaultOverrides(const LabelOverrides()),
// Delegates below take care of built-in flutter widgets
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
// This delegate is required to provide the labels that are not overridden by LabelOverrides
FlutterFireUILocalizations.delegate,
],
// ...
);
}
}

If you need to support multiple languages โ€“ follow the official flutter localization guide and make sure that your custom delegate extends LocalizationsDelegate<FlutterFireUILocalizations>.

Note: check out API reference to learn what labels are used by specific widgets