development-plugin-for-avalonia

Globalization, Localization, BiDi, and Inclusive Design in Avalonia

Table of Contents

  1. Scope and Primary APIs
  2. Localization-Safe Design Rules
  3. BiDi and FlowDirection Patterns
  4. Inclusive Design Rules
  5. AOT and Runtime Notes
  6. Do and Don’t Guidance
  7. Troubleshooting
  8. Official Resources

Scope and Primary APIs

Use this reference to keep a polished design system usable across languages, cultures, and reading directions.

Primary APIs:

This file covers:

Localization-Safe Design Rules

Localization-safe UI starts with content and layout discipline:

<Grid xmlns="https://github.com/avaloniaui"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      ColumnDefinitions="*,Auto"
      ColumnSpacing="12">
  <TextBlock TextWrapping="Wrap"
             Text="Review the deployment summary and confirm the next action." />
  <Button Grid.Column="1"
          MinWidth="140"
          Content="Deploy now" />
</Grid>

Guidance:

BiDi and FlowDirection Patterns

Avalonia exposes inherited FlowDirection on Visual, which makes RTL support a layout concern rather than an afterthought.

<StackPanel xmlns="https://github.com/avaloniaui"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            FlowDirection="RightToLeft"
            Spacing="8">
  <TextBlock Classes="title" Text="مركز الإصدارات" />
  <TextBlock Classes="body"
             TextWrapping="Wrap"
             Text="راجع الإعدادات ثم اختر الإجراء التالي." />
</StackPanel>

For custom text or drawing paths, pass the intended flow direction explicitly when text layout is built in code.

using Avalonia.Media;

var text = new FormattedText(
    "Release summary",
    CultureInfo.CurrentCulture,
    FlowDirection.LeftToRight,
    new Typeface("Inter"),
    14,
    Brushes.White);

Rules:

Inclusive Design Rules

Inclusive design means the UI works for broader abilities, contexts, and experience levels.

Rules:

Inclusive polish overlaps with accessibility, but the design review should also ask:

AOT and Runtime Notes

Do and Don’t Guidance

Do:

Do not:

Troubleshooting

  1. A localized page feels cramped.
    • Fixed widths and over-compressed action bars are usually the cause.
  2. RTL works technically but feels awkward.
    • Revisit shell assumptions, icon direction, and local navigation placement.
  3. Inclusive review still finds confusing workflows.
    • The issue is likely language and hierarchy, not only accessibility metadata.

Official Resources