pub trait Localizations {
Show 33 methods
// Provided methods
fn back_button_label(&self) -> &str { ... }
fn close_button_label(&self) -> &str { ... }
fn open_drawer_label(&self) -> &str { ... }
fn tab_label(&self, index: usize, count: usize) -> String { ... }
fn signed_in_label(&self) -> &str { ... }
fn show_accounts_label(&self) -> &str { ... }
fn hide_accounts_label(&self) -> &str { ... }
fn clear_button_label(&self) -> &str { ... }
fn ok_button_label(&self) -> &str { ... }
fn cancel_button_label(&self) -> &str { ... }
fn search_field_label(&self) -> &str { ... }
fn no_results_label(&self) -> &str { ... }
fn decrease_label(&self) -> &str { ... }
fn increase_label(&self) -> &str { ... }
fn row_selected_label(&self) -> &str { ... }
fn row_deselected_label(&self) -> &str { ... }
fn all_rows_selected_label(&self) -> &str { ... }
fn all_rows_deselected_label(&self) -> &str { ... }
fn hour_label(&self) -> &str { ... }
fn minute_label(&self) -> &str { ... }
fn ante_meridiem_label(&self) -> &str { ... }
fn post_meridiem_label(&self) -> &str { ... }
fn start_label(&self) -> &str { ... }
fn end_label(&self) -> &str { ... }
fn page_range_label(&self, start: usize, end: usize, total: usize) -> String { ... }
fn rows_per_page_label(&self) -> &str { ... }
fn selected_row_count_label(&self, count: usize) -> String { ... }
fn group_digits(&self, number: usize) -> String { ... }
fn previous_month_label(&self) -> &str { ... }
fn next_month_label(&self) -> &str { ... }
fn narrow_weekdays(&self) -> [&str; 7] { ... }
fn first_day_of_week_index(&self) -> usize { ... }
fn months(&self) -> [&str; 12] { ... }
}Expand description
What the framework says, for one language.
Every method has an English body, so implementing this means writing down only what differs. The reference’s table has around a hundred entries; this has the ones the framework actually says today, and grows as it says more.
A default is not agreement. An entry left unanswered is an English string in a
French interface, and it compiles. So a table shipped here writes out every entry, even
the ones whose right answer in that language is the English one — “OK” is “OK” in a
good many languages — with the reason beside it; French does, and a test reads this
file to check that it still does.
Provided Methods§
What a reader hears on a back arrow (backButtonTooltip).
And on the cross that dismisses something (closeButtonTooltip).
Sourcefn open_drawer_label(&self) -> &str
fn open_drawer_label(&self) -> &str
What a reader hears on the control that opens a side panel
(openAppDrawerTooltip).
One word for both edges. The reference says the same thing for a leading
panel and a trailing one (action_buttons.dart:331 against :362): a reader told
which edge a panel comes in from is being told about the layout rather than about
the action.
Sourcefn tab_label(&self, index: usize, count: usize) -> String
fn tab_label(&self, index: usize, count: usize) -> String
Where one destination sits among the rest (tabLabel), for a reader who is
hearing them one at a time and cannot see how many there are.
index counts from one, as it reads: “Tab 1 of 3”. It is the one entry here that
takes arguments and so returns an owned string rather than a borrowed one — the
numbers are the caller’s, and a table cannot have written the sentence in advance.
Sourcefn signed_in_label(&self) -> &str
fn signed_in_label(&self) -> &str
What a reader hears on an account header (signedInLabel): the name, the
address and the control for switching arrive as one thing with one name, rather
than as three unrelated nodes at the top of a panel.
Sourcefn show_accounts_label(&self) -> &str
fn show_accounts_label(&self) -> &str
And on the control that reveals the other accounts (showAccountsLabel).
Sourcefn hide_accounts_label(&self) -> &str
fn hide_accounts_label(&self) -> &str
And on the same control once they are showing (hideAccountsLabel).
Two entries rather than one that flips, as the reference has it: a control named for what it will do is the only kind a reader can act on, and the two sentences are not each other’s negation in every language.
What a reader hears on the cross that empties a field (clearButtonTooltip).
Not close_button_label: the same glyph means two
different things depending on what it sits in, and Close on a control that empties
a search box would send a reader looking for the thing it closed.
The word on a confirming button (okButtonLabel).
And on the one that backs out (cancelButtonLabel).
Sourcefn search_field_label(&self) -> &str
fn search_field_label(&self) -> &str
The placeholder in a table’s search field (searchFieldLabel).
Sourcefn no_results_label(&self) -> &str
fn no_results_label(&self) -> &str
What a table says when it has nothing to show. A caller may say its own; this is what one that says nothing gets, and it used to be a constant.
Sourcefn decrease_label(&self) -> &str
fn decrease_label(&self) -> &str
What a reader hears on the control that steps a number down, and on the one that steps it up.
The glyphs are a minus and a plus, which say nothing out loud.
Sourcefn increase_label(&self) -> &str
fn increase_label(&self) -> &str
See decrease_label.
Sourcefn row_selected_label(&self) -> &str
fn row_selected_label(&self) -> &str
What a table announces when a row is ticked, and the three sentences beside it
(selectedRowCountTitle).
Four whole sentences rather than one built from parts, for the reason
hide_accounts_label is its own entry: a language
that agrees its participle with the thing selected cannot be served by a formula
that glues row to selected.
Sourcefn row_deselected_label(&self) -> &str
fn row_deselected_label(&self) -> &str
See row_selected_label.
Sourcefn all_rows_selected_label(&self) -> &str
fn all_rows_selected_label(&self) -> &str
See row_selected_label.
Sourcefn all_rows_deselected_label(&self) -> &str
fn all_rows_deselected_label(&self) -> &str
See row_selected_label.
Sourcefn hour_label(&self) -> &str
fn hour_label(&self) -> &str
The heading over a time picker’s hours, and the one over its minutes
(timePickerHourLabel, timePickerMinuteLabel).
Sourcefn minute_label(&self) -> &str
fn minute_label(&self) -> &str
See hour_label.
Sourcefn ante_meridiem_label(&self) -> &str
fn ante_meridiem_label(&self) -> &str
The two halves of a twelve-hour clock (anteMeridiemAbbreviation,
postMeridiemAbbreviation).
Left as the Latin abbreviations in a good many languages that never use a twelve-hour clock at all — which is not an oversight in a table that says so, and is why a test forbidding a French entry from matching the English one has to have exceptions.
Sourcefn post_meridiem_label(&self) -> &str
fn post_meridiem_label(&self) -> &str
See ante_meridiem_label.
Sourcefn start_label(&self) -> &str
fn start_label(&self) -> &str
The two ends of a range: the heading over the first picker of a pair, and over the second.
Sourcefn end_label(&self) -> &str
fn end_label(&self) -> &str
See start_label.
Sourcefn page_range_label(&self, start: usize, end: usize, total: usize) -> String
fn page_range_label(&self, start: usize, end: usize, total: usize) -> String
The line under a paginated table: which rows are showing, out of how many.
start and end count from one and are inclusive, as the sentence reads. An empty
table says so rather than saying “1–0 of 0”.
A whole sentence rather than a separator and a word, because the pieces do not go in
the same order in every language, and because the numbers in it want grouping —
which is group_digits, and is not the same character
everywhere.
Sourcefn rows_per_page_label(&self) -> &str
fn rows_per_page_label(&self) -> &str
The label beside a table’s page-size chooser.
Sourcefn selected_row_count_label(&self, count: usize) -> String
fn selected_row_count_label(&self, count: usize) -> String
What a table’s bulk-action bar says about how much is selected.
Takes the count because languages disagree about what a count does to the words after it: English says “1 selected” and “3 selected”, and French has to agree the participle with the number.
Sourcefn group_digits(&self, number: usize) -> String
fn group_digits(&self, number: usize) -> String
A number with its thousands grouped, as the reader’s language groups them: a comma in English, a space in French, and a stop in a good many other places.
Four thousand rows written 4000 is a number a reader has to count the digits of.
Sourcefn previous_month_label(&self) -> &str
fn previous_month_label(&self) -> &str
What a reader hears on the arrows either side of a calendar’s month.
Sourcefn next_month_label(&self) -> &str
fn next_month_label(&self) -> &str
See previous_month_label.
Sourcefn narrow_weekdays(&self) -> [&str; 7]
fn narrow_weekdays(&self) -> [&str; 7]
The single letters over a calendar’s columns (narrowWeekdays).
Always Sunday first, whatever day the week starts on where the reader is —
the reference is explicit about this (date.dart:353), and it is what lets
first_day_of_week_index be an index into this
list rather than a second thing to keep in step with it.
Sourcefn first_day_of_week_index(&self) -> usize
fn first_day_of_week_index(&self) -> usize
Which day a week starts on, as an index into
narrow_weekdays — so 0 is Sunday and 1 is Monday
(material_localizations.dart).
Sunday in the United States, Monday across most of Europe, Saturday in much of the Middle East. A calendar that always started on Sunday was not merely untranslated: it put the days in the wrong columns.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".