TimetableLocalizationsDelegate class

Provides localized strings for Timetable widgets.

Supported Locale.languageCodes:

  • de – German
  • en – English
  • es – Spanish
  • fr – French
  • hu – Hungarian
  • it – Italian
  • ja – Japanese
  • pt – Portuguese
  • zh_CN – Chinese (Simplified)
  • zh_TW – Chinese (Traditional)

By default, this delegate also configures Intl whenever Flutter's locale changes. This behavior can be disabled via setIntlLocale.

See also:

Supporting a new locale

  1. Copy TimetableLocalizationsEn from below, rename it (using the UpperCamelCase variant of its BCP 47 language tag), and update it to the new locale. The classes should be ordered alphabetically.
  2. Add your class to the _getLocalization method below (again, ordered alphabetically).
  3. List the new locale in the README (alphabetically).
  4. Add the new locale to the list above (alphabetically).
  5. Add the locale to _supportedLocale in example/lib/utils.dart.
  6. Open a pull request and you're done 🎉
Inheritance

Constructors

TimetableLocalizationsDelegate({bool setIntlLocale = true, Locale? fallbackLocale})
const

Properties

fallbackLocale Locale?
When localizations for a requested locale are missing, Timetable will instead use this locale.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setIntlLocale bool
Whether to update Intl.defaultLocale when the app's locale changes.
final
type Type
The type of the object returned by the load method, T by default.
no setterinherited

Methods

isSupported(Locale locale) bool
Whether resources for the given locale can be loaded by this delegate.
override
load(Locale locale) Future<TimetableLocalizations>
Start loading the resources for locale. The returned future completes when the resources have finished loading.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldReload(covariant TimetableLocalizationsDelegate old) bool
Returns true if the resources for this delegate should be loaded again by calling the load method.
override
toString() String
A string representation of this object.
inherited

Operators

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