Localisation
Menus, dialogs, placeholders, validation messages and screen-reader sentences are properties you can replace. Cultures for formatting and for sorting are settings of their own. Both can differ from grid to grid in one window.
The default is English
The built-in texts ship in English, and that does not depend on the machine's culture: an announcement or a menu must not change with the computer it happens to run on. A German application switches once, at start-up:
// Once, at start-up, before the first grid is created:
ArionUiText.UseGerman(); // every catalogue: the engine's, the screen-reader sentences, the Pro modules'UseGerman() switches every text catalogue of the context: the engine's — menus, dialogs, validation messages, screen-reader sentences — and those of the Pro modules (GroupingUiText, PivotUiText, ChartUiText, FormattingUiText, Scene3DUiText), the ones already created and the ones created later. UseEnglish() switches back. Narrower switches exist too:
ArionUiText.UseGermanAccessibility(); // only the spoken sentences
GroupingUiText.UseGerman(); // only one Pro module's textsReplacing single strings
ArionUiText is a static facade with one property per text; texts that contain numbers or names are delegates. A third language means setting the members by hand.
ArionUiText.NoResults = "Nothing found";
ArionUiText.SortAscending = "Sort A to Z";
ArionUiText.SearchCounter = (current, total) => $"{current} / {total}";Two labels follow the language without being set: the grand total of a pivot (ArionUiText.GrandTotal, unless the spec is built with a label of its own) and the title of the drawn empty state (while a grid's EmptyStateTitle is the standard value, it shows the context's text).
PivotSpec spec = fields.BuildSpec(grandTotalLabel: "All regions"); // default: ArionUiText.GrandTotal, which follows the languagePer grid: GridContext
Texts, icons and both cultures belong to a grid, not to the process. ArionUiText reads and writes GridContext.Default, which every grid without a context of its own uses. Give a grid its own context and it speaks its own language:
var german = new GridContext
{
Culture = CultureInfo.GetCultureInfo("de-AT"), // numbers and dates: display, editing, filters
SortCulture = CultureInfo.GetCultureInfo("de-AT"), // text order: sorting, grouping, value lists
};
german.UseGerman(); // every catalogue of this context, Pro modules included
germanGrid.Context = german; // the other grids keep GridContext.DefaultCulture formats and parses numbers and dates — cell text, editors, filters, the calendar, chart axes; null means the culture of the grid around it (a tile on a board formats as its board does), outside every grid the thread's current culture. Culture can change while the grid shows; its texts are then resolved anew and laid out again. SortCulture orders text when sorting, grouping and listing filter values; null means SortFilterSource.SortCulture. It is fixed when the context is created. Context is a bindable property on the controls and is also Api.State.Context.
Columns with a culture of their own
The typed factories take a format and an optional culture. A column with its own culture keeps it whatever the grid's culture is — useful for a currency column in a foreign-currency report.
TypedColumn.Number<Order>("Amount", o => (double)o.Amount, format: "N2",
culture: CultureInfo.GetCultureInfo("de-CH"));
TypedColumn.Date<Order>("Booked", o => o.Booked, format: "yyyy-MM-dd");Without a format, TypedColumn.Date shows the short date of the column's culture, resolved when it is used, so it follows the grid's culture; an explicit format wins. Date fields that type through a mask widen the pattern to two digits per part (DatePatterns.NumericShortDate: dd.MM.yyyy in German, MM/dd/yyyy in US English); time rulers and axis bands use the compact patterns of DatePatterns.
Right-to-left
Bidirectional text inside a cell is laid out correctly — Arabic and Hebrew runs, mixed with Latin, with the caret where the glyphs are. The grid's own layout is always left to right: columns, scroll bars and chrome are not mirrored. That is listed on What it does not do yet.