AppLocalizations class abstract

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

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

import 'l10n/app_localizations.dart';

return MaterialApp(
  localizationsDelegates: AppLocalizations.localizationsDelegates,
  supportedLocales: AppLocalizations.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 AppLocalizations.supportedLocales property.

Implementers

Constructors

AppLocalizations(String locale)

Properties

addAccount String
Button text to add a new account
no setter
browserExtension String
Label for browser extension login section
no setter
bunker String
Label for bunker login section
no setter
bunkerAuthentication String
Title for bunker authentication toast
no setter
connect String
Button text to connect with browser extension
no setter
copy String
Button text to copy to clipboard
no setter
createAccount String
Button text for creating a new account
no setter
getStarted String
Button text to get started with Nostr
no setter
hashCode int
The hash code for this object.
no setterinherited
install String
Button text to install browser extension
no setter
invalidAddress String
Error message for invalid nostr address
no setter
localeName String
final
loginWithAmber String
Button text to login with Amber
no setter
logout String
Button text to logout from the application
no setter
newHere String
Question asking if the user is new to the platform
no setter
newToNostr String
Question asking if the user is new to Nostr
no setter
nostrAddress String
Label for nostr address input field
no setter
nostrAddressHint String
Placeholder text for nostr address input field
no setter
nostrConnectUrl String
Title for nostr connect URL dialog
no setter
privateKey String
Label for private key input field
no setter
privateKeyHint String
Placeholder text for private key input field
no setter
publicKey String
Label for public key input field
no setter
publicKeyHint String
Placeholder text for public key input field
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showNostrConnectQrcode String
Button text to show nostr connect QR code
no setter
unableToConnect String
Error message when unable to connect to nostr address
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tapToOpen(String url) String
Description for bunker authentication toast
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) AppLocalizations?

Constants

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