# Add localization to your Flow integration Flow derives the display language from the locale you provide in your `payment-session` request, by default. Alternatively, you can use the `locale` [configuration option](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-on-your-website/get-started-with-flow.md#Configuration_options) to manually set the language in the `CheckoutWebComponent`. For example: ```javascript const checkout = await CheckoutWebComponents({ paymentSession, publicKey, environment: 'sandbox', locale: 'en', }); ``` --- ## Supported languages The following left-to-right (LtR) and right-to-left (RtL) languages are supported: | Language | Code | Language type | | --- | --- | --- | | Arabic | `ar` | RtL | | Bulgarian | `bg` | LtR | | Chinese (China) | `zh` | LtR | | Chinese (Hong Kong) | `zh-hk` | LtR | | Chinese (Taiwan) | `zh-TW` | LtR | | Czech | `cs` | LtR | | Danish | `da-DK` | LtR | | Dutch (Netherlands) | `nl` | LtR | | English (United Kingdom) | `en` | LtR | | Filipino | `fil` | LtR | | Finnish | `fi` | LtR | | French | `fr` | LtR | | German | `de` | LtR | | Greek | `el` | LtR | | Hindi | `hi` | LtR | | Hungarian | `hu` | LtR | | Indonesian | `id` | LtR | | Italian | `it` | LtR | | Japanese | `ja` | LtR | | Korean | `ko-kr` | LtR | | Lithuanian | `lt` | LtR | | Malay | `ms` | LtR | | Norwegian | `no` | LtR | | Norwegian Bokmål | `nb` | LtR | | Polish | `pl` | LtR | | Portuguese | `pt` | LtR | | Romanian | `ro` | LtR | | Russian | `ru` | LtR | | Slovak | `sk` | LtR | | Spanish | `es` | LtR | | Swedish | `sv` | LtR | | Thai | `th` | LtR | | Turkish | `tr` | LtR | | Vietnamese | `vi` | LtR | > **Information** > > Hungarian, Lithuanian, and Romanian are also supported locales for Google Pay. --- ## Add custom translations You can customize the default text translation for a specific language by providing your own strings. 1. Create a `translations` object and specify the `locale` you want to provide custom translations for. In the `locale` object, provide the translation keys you want to customize, along with their values. For example: ```javascript const translations = { en: { 'form.required': 'Please provide this field', 'pay': 'Pay now', 'pay_button.payment_failed': 'Payment failed, please try again', }, }; ``` 2. Pass the `translations` object when you create the instance of `CheckoutWebComponents`. ```javascript const checkout = await CheckoutWebComponents({ paymentSession, publicKey, environment: 'sandbox', locale: 'en', translations, }); ``` You can customize the following default text: | Translation key | Default text | Description | | --- | --- | --- | | `bank_account` | _Bank Account_ | The label for the bank account option. | | `button.cancel` | _Cancel_ | The label for the _Cancel_ button. | | `button.change` | _Change_ | The label for the _Change_ button. | | `button.continue` | _Continue_ | The label for the _Continue_ button. | | `button.loading` | _Loading_ | The message displayed when loading additional information. | | `card` | _Card_ | The label for the card option. | | `card.card_holder_name` | _Cardholder name_ | The label for the cardholder name input. | | `card.card_number` | _Card number_ | The label for the card number input. | | `card.card_number.invalid` | _Your card number is incomplete_ | The error message displayed when the card number is incomplete. | | `card.card_number.not_supported` | _{CARD} not supported_ | The error message displayed when the card number is for an unsupported card scheme. | | `card.card_number.placeholder` | _1234 1234 1234 1234_ | The message describing the format of the card number input. | | `card.expiry_date` | _Expiry date_ | The label for the card expiry date input. | | `card.expiry_date.invalid` | _Your card's expiry date is in the past_ | The error message displayed when the card expiry date is invalid. | | `card.expiry_date.placeholder.month` | _MM_ | The message describing the format of the card expiry month input. | | `card.expiry_date.placeholder.year` | _YY_ | The message describing the format of the card expiry year input. | | `card.preferred_scheme.cta` | _Choose your preferred scheme_ | The label for the preferred scheme selection. | | `card.preferred_scheme.description` | "_Your card offers two schemes, and you can select the one you prefer. Otherwise, the default choice applies._" | The message prompting the customer to select their preferred scheme. | | `card.security_code` | _Security code_ | The label for the card verification value (CVV) input. | | `card.security_code.invalid` | _Your card's security code is incomplete_ | The error message displayed when the CVV is incomplete. | | `card.security_code.placeholder` | _CVV_ | The message describing the format of the CVV input. | | `card.store_for_future_use.collect_consent` | _Save card details for future purchases_ | The label for the option to store card details for future purchases. | | `card.store_for_remember_me.collect_consent` | _Remember this card_ | The call to action (CtA) message to remember card details for future use. | | `customer.phone_number.not_registered` | _Phone number not registered_ | The error message displayed when the phone number is unregistered. | | `form.edit` | _Edit_ | The label for the _Edit_ button. | | `form.email` | _Email address_ | The label for the email input. | | `form.email.invalid` | _Must be a valid email_ | The error message displayed when the customer provides an invalid email. | | `form.email.placeholder` | `jordan.smith@email.com` | The placeholder message displayed in the empty email input field. | | `form.full_name` | _Full name_ | The label for the full name input. | | `form.full_name.placeholder` | _Jordan Smith_ | The placeholder message displayed in the empty full name input field. | | `form.greater_than` | _Must be greater than `{VALUE}` characters_ | The error message displayed when the customer inputs a value shorter than the required length. | | `form.holder_first_name` | _Holder first name_ | The label for the account holder first name input. | | `form.holder_first_name.placeholder` | _Jordan_ | The placeholder message displayed in the empty account holder first name input field. | | `form.holder_last_name` | _Holder last name_ | The label for the account holder last name input. | | `form.holder_last_name.placeholder` | _Smith_ | The placeholder message displayed in the empty account holder last name input field. | | `form.less_than` | _Must be less than `{VALUE}` characters_ | The error message displayed when the customer inputs a value longer than the required length. | | `form.national_id` | _National ID_ | The label for the national ID input. | | `form.national_id.invalid` | _National ID is invalid_ | The error message displayed when the national ID is invalid. | | `form.national_id.placeholder` | _30063412345_ | The placeholder message displayed in the empty national ID input field. | | `form.phone_country_code` | _Country code_ | The label for the phone country code input. | | `form.phone_number` | _Phone number_ | The label for the phone number input. | | `form.phone_number.cta` | _Enter your phone number_ | The label for the phone number entry. | | `form.phone_number.invalid` | _Must be a valid phone number_ | The error message displayed when the phone number is invalid. | | `form.required` | _This field is required_ | The error message displayed when the customer leaves a required field empty. | | `klarna.show_options` | _Show Klarna options_ | The label for the _Display Klarna options_ button. | | `otp.code` | _Enter your verification code_ | The label for the verification code input. | | `otp.code.description` | _Enter the verification code sent to `
{ADDRESS}`_ | The CtA message to capture the verification code sent to the customer’s contact details. | | `otp.code.description.email` | _Enter the verification code sent to your email_ | The CtA message to capture the verification code sent to the customer’s email. | | `otp.code.description.phone` | _Enter the verification code sent via SMS_ | The CtA message to capture the verification code sent to the customer’s phone via SMS. | | `otp.code.description.whatsapp` | _Enter the verification code sent via WhatsApp_ | The CtA message to capture the verification code sent to the customer’s phone via WhatsApp. | | `otp.code.email` | _Send code via email_ | The CtA message to send the verification code via email. | | `otp.code.error` | _Incorrect verification code. Try again._ | The error message displayed when the verification code is invalid. | | `otp.code.expired` | _The code has expired. Request a new one._ | The error message displayed when the verification code expires. | | `otp.code.length` | _Verification code must be `{MIN}`-`{MAX}` digits_ | The error message displayed when the verification code has an invalid number of digits. | | `otp.code.phone` | _Send code via SMS_ | The CtA message to send the verification code via SMS. | | `otp.code.send` | _We'll send a verification code to `