ContentLocalizations class abstract

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

Applications need to include ContentLocalizations.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: ContentLocalizations.localizationsDelegates,
  supportedLocales: ContentLocalizations.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 ContentLocalizations.supportedLocales property.

Implementers

Constructors

ContentLocalizations(String locale)

Properties

appTitle → String
No description provided for @appTitle.
no setter
callButtonLabel → String
No description provided for @callButtonLabel.
no setter
directionsButtonLabel → String
No description provided for @directionsButtonLabel.
no setter
errorLoadingDataLabel → String
No description provided for @errorLoadingDataLabel.
no setter
eventScreenTitle → String
No description provided for @eventScreenTitle.
no setter
explorerScreenTitle → String
No description provided for @explorerScreenTitle.
no setter
localeName → String
final
milesAwayPickupLocationLabel → String
No description provided for @milesAwayPickupLocationLabel.
no setter
noQuoteOfTheDayMessage → String
No description provided for @noQuoteOfTheDayMessage.
no setter
refreshTimelineLabel → String
No description provided for @refreshTimelineLabel.
no setter
relatedContentHeader → String
No description provided for @relatedContentHeader.
no setter
searchEverywhere → String
No description provided for @searchEverywhere.
no setter
searchThisArea → String
No description provided for @searchThisArea.
no setter
selectRegionScreenTitle → String
No description provided for @selectRegionScreenTitle.
no setter
signInRequiredToProceedLabel → String
No description provided for @signInRequiredToProceedLabel.
no setter
wisdomCardTitle → String
No description provided for @wisdomCardTitle.
no setter

Static Methods

of(BuildContext context) ContentLocalizations

Constants

delegate → const LocalizationsDelegate<ContentLocalizations>
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.