setLocale()
The setLocale() method is used to set and get the preferred language for the Payment Element or Vaulting Element UI.
Method signature
Java
public void setLocale(Locale locale)Kotlin
fun setLocale(locale: Locale)Parameters
Parameter | Data type | Required | Description |
locale | String | No | Preferred language. Composed of a language code (ISO-639) and country code (ISO-3166) connected by an underscore, for example, Valid values are:
Note:Â If no value is passed or the language value passed is not within the above range, the system will default to using English. |
Return value
Returns the currently configured language.