DS Server

Javascript: Selection.setCulture Method

Method|Introduced in 26.0

Description

Sets the culture as a languagecode2-country / regioncode2 string value.

Syntax

<void> Selection.setCulture(<string> culture, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
culture

The culture as a languagecode2-country / regioncode2 string value.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates Selection.setCulture in a practical document-editing workflow. It sets the culture as a languagecode2-country / regioncode2 string value.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.selection.setCulture(
    "en-US",
    function() {
        console.log("set culture completed.");
    },
    onTxError
);