Globalization in Blazor Application

22 Oct 20251 minute to read

Globalization combines internationalization (i18n)—parsing and formatting dates, times, numbers, and currencies—and localization (l10n)—adding culture-specific customizations and translating UI text.

The Syncfusion® Blazor UI components use American English (en-US) by default. Blazor relies on .NET globalization to parse and format numbers and dates based on the active culture. In Blazor WebAssembly, ensure globalization data is available when using non‑en cultures.

Blazor uses built-in .NET types from the System.Globalization namespace, such as the CultureInfo class and its culture properties.

When working with HTML form fields, browser-native input types affect culture behavior:

  • date
  • number

Blazor relies on the browser’s handling of these input types, which ensures that the user input is parsed and rendered according to their specific culture settings.

Input types are inconsistently supported across browsers and may be less reliable:

  • datetime-local
  • month
  • week

The following example shows how globalization affects rendered values by formatting dates and numbers according to the current culture.

@page "/"
@using System.Globalization

<ul>
    <li><b>CurrentCulture</b>: @CultureInfo.CurrentCulture</li>
    <li><b>CurrentUICulture</b>: @CultureInfo.CurrentUICulture</li>
</ul>

<h2>Rendered values</h2>

<ul>
    <li><b>Date</b>: @dt.ToLongDateString()</li>
    <li><b>Number</b>: @number.ToString("N2")</li>
</ul>

@code {
    private DateTime dt = DateTime.Now;
    private double number = 1999.69;
}
  • To change any specific culture, add the corresponding .resx resource files and configure localization as described in the following article:

Enable localization and add .resx files in the application

See also