GlobalMaterialLocalizations class
Implementation of localized strings for the material widgets using the
intl
package for date and time formatting.
Supported languages
This class supports locales with the following Locale.languageCodes:
ar
- Arabicbg
- Bulgarianbs
- Bosnianca
- Catalan Valenciancs
- Czechda
- Danishde
- German (plus one country variation)el
- Modern Greeken
- English (plus 7 country variations)es
- Spanish Castilian (plus 20 country variations)et
- Estonianfa
- Persianfi
- Finnishfil
- Filipino Pilipinofr
- French (plus one country variation)gsw
- Swiss German Alemannic Alsatianhe
- Hebrewhi
- Hindihr
- Croatianhu
- Hungarianid
- Indonesianit
- Italianja
- Japanesekm
- Khmer Central Khmerko
- Koreanlt
- Lithuanianlv
- Latvianmn
- Mongolianmr
- Marathims
- Malaynb
- Norwegian Bokmålnl
- Dutch Flemishpl
- Polishps
- Pushto Pashtopt
- Portuguese (plus one country variation)ro
- Romanian Moldavian Moldovanru
- Russiansk
- Slovaksl
- Sloveniansr
- Serbian (plus 2 scripts)sv
- Swedishta
- Tamilth
- Thaitl
- Tagalogtr
- Turkishuk
- Ukrainianur
- Urduvi
- Vietnamesezh
- Chinese (plus 2 country variations and 2 scripts)
This list is available programatically via kSupportedLanguages.
Sample code
To include the localizations provided by this class in a MaterialApp, add GlobalMaterialLocalizations.delegates to MaterialApp.localizationsDelegates, and specify the locales your app supports with MaterialApp.supportedLocales:
new MaterialApp(
localizationsDelegates: GlobalMaterialLocalizations.delegates,
supportedLocales: [
const Locale('en', 'US'), // American English
const Locale('he', 'IL'), // Israeli Hebrew
// ...
],
// ...
)
Overriding translations
To create a translation that's similar to an existing language's translation but has slightly different strings, subclass the relevant translation directly and then create a LocalizationsDelegate<MaterialLocalizations> subclass to define how to load it.
Avoid subclassing an unrelated language (for example, subclassing
MaterialLocalizationEn and then passing a non-English localeName
to the
constructor). Doing so will cause confusion for locale-specific behaviors;
in particular, translations that use the localeName
for determining how to
pluralize will end up doing invalid things. Subclassing an existing
language's translations is only suitable for making small changes to the
existing strings. For providing a new language entirely, implement
MaterialLocalizations directly.
See also:
- The Flutter Internationalization Tutorial, flutter.io/tutorials/internationalization/.
- DefaultMaterialLocalizations, which only provides US English translations.
- Implemented types
- Implementers
- MaterialLocalizationAr
- MaterialLocalizationBg
- MaterialLocalizationBs
- MaterialLocalizationCa
- MaterialLocalizationCs
- MaterialLocalizationDa
- MaterialLocalizationDe
- MaterialLocalizationEl
- MaterialLocalizationEn
- MaterialLocalizationEs
- MaterialLocalizationEt
- MaterialLocalizationFa
- MaterialLocalizationFi
- MaterialLocalizationFil
- MaterialLocalizationFr
- MaterialLocalizationGsw
- MaterialLocalizationHe
- MaterialLocalizationHi
- MaterialLocalizationHr
- MaterialLocalizationHu
- MaterialLocalizationId
- MaterialLocalizationIt
- MaterialLocalizationJa
- MaterialLocalizationKm
- MaterialLocalizationKo
- MaterialLocalizationLt
- MaterialLocalizationLv
- MaterialLocalizationMn
- MaterialLocalizationMr
- MaterialLocalizationMs
- MaterialLocalizationNb
- MaterialLocalizationNl
- MaterialLocalizationPl
- MaterialLocalizationPs
- MaterialLocalizationPt
- MaterialLocalizationRo
- MaterialLocalizationRu
- MaterialLocalizationSk
- MaterialLocalizationSl
- MaterialLocalizationSr
- MaterialLocalizationSv
- MaterialLocalizationTa
- MaterialLocalizationTh
- MaterialLocalizationTl
- MaterialLocalizationTr
- MaterialLocalizationUk
- MaterialLocalizationUr
- MaterialLocalizationVi
- MaterialLocalizationZh
Constructors
- GlobalMaterialLocalizations({@required String localeName, @required DateFormat fullYearFormat, @required DateFormat mediumDateFormat, @required DateFormat longDateFormat, @required DateFormat yearMonthFormat, @required NumberFormat decimalFormat, @required NumberFormat twoDigitZeroPaddedFormat })
-
Initializes an object that defines the material widgets' localized strings
for the given
locale
. [...]const
Properties
- aboutListTileTitleRaw → String
-
The raw version of aboutListTileTitle, with
$applicationName
verbatim in the string.@protected, read-only - firstDayOfWeekIndex → int
-
Index of the first day of week, where 0 points to Sunday, and 6 points to
Saturday. [...]
read-only, override
-
narrowWeekdays
→ List<
String> -
List of week day names in narrow format, usually 1- or 2-letter
abbreviations of full names. [...]
read-only, override
- pageRowsInfoTitleApproximateRaw → String
-
The raw version of pageRowsInfoTitle, with
$firstRow
,$lastRow
' and$rowCount
verbatim in the string, for the case where the value is approximate.@protected, read-only - pageRowsInfoTitleRaw → String
-
The raw version of pageRowsInfoTitle, with
$firstRow
,$lastRow
' and$rowCount
verbatim in the string, for the case where the value is precise.@protected, read-only - remainingTextFieldCharacterCountFew → String
-
The "few" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- remainingTextFieldCharacterCountMany → String
-
The "many" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- remainingTextFieldCharacterCountOne → String
-
The "one" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- remainingTextFieldCharacterCountOther → String
-
The "other" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- remainingTextFieldCharacterCountTwo → String
-
The "two" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- remainingTextFieldCharacterCountZero → String
-
The "zero" form of remainingTextFieldCharacterCount. [...]
@protected, read-only
- scriptCategory → ScriptCategory
-
Defines the localized TextStyle geometry for ThemeData.textTheme. [...]
read-only, override
- selectedRowCountTitleFew → String
-
The "few" form of selectedRowCountTitle. [...]
@protected, read-only
- selectedRowCountTitleMany → String
-
The "many" form of selectedRowCountTitle. [...]
@protected, read-only
- selectedRowCountTitleOne → String
-
The "one" form of selectedRowCountTitle. [...]
@protected, read-only
- selectedRowCountTitleOther → String
-
The "other" form of selectedRowCountTitle. [...]
@protected, read-only
- selectedRowCountTitleTwo → String
-
The "two" form of selectedRowCountTitle. [...]
@protected, read-only
- selectedRowCountTitleZero → String
-
The "zero" form of selectedRowCountTitle. [...]
@protected, read-only
- tabLabelRaw → String
-
The raw version of tabLabel, with
$tabIndex
and$tabCount
verbatim in the string.@protected, read-only - timeOfDayFormatRaw → TimeOfDayFormat
-
The format to use for timeOfDayFormat.
@protected, read-only
- alertDialogLabel → String
-
Label read out by accessibility tools (TalkBack or VoiceOver) when an
alert dialog widget is opened.
read-only, inherited
- anteMeridiemAbbreviation → String
-
The abbreviation for ante meridiem (before noon) shown in the time picker.
read-only, inherited
- backButtonTooltip → String
-
The BackButton's tooltip.
read-only, inherited
- cancelButtonLabel → String
-
Label for "cancel" buttons and menu items.
read-only, inherited
- closeButtonLabel → String
-
Label for "close" buttons and menu items.
read-only, inherited
- closeButtonTooltip → String
-
The CloseButton's tooltip.
read-only, inherited
- collapsedIconTapHint → String
-
The semantics hint to describe the tap action on a collapsed ExpandIcon.
read-only, inherited
- continueButtonLabel → String
-
Label for "continue" buttons and menu items.
read-only, inherited
- copyButtonLabel → String
-
Label for "copy" edit buttons and menu items.
read-only, inherited
- cutButtonLabel → String
-
Label for "cut" edit buttons and menu items.
read-only, inherited
- deleteButtonTooltip → String
-
The tooltip for the delete button on a Chip.
read-only, inherited
- dialogLabel → String
-
Label read out by accessibility tools (TalkBack or VoiceOver) when a
dialog widget is opened.
read-only, inherited
- drawerLabel → String
-
Label read out by accessibility tools (TalkBack or VoiceOver) when a
drawer widget is opened.
read-only, inherited
- expandedIconTapHint → String
-
The semantics hint to describe the tap action on an expanded ExpandIcon.
read-only, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- hideAccountsLabel → String
-
The semantics label used for the button on UserAccountsDrawerHeader that
hides the list of accounts.
read-only, inherited
- licensesPageTitle → String
-
Title for the LicensePage widget.
read-only, inherited
- modalBarrierDismissLabel → String
-
Label read out by accessibility tools (TalkBack or VoiceOver) for a modal
barrier to indicate that a tap dismisses the barrier. [...]
read-only, inherited
- nextMonthTooltip → String
-
The tooltip for the MonthPicker's "next month" button.
read-only, inherited
- nextPageTooltip → String
-
The tooltip for the PaginatedDataTable's "next page" button.
read-only, inherited
- okButtonLabel → String
-
Label for OK buttons and menu items.
read-only, inherited
- openAppDrawerTooltip → String
-
The tooltip for the leading AppBar menu (a.k.a. 'hamburger') button.
read-only, inherited
- pasteButtonLabel → String
-
Label for "paste" edit buttons and menu items.
read-only, inherited
- popupMenuLabel → String
-
Label read out by accessibility tools (TalkBack or VoiceOver) when a
popup menu widget is opened.
read-only, inherited
- postMeridiemAbbreviation → String
-
The abbreviation for post meridiem (after noon) shown in the time picker.
read-only, inherited
- previousMonthTooltip → String
-
The tooltip for the MonthPicker's "previous month" button.
read-only, inherited
- previousPageTooltip → String
-
The tooltip for the PaginatedDataTable's "previous page" button.
read-only, inherited
- refreshIndicatorSemanticLabel → String
-
The default semantics label for a RefreshIndicator.
read-only, inherited
- reorderItemDown → String
-
The semantics label used for
ReorderableList
to reorder an item in the list one space down the list.read-only, inherited - reorderItemLeft → String
-
The semantics label used for
ReorderableList
to reorder an item in the list one space left in the list.read-only, inherited - reorderItemRight → String
-
The semantics label used for
ReorderableList
to reorder an item in the list one space right in the list.read-only, inherited - reorderItemToEnd → String
-
The semantics label used for
ReorderableList
to reorder an item in the list to the end of the list.read-only, inherited - reorderItemToStart → String
-
The semantics label used for
ReorderableList
to reorder an item in the list to the start of the list.read-only, inherited - reorderItemUp → String
-
The semantics label used for
ReorderableList
to reorder an item in the list one space up the list.read-only, inherited - rowsPerPageTitle → String
-
Title for the PaginatedDataTable's "rows per page" footer.
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- searchFieldLabel → String
-
Label indicating that a text field is a search field. This will be used
as a hint text in the text field.
read-only, inherited
- selectAllButtonLabel → String
-
Label for "select all" edit buttons and menu items.
read-only, inherited
- showAccountsLabel → String
-
The semantics label used for the button on UserAccountsDrawerHeader that
shows the list of accounts.
read-only, inherited
- showMenuTooltip → String
-
The default PopupMenuButton tooltip.
read-only, inherited
- signedInLabel → String
-
The semantics label used to indicate which account is signed in in the
UserAccountsDrawerHeader widget.
read-only, inherited
- timePickerHourModeAnnouncement → String
-
The text-to-speech announcement made when a time picker invoked using
showTimePicker is set to the hour picker mode.
read-only, inherited
- timePickerMinuteModeAnnouncement → String
-
The text-to-speech announcement made when a time picker invoked using
showTimePicker is set to the minute picker mode.
read-only, inherited
- viewLicensesButtonLabel → String
-
Label for the AboutDialog button that shows the LicensePage.
read-only, inherited
Methods
-
aboutListTileTitle(
String applicationName) → String -
The default title for AboutListTile.
override
-
formatDecimal(
int number) → String -
Formats
number
as a decimal, inserting locale-appropriate thousands separators as necessary.override -
formatFullDate(
DateTime date) → String -
Formats day of week, month, day of month and year in a long-width format. [...]
override
-
formatHour(
TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) → String -
Formats TimeOfDay.hour in the given time of day according to the value
of timeOfDayFormat. [...]
override
-
formatMediumDate(
DateTime date) → String -
Formats the date using a medium-width format. [...]
override
-
formatMinute(
TimeOfDay timeOfDay) → String -
Formats TimeOfDay.minute in the given time of day according to the value
of timeOfDayFormat.
override
-
formatMonthYear(
DateTime date) → String -
Formats the month and the year of the given
date
. [...]override -
formatTimeOfDay(
TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) → String -
Formats
timeOfDay
according to the value of timeOfDayFormat. [...]override -
formatYear(
DateTime date) → String -
Full unabbreviated year format, e.g. 2017 rather than 17.
override
-
pageRowsInfoTitle(
int firstRow, int lastRow, int rowCount, bool rowCountIsApproximate) → String -
Title for the PaginatedDataTable's row info footer.
override
-
remainingTextFieldCharacterCount(
int remainingCount) → String -
The label for the TextField's character counter.
override
-
selectedRowCountTitle(
int selectedRowCount) → String -
Title for the PaginatedDataTable's selected row count header.
override
-
tabLabel(
{int tabIndex, int tabCount }) → String -
The accessibility label used on a tab in a TabBar. [...]
override
-
timeOfDayFormat(
{bool alwaysUse24HourFormat: false }) → TimeOfDayFormat -
The TimeOfDayFormat corresponding to one of the following supported
patterns: [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Constants
-
delegate
→ const LocalizationsDelegate<
MaterialLocalizations> -
A LocalizationsDelegate that uses
GlobalMaterialLocalizations.load
to create an instance of this class. [...]const _MaterialLocalizationsDelegate()
-
delegates
→ const List<
LocalizationsDelegate> -
A value for MaterialApp.localizationsDelegates that's typically used by
internationalized apps. [...]
const <LocalizationsDelegate<dynamic>> [GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate]