UserLocalizations class abstract

Callers can lookup localized strings with an instance of UserLocalizations returned by UserLocalizations.of(context).

Applications need to include UserLocalizations.delegate() in their app's localizationDelegates list, and the locales they support in the app's supportedLocales list. For example:

import 'l10n/localizations.dart';

return MaterialApp(
  localizationsDelegates: UserLocalizations.localizationsDelegates,
  supportedLocales: UserLocalizations.supportedLocales,
  home: MyApplicationHome(),
);

Update pubspec.yaml

Please make sure to update your pubspec.yaml to include the following packages:

dependencies:
  # Internationalization support.
  flutter_localizations:
    sdk: flutter
  intl: any # Use the pinned version from flutter_localizations

  # Rest of dependencies

iOS Applications

iOS applications define key application metadata, including supported locales, in an Info.plist file that is built into the application bundle. To configure the locales supported by your app, you’ll need to edit this file.

First, open your project’s ios/Runner.xcworkspace Xcode workspace file. Then, in the Project Navigator, open the Info.plist file under the Runner project’s Runner folder.

Next, select the Information Property List item, select Add Item from the Editor menu, then select Localizations from the pop-up menu.

Select and expand the newly-created Localizations item then, for each locale your application supports, add a new item and select the locale you wish to add from the pop-up menu in the Value field. This list should be consistent with the languages listed in the UserLocalizations.supportedLocales property.

Implementers

Constructors

UserLocalizations(String locale)

Properties

accountPageTitle → String
No description provided for @accountPageTitle.
no setter
addedToFavoritesConfirmationText → String
No description provided for @addedToFavoritesConfirmationText.
no setter
addedToFavoritesLabel → String
No description provided for @addedToFavoritesLabel.
no setter
cancelSignOutButtonLabel → String
No description provided for @cancelSignOutButtonLabel.
no setter
descriptionSignOutAlertBody → String
No description provided for @descriptionSignOutAlertBody.
no setter
donateButtonLabel → String
No description provided for @donateButtonLabel.
no setter
errorLoadingProfile → String
No description provided for @errorLoadingProfile.
no setter
favoritesPageTitle → String
No description provided for @favoritesPageTitle.
no setter
giveFeedbackButtonLabel → String
No description provided for @giveFeedbackButtonLabel.
no setter
howToSaveEvents → String
No description provided for @howToSaveEvents.
no setter
howToSaveItems → String
No description provided for @howToSaveItems.
no setter
localeName → String
final
myAccountLabel → String
No description provided for @myAccountLabel.
no setter
myEventsPageTitle → String
No description provided for @myEventsPageTitle.
no setter
noFavorites → String
No description provided for @noFavorites.
no setter
noSavedEvents → String
No description provided for @noSavedEvents.
no setter
privacyPolicyButtonLabel → String
No description provided for @privacyPolicyButtonLabel.
no setter
removedToFavoritesConfirmationText → String
No description provided for @removedToFavoritesConfirmationText.
no setter
resetOnboardingButtonLabel → String
No description provided for @resetOnboardingButtonLabel.
no setter
resetOnboardingSnackbarText → String
No description provided for @resetOnboardingSnackbarText.
no setter
signedInAs → String
No description provided for @signedInAs.
no setter
signOutAlertDialogButtonLabel → String
No description provided for @signOutAlertDialogButtonLabel.
no setter
signOutAlertTitle → String
No description provided for @signOutAlertTitle.
no setter
signOutButtonLabel → String
No description provided for @signOutButtonLabel.
no setter
termsAndConditionsLabel → String
No description provided for @termsAndConditionsLabel.
no setter
userPreferencesButtonLabel → String
No description provided for @userPreferencesButtonLabel.
no setter

Static Methods

of(BuildContext context) UserLocalizations

Constants

delegate → const LocalizationsDelegate<UserLocalizations>
localizationsDelegates → const List<LocalizationsDelegate>
A list of this localizations delegate along with the default localizations delegates.
supportedLocales → const List<Locale>
A list of this localizations delegate's supported locales.