SeedLocalizations class
The words the kit says on its own account.
Only text the components produce themselves lives here — a modal's OK, a
tour's Next, the line an empty list shows. Everything an application
writes is the application's to translate, by whatever means it already
uses.
Wiring it up
Register the delegate and the kit follows the app's locale, changing with it at runtime:
MaterialApp(
localizationsDelegates: const [
SeedLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
...
],
supportedLocales: SeedLocalizations.supportedLocales,
)
This is why the kit works with intl, easy_localization, slang and the
rest without depending on any of them: they all end up setting the app's
Locale, and the delegate reads that. Nothing here needs to know which one
is in use.
Without a delegate
Pass one to ConfigProvider instead, which is also how a single subtree is put into another language:
ConfigProvider(locale: SeedLocalizations.ru, child: MyApp())
A widget kit has to draw in any application, so nothing here throws when neither is present: the words fall back to English.
Changing a word, or adding a language
copyWith takes any subset, so a whole language need not be forked to change one word:
ConfigProvider(
locale: SeedLocalizations.en.copyWith(ok: 'Got it'),
child: MyApp(),
)
A new language is one const SeedLocalizations(...), passed the same way.
- Annotations
Constructors
-
SeedLocalizations({String localeName = 'en', String ok = 'OK', String cancel = 'Cancel', String previous = 'Previous', String next = 'Next', String finish = 'Finish', String noData = 'No data', String reset = 'Reset', String close = 'Close', String clear = 'Clear', String add = 'Add', String goToPage = 'Go to', String remove = 'Remove', String retry = 'Try again', String preview = 'Preview', String download = 'Download', String upload = 'Upload', String chooseFile = 'Choose a file', String createOption = 'Create "{text}"', String tabFallback = 'Tab {n}', String backToTop = 'Back to top', String loading = 'Loading', String showMore = 'Show more', String colorHue = 'Hue', String colorAlpha = 'Opacity', String colorSaturation = 'Saturation and brightness', String noColor = 'No colour', String copy = 'Copy', String copied = 'Copied', String search = 'Search', String selectAll = 'Select all items', String sortedAscending = 'sorted ascending', String sortedDescending = 'sorted descending', String notSorted = 'not sorted', String filterColumn = 'Filter', String filtering = 'filtering', String expandRow = 'Expand row', String collapseRow = 'Collapse row', String selectRow = 'Select row', String formRequired = 'This field is required', String formInvalid = 'This value is not valid', String formMismatch = 'The two do not match', String formInvalidEmail = 'Enter a valid email address', String formInvalidUrl = 'Enter a valid web address', String formTooShort = 'At least {n}', String formTooLong = 'At most {n}', String formOptional = '(optional)', String noMoreItems = 'No more items', String perPage = '/ page', String selectTime = 'Select time', String selectDate = 'Select date', String startDate = 'Start date', String endDate = 'End date', String today = 'Today', List<
String> quarters = const ['Q1', 'Q2', 'Q3', 'Q4'], List<String> shortMonths = englishMonths, List<String> shortWeekdays = englishWeekdays, int firstDayOfWeek = DateTime.monday, String now = 'Now', String am = 'AM', String pm = 'PM', String dayUnit = 'd', String hourUnit = 'h', String minuteUnit = 'm', String secondUnit = 's', String digits = latinDigits}) -
Creates a set of words. Anything left out stays English, so a partial
translation is a usable one.
const
Properties
- add → String
-
What a screen reader calls the plus that opens one more of something —
an editable
Tabsbar's new tab. A glyph says nothing out loud.final - am → String
-
The first half of the day, on a 12-hour clock.
final
- backToTop → String
-
What a
BackTopbutton is called out loud: an arrow, and no words.final - cancel → String
-
Dismisses one.
final
- chooseFile → String
-
On an
Uploadbutton with room for a sentence.final - clear → String
-
What a screen reader calls the cross that empties a field — a picker's,
a select's. A glyph says nothing out loud.
final
- close → String
-
What a screen reader calls a close cross — an alert's, a tag's, a
notification's. A glyph says nothing out loud.
final
- collapseRow → String
-
Names the mark that shuts a
Tablerow.final - colorAlpha → String
-
The opacity strip of a
ColorPicker, read out.final - colorHue → String
-
The hue strip of a
ColorPicker, read out.final - colorSaturation → String
-
The square of a
ColorPickerwhere a shade is picked, read out.final - copied → String
-
Said once something has been copied to the clipboard.
final
- copy → String
-
A button that copies something to the clipboard, read out.
final
- createOption → String
-
The option a
Selectoffers for a tag nobody has yet;{text}is what was typed.final - dayUnit → String
-
Short unit letters for a duration, as a Countdown format writes them.
final
- digits → String
-
The ten glyphs for 0 to 9, in order.
final
- download → String
-
What it calls the arrow that saves a file.
final
- endDate → String
-
Placeholder for the trailing half of a date range.
final
- expandRow → String
-
Names the mark that opens a
Tablerow.final - filterColumn → String
-
Names the mark that opens a
Tablecolumn's filters.final - filtering → String
-
Read out for a
Tablefilter mark that is narrowing the table.final - finish → String
-
The last step of a tour, in place of next.
final
- firstDayOfWeek → int
-
Which day a week starts on, as DateTime.monday through
DateTime.sunday.
final
- formInvalid → String
-
Refuses a
Formvalue that does not match the pattern asked of it.final - formInvalidEmail → String
-
Refuses a
Formvalue that is not an email address.final - formInvalidUrl → String
-
Refuses a
Formvalue that is not a web address.final - formMismatch → String
-
What a
FormRule.matchessays when two fields differ.final - formOptional → String
-
Marks a
Formfield that need not be answered, where the form marks those rather than the ones that must be.final - formRequired → String
-
Refuses an empty
Formfield.final - formTooLong → String
-
Refuses a
Formvalue that is longer or larger than asked.{n}is replaced with the number.final - formTooShort → String
-
Refuses a
Formvalue that is shorter or smaller than asked.{n}is replaced with the number.final - goToPage → String
-
Beside a
Pagination's jump field, and what names it out loud.final - hashCode → int
-
The hash code for this object.
no setteroverride
- hourUnit → String
-
Short unit letter for hours. See dayUnit.
final
- loading → String
-
What a
Skeletonis called out loud while it stands in for content.final - localeName → String
-
Which language this is, for identifying it. Not used for matching.
final
- minuteUnit → String
-
Short unit letter for minutes. See dayUnit.
final
- next → String
-
A tour's step forwards.
final
- noColor → String
-
What a
ColorPickerholding no colour is called, and its clear swatch.final - noData → String
-
What an empty list or table says.
final
- noMoreItems → String
-
What a list says once it has been scrolled to its end.
final
- notSorted → String
-
Read out for a
Tableheading whose column could be sorted and is not.final - now → String
-
Jumps a
TimePickerto the current time.final - ok → String
-
Confirms a modal or a popconfirm.
final
- perPage → String
-
Follows a page size in a pagination's size picker:
20 / page.final - pm → String
-
The second half of the day, on a 12-hour clock. See am.
final
- preview → String
-
What it calls the eye that opens a file.
final
- previous → String
-
A tour's step backwards.
final
-
quarters
→ List<
String> -
What each quarter of the year is called.
final
- remove → String
-
What a screen reader calls the cross that takes a file out of an
Upload. A glyph says nothing out loud.final - reset → String
-
Clears a
Tablecolumn's filter menu, next to ok which applies it.final - retry → String
-
What it calls the arrow that sends a failed upload again.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- search → String
-
Placeholder of the field that narrows a
Tablecolumn's filter menu.final - secondUnit → String
-
Short unit letter for seconds. See dayUnit.
final
- selectAll → String
-
Takes every choice in a
Tablecolumn's tree of filters at once.final - selectDate → String
-
Placeholder of an empty
DatePicker.final - selectRow → String
-
Names the box that picks one
Tablerow.final - selectTime → String
-
Placeholder of an empty
TimePicker.final -
shortMonths
→ List<
String> -
The twelve months, shortened, from January.
final
-
shortWeekdays
→ List<
String> -
The seven weekdays, shortened, from Monday — the order
DateTime.weekday counts in.
final
- showMore → String
-
What the
…standing for aBreadcrumb's folded items is called out loud.final - sortedAscending → String
-
Read out for a
Tableheading whose column is sorted up.final - sortedDescending → String
-
Read out for a
Tableheading whose column is sorted down.final - startDate → String
-
Placeholder for the leading half of a date range.
final
- tabFallback → String
-
A
Tabsitem given no label of its own;{n}counts from one.final - today → String
-
Jumps a
DatePickerto the current day.final - upload → String
-
On an
Uploadbutton, compact: what it does.final
Methods
-
copyWith(
{String? localeName, String? ok, String? cancel, String? previous, String? next, String? finish, String? noData, String? reset, String? close, String? clear, String? add, String? goToPage, String? remove, String? retry, String? preview, String? download, String? upload, String? chooseFile, String? createOption, String? tabFallback, String? backToTop, String? loading, String? showMore, String? colorHue, String? colorAlpha, String? colorSaturation, String? noColor, String? copy, String? copied, String? search, String? selectAll, String? sortedAscending, String? sortedDescending, String? notSorted, String? filterColumn, String? filtering, String? expandRow, String? collapseRow, String? selectRow, String? formRequired, String? formInvalid, String? formMismatch, String? formInvalidEmail, String? formInvalidUrl, String? formTooShort, String? formTooLong, String? formOptional, String? noMoreItems, String? perPage, String? selectTime, String? selectDate, String? startDate, String? endDate, String? today, List< String> ? quarters, List<String> ? shortMonths, List<String> ? shortWeekdays, int? firstDayOfWeek, String? now, String? am, String? pm, String? dayUnit, String? hourUnit, String? minuteUnit, String? secondUnit, String? digits}) → SeedLocalizations - A copy with the given words replaced.
-
digit(
int d) → String -
The glyph this language writes
dwith.dmust be 0 to 9. -
figures(
String text) → String -
Rewrites the ASCII figures in
textin this language's own, leaving everything else — separators, a+, a/— as it stands. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
forLocale(
Locale locale) → SeedLocalizations -
The words for
locale, falling back to en. -
of(
BuildContext context) → SeedLocalizations - The words in scope, from the delegate.
Constants
- ar → const SeedLocalizations
- Arabic. Read right to left.
- arabicIndicDigits → const String
-
٠١٢٣٤٥٦٧٨٩, used across much of the Arabic-writing world. -
byLanguage
→ const Map<
String, SeedLocalizations> - Every language the kit ships, by language code.
- de → const SeedLocalizations
- German.
-
delegate
→ const LocalizationsDelegate<
SeedLocalizations> - Follows the app's locale. See the class doc.
- en → const SeedLocalizations
- English. The fallback for anything unmatched.
-
englishMonths
→ const List<
String> - The English month abbreviations, used when a language says nothing.
-
englishWeekdays
→ const List<
String> - The English weekday abbreviations, from Monday.
- es → const SeedLocalizations
- Spanish.
- fr → const SeedLocalizations
- French.
- he → const SeedLocalizations
- Hebrew. Read right to left.
- ja → const SeedLocalizations
- Japanese.
- latinDigits → const String
-
0123456789. What most languages use, and the default. - pt → const SeedLocalizations
- Portuguese.
- ru → const SeedLocalizations
- Russian.
-
supportedLocales
→ const List<
Locale> -
For
MaterialApp.supportedLocales. - tk → const SeedLocalizations
- Turkmen.
- tr → const SeedLocalizations
- Turkish.
- zh → const SeedLocalizations
- Chinese, simplified.