setLocale

abstract fun setLocale(locale: Locale, structuredSearchCallback: StructuredSearchCallback): Cancellable

Perform an asynchronous action to set locale for the search session. The locale is used to find the best representation of strings in StructuredSearchCandidate. If the locale is empty, e.g. Locale.ROOT, the session locale remains the same.

Return

The Cancellable operation.

Parameters

locale

The preferred Locale, e.g. Locale.ENGLISH or Locale.JAPANESE.

structuredSearchCallback

The StructuredSearchCallback invoked when changing locale has been finished either successfully or with an error.


Perform a synchronous action to set locale for the search session. The locale is used to find the best representation of strings in StructuredSearchCandidate. If the locale is empty, e.g. Locale.ROOT, the session locale remains the same.

Return

The Result contains a StructuredSearchResponse if the call succeeds, or a StructuredSearchFailure if it fails.

Parameters

locale

The preferred Locale, e.g. Locale.ENGLISH or Locale.JAPANESE.