Skip to main content
All docs
V24.2

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

TranslateAIToolbarItem.Languages Property

Specifies a list of languages available for translation.

Namespace: DevExpress.AIIntegration.Blazor.HtmlEditor

Assembly: DevExpress.AIIntegration.Blazor.HtmlEditor.v24.2.dll

NuGet Package: DevExpress.AIIntegration.Blazor.HtmlEditor

#Declaration

C#
[Parameter]
public object Languages { get; set; }

#Property Value

Type Description
Object

An object that contains a list of languages.

#Remarks

Use the Languages property to specify a list of languages displayed in the Translate toolbar item.

Razor
@using DevExpress.AIIntegration.Blazor.HtmlEditor
@using DevExpress.Blazor.HtmlEditor

<DxHtmlEditor>
    <AdditionalItems>
        <SummarizeAIToolbarItem />
        <ExpandAIToolbarItem />
        <ProofreadAIToolbarItem/>
        <ExpandAIToolbarItem />
        <ShortenAIToolbarItem />
        <AskAssistantAIToolbarItem />
        <ChangeStyleAIToolbarItem />
        <ChangeToneAIToolbarItem />
        <TranslateAIToolbarItem Languages="@("English, German, French, Chinese")" />
    </AdditionalItems>
</DxHtmlEditor>

AI-powered Extension for HtmlEditor

The Languages property accepts data in the following formats:

String
string languages = "English, German, French, Chinese";
Array of strings
string[] languages = new string[4] { "English", "German", "French", "Chinese" };
Array of anonymous objects
object[] languages = new object[] {
    new { id = "eng", text = "English" },
    new { id = "de", text = "German" },
    new { id = "fr", text = "French" },
    new { id = "zh", text = "Chinese" }
};
Array of objects
public class Language {
    public string Id { get; set; }
    public string Text { get; set; }
    public Language(string id, string text) {
        Id = id;
        Text = text;
    }
}    
Language[] languages = {
    new Language("eng","English"),
    new Language("de", "German"),
    new Language("fr", "French"),
    new Language("zh", "Chinese")
};

If you assign an array of typed or anonymous objects to the Languages property, use ValueFieldName and TextFieldName properties to specify fields that contain language key values and display texts.

razor
<DxHtmlEditor>
    <AdditionalItems>
        ...
        <TranslateAIToolbarItem Languages="@languages" ValueFieldName="id" TextFieldName="text" />
    </AdditionalItems>
</DxHtmlEditor>

@code {
    object[] languages = new object[] {
        new { id = "English", text = "English" },
        new { id = "German", text = "Deutsch" },
        new { id = "Chinese", text = "中國人" },
        new { id = "Greek", text = "Ελληνικά" }
    };
}

HtmlEditor Translate Toolbar Item

See Also