setTranslateStrategy

public final Unit setTranslateStrategy(List<ChannelIdentifier> identifiers, TranslateStrategy strategy, ErrorHandler handler)

Sets the translation strategy for specified channels.

Supports three modes: follow user-level configuration, enable auto-translation, and manual translation.

val identifiers = listOf(
ChannelIdentifier(ChannelType.DIRECT, "userId1"),
ChannelIdentifier(ChannelType.GROUP, "groupId1"),
)
NCEngine.translateModule.setTranslateStrategy(identifiers, TranslateStrategy.AUTO_ON) { error ->
if (error == null) {
// Successfully set
}
}

Parameters

identifiers

List of channel identifiers

strategy

Translation strategy to apply

handler

Operation result callback; error is null on success