GlobalMaterialLocalizations class Null safety

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:

  • af - Afrikaans
  • am - Amharic
  • ar - Arabic
  • as - Assamese
  • az - Azerbaijani
  • be - Belarusian
  • bg - Bulgarian
  • bn - Bengali Bangla
  • bs - Bosnian
  • ca - Catalan Valencian
  • cs - Czech
  • da - Danish
  • de - German (plus one country variation)
  • el - Modern Greek
  • en - English (plus 8 country variations)
  • es - Spanish Castilian (plus 20 country variations)
  • et - Estonian
  • eu - Basque
  • fa - Persian
  • fi - Finnish
  • fil - Filipino Pilipino
  • fr - French (plus one country variation)
  • gl - Galician
  • gsw - Swiss German Alemannic Alsatian
  • gu - Gujarati
  • he - Hebrew
  • hi - Hindi
  • hr - Croatian
  • hu - Hungarian
  • hy - Armenian
  • id - Indonesian
  • is - Icelandic
  • it - Italian
  • ja - Japanese
  • ka - Georgian
  • kk - Kazakh
  • km - Khmer Central Khmer
  • kn - Kannada
  • ko - Korean
  • ky - Kirghiz Kyrgyz
  • lo - Lao
  • lt - Lithuanian
  • lv - Latvian
  • mk - Macedonian
  • ml - Malayalam
  • mn - Mongolian
  • mr - Marathi
  • ms - Malay
  • my - Burmese
  • nb - Norwegian BokmÃ¥l
  • ne - Nepali
  • nl - Dutch Flemish
  • no - Norwegian
  • or - Oriya
  • pa - Panjabi Punjabi
  • pl - Polish
  • ps - Pushto Pashto
  • pt - Portuguese (plus one country variation)
  • ro - Romanian Moldavian Moldovan
  • ru - Russian
  • si - Sinhala Sinhalese
  • sk - Slovak
  • sl - Slovenian
  • sq - Albanian
  • sr - Serbian (plus 2 scripts)
  • sv - Swedish
  • sw - Swahili
  • ta - Tamil
  • te - Telugu
  • th - Thai
  • tl - Tagalog
  • tr - Turkish
  • uk - Ukrainian
  • ur - Urdu
  • uz - Uzbek
  • vi - Vietnamese
  • zh - Chinese (plus 2 country variations and 2 scripts)
  • zu - Zulu

This list is available programmatically via kMaterialSupportedLanguages.

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:

Implemented types
Implementers

Constructors

GlobalMaterialLocalizations({@required String localeName, @required DateFormat fullYearFormat, @required DateFormat compactDateFormat, @required DateFormat shortDateFormat, @required DateFormat mediumDateFormat, @required DateFormat longDateFormat, @required DateFormat yearMonthFormat, @required DateFormat shortMonthDayFormat, @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
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
calendarModeButtonLabel String?
Tooltip used for the calendar mode button of the date pickers.
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
dateHelpText String?
The help text used on an empty InputDatePickerFormField to indicate to the user the date format being asked for.
read-only, inherited
dateInputLabel String?
The label used to describe the text field used in an InputDatePickerFormField.
read-only, inherited
dateOutOfRangeLabel String?
Error message displayed to the user when they have entered a date that is outside the valid range for the date picker. showDateRangePicker.
read-only, inherited
datePickerHelpText String?
Label used in the header of the date picker dialog created with showDatePicker.
read-only, inherited
dateRangeEndDateSemanticLabelRaw String
The raw version of dateRangeEndDateSemanticLabel, with $fullDate verbatim in the string.
@protected, read-only
dateRangeEndLabel String?
The label used for the ending date input field in the date range picker created with showDateRangePicker.
read-only, inherited
dateRangePickerHelpText String?
Label used in the header of the date range picker dialog created with showDateRangePicker.
read-only, inherited
dateRangeStartDateSemanticLabelRaw String
The raw version of dateRangeStartDateSemanticLabel, with $formattedDate verbatim in the string.
@protected, read-only
dateRangeStartLabel String?
The label used for the starting date input field in the date range picker created with showDateRangePicker.
read-only, inherited
dateSeparator String?
The character string used to separate the parts of a compact date format (i.e. mm/dd/yyyy has a separator of '/').
read-only, inherited
deleteButtonTooltip String?
The tooltip for the delete button on a Chip.
read-only, inherited
dialModeButtonLabel String?
Tooltip used to put the time picker into TimePickerEntryMode.dial.
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
firstDayOfWeekIndex int
Index of the first day of week, where 0 points to Sunday, and 6 points to Saturday. [...]
read-only, override
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
inputDateModeButtonLabel String?
Tooltip used for the text input mode button of the date pickers.
read-only, inherited
inputTimeModeButtonLabel String?
Tooltip used to put the time picker into TimePickerEntryMode.input.
read-only, inherited
invalidDateFormatLabel String?
Error message displayed to the user when they have entered a text string in an InputDatePickerFormField that is not in a valid date format.
read-only, inherited
invalidDateRangeLabel String?
Error message displayed to the user when they have entered an invalid date range in the input mode of the date range picker created with showDateRangePicker.
read-only, inherited
invalidTimeLabel String?
Error message for the time picker dialog created with showTimePicker when in TimePickerEntryMode.input.
read-only, inherited
licensesPackageDetailTextFew String
The "few" form of licensesPackageDetailText. [...]
@protected, read-only
licensesPackageDetailTextMany String
The "many" form of licensesPackageDetailText. [...]
@protected, read-only
licensesPackageDetailTextOne String
The "one" form of licensesPackageDetailText. [...]
@protected, read-only
licensesPackageDetailTextOther String
The "other" form of licensesPackageDetailText. [...]
@protected, read-only
licensesPackageDetailTextTwo String
The "two" form of licensesPackageDetailText. [...]
@protected, read-only
licensesPackageDetailTextZero String
The "zero" form of licensesPackageDetailText. [...]
@protected, read-only
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
moreButtonTooltip String?
The tooltip for the more button on an overflowing text selection menu.
read-only, inherited
narrowWeekdays List<String>
List of week day names in narrow format, usually 1- or 2-letter abbreviations of full names. [...]
read-only, override
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
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
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
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
reorderItemDown String?
The semantics label used for ReorderableListView to reorder an item in the list one space down the list.
read-only, inherited
reorderItemLeft String?
The semantics label used for ReorderableListView to reorder an item in the list one space left in the list.
read-only, inherited
reorderItemRight String?
The semantics label used for ReorderableListView to reorder an item in the list one space right in the list.
read-only, inherited
reorderItemToEnd String?
The semantics label used for ReorderableListView to reorder an item in the list to the end of the list.
read-only, inherited
reorderItemToStart String?
The semantics label used for ReorderableListView to reorder an item in the list to the start of the list.
read-only, inherited
reorderItemUp String?
The semantics label used for ReorderableListView 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
saveButtonLabel String?
Label for a 'SAVE' button. Currently used by the full screen mode of the date range picker.
read-only, inherited
scriptCategory ScriptCategory
Defines the localized TextStyle geometry for ThemeData.textTheme. [...]
read-only, override
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
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
selectYearSemanticsLabel String?
The semantic label used to announce when the user has entered the year selection mode of the CalendarDatePicker which is used in the data picker dialog created with showDatePicker.
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
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
timePickerDialHelpText String?
Label used in the header of the time picker dialog created with showTimePicker when in TimePickerEntryMode.dial.
read-only, inherited
timePickerHourLabel String?
Label used below the hour text field of the time picker dialog created with showTimePicker when in TimePickerEntryMode.input.
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
timePickerInputHelpText String?
Label used in the header of the time picker dialog created with showTimePicker when in TimePickerEntryMode.input.
read-only, inherited
timePickerMinuteLabel String?
Label used below the minute text field of the time picker dialog created with showTimePicker when in TimePickerEntryMode.input.
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
unspecifiedDate String?
The label used to indicate a date that has not been entered or selected yet in the date picker.
read-only, inherited
unspecifiedDateRange String?
The label used to indicate a date range that has not been entered or selected yet in the date range picker.
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
dateRangeEndDateSemanticLabel(String fullDate) String
The semantics label used for the selected end date in the date range picker's day grid.
override
dateRangeStartDateSemanticLabel(String fullDate) String
The semantics label used for the selected start date in the date range picker's day grid.
override
formatCompactDate(DateTime date) String
Formats the date in a compact format. [...]
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
formatShortDate(DateTime date) String
Formats the date using a short-width format. [...]
override
formatShortMonthDay(DateTime date) String
Formats the month and day 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
licensesPackageDetailText(int licenseCount) String
Subtitle for a package in the LicensePage widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
pageRowsInfoTitle(int firstRow, int lastRow, int rowCount, bool rowCountIsApproximate) String
Title for the PaginatedDataTable's row info footer.
override
parseCompactDate(String inputString) DateTime
Converts the given compact date formatted string into a DateTime. [...]
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
toString() String
Returns a string representation of this object.
inherited

Operators

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

Constants

delegate → const LocalizationsDelegate<MaterialLocalizations>
A LocalizationsDelegate for MaterialLocalizations. [...]
_MaterialLocalizationsDelegate()
delegates → const List<LocalizationsDelegate>
A value for MaterialApp.localizationsDelegates that's typically used by internationalized apps. [...]
<LocalizationsDelegate<dynamic>>[GlobalCupertinoLocalizations.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate]