Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DictionaryBase.Culture Property

Specifies the name of the dictionary’s culture.

Namespace: DevExpress.Blazor.RichEdit.SpellCheck

Assembly: DevExpress.Blazor.RichEdit.v24.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
public string Culture { get; set; }

#Property Value

Type Description
String

The name of the culture in the following format: <languagecode>-<country/regioncode>.

#Remarks

A culture name is a string in the following format:

<languagecode>-<country/regioncode>

  • <languagecode> is a lowercase two-letter code in ISO 639-1 format.

  • <country/regioncode> is a BCP-47 language tag or uppercase two-letter code in ISO 3166 format.

The component uses this string to create a CultureInfo object that stores information about the dictionary’s culture. An empty string or string in another format corresponds to an InvariantCulture. Refer to the following article for a table with the Language tags column that lists available culture names: Microsoft Documentation.

The built-in spell check service checks spelling against all dictionaries when the component’s DocumentCulture property corresponds to an invariant culture. Otherwise, the service uses only the dictionaries whose culture is invariant or matches the document’s culture.

The following code snippet sets an ISpell dictionary‘s culture:

C#
public void ConfigureServices(IServiceCollection services) {
    services.AddDevExpressBlazor().AddSpellCheck(opts => {
        opts.FileProvider = new PhysicalFileProvider(
            Path.Combine(Directory.GetCurrentDirectory(), "Data", "Dictionaries")
        );
        opts.Dictionaries.Add(new ISpellDictionary {
            DictionaryPath = "american.xlg",
            GrammarPath = "english.aff",
            Culture = "en-US"
        });
    });
}

Refer to the following topic for more information: Spell Check.

See Also