Skip to main content

DictionaryBase.Culture Property

Specifies the name of the dictionary’s culture.

Namespace: DevExpress.Blazor.RichEdit.SpellCheck

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

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:

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