Instance.setDefaultLocale
Set the default language for all the implemented payment methods using this method of the Revolut Checkout Instance.
How to use
To set the default locale you can use the RC.setDefaultLocale() method as follows:
type Instance = {
payWithPopup: InstancePayWithPopup;
createCardField: InstanceCreateCardField;
revolutPay: InstanceRevolutPay;
destroy: () => void;
};
RevolutCheckout("<token>").then(function (instance) {
instance.setDefaultLocale('es')
instance.payWithPopup({
onSuccess() {
window.alert("Gracias!");
},
onError(message) {
window.alert("Oh no :(");
}
});
});
Supported languages
| Code | Language |
|---|---|
auto | Detect using browser locale |
en | English |
en-US | English (United States) |
es | Spanish |
de | German |
fr | French |
it | Italian |
nl | Dutch |
pl | Polish |
pt | Portuguese |
cs | Czech |
hu | Hungarian |
sk | Slovak |
ja | Japanese |
sv | Swedish |
bg | Bulgarian |
el | Greek |
ro | Romanian |
ru | Russian |
lt | Lithuanian |
hr | Croatian |