> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/shopping-carts/inline/use-cases/set-the-cart-language-for-inline-cart.md).

# Set the cart language for InLine Cart

## Overview

Use the **Cart object** to set the language of the InLine checkout by calling `TwoCoInlineCart.cart.setLanguage(language-code)`.

## Use case

1. Add an HTML link or button in your page like the one below.
2. Create a JavaScript click handler to execute the Inline Client desired methods.
3. Use the `TwoCoInlineCart.products.add({code, quantity, options})` method to prepare your catalog product.
4. In order to set the language use the `TwoCoInlineCart.cart.setLanguage('es')` method.
5. Use the `TwoCoInlineCart.cart.checkout()` method to show the cart on your page.

## Sample request

### HTML

```html
<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
```

### JavaScript

```javascript
window.document.getElementById('buy-button').addEventListener('click', function() {
  TwoCoInlineCart.products.add({
    code: "74B8E17CC0"
  });
  TwoCoInlineCart.cart.setLanguage('es');
  TwoCoInlineCart.cart.checkout();
});
```

## Demo

After setting the cart language using the above method, your cart should look like this:

{% embed url="<https://codepen.io/2checkout-documentation/pen/zVGONz>" %}

## InLine Checkout languages

<table data-header-hidden="false" data-header-sticky><thead><tr><th>English</th><th>Native</th><th>2Checkout language codes</th></tr></thead><tbody><tr><td>Arabic</td><td>العربية</td><td>ar</td></tr><tr><td>Brazilian Portuguese</td><td>Português do Brasil</td><td>pt-br</td></tr><tr><td>Bulgarian</td><td>български език</td><td>bg</td></tr><tr><td>Chinese Mandarin Traditional</td><td>繁体中文</td><td>zy</td></tr><tr><td>Chinese Simplified(Cantonese)</td><td>中文</td><td>zh</td></tr><tr><td>Croatian</td><td>Hrvatski jezik</td><td>hr</td></tr><tr><td>Czech</td><td>Česky</td><td>cs</td></tr><tr><td>Danish</td><td>Dansk</td><td>da</td></tr><tr><td>Dutch</td><td>Dutch</td><td>nl</td></tr><tr><td>English</td><td>English</td><td>en</td></tr><tr><td>Finnish</td><td>Suomi</td><td>fi</td></tr><tr><td>French</td><td>Français</td><td>fr</td></tr><tr><td>German</td><td>Deutsch</td><td>de</td></tr><tr><td>Greek</td><td>Ελληνικά</td><td>el</td></tr><tr><td>Hebrew</td><td>עִבְרִית</td><td>he</td></tr><tr><td>Hindi</td><td>हिन्दी</td><td>hi</td></tr><tr><td>Hungarian</td><td>Magyar</td><td>hu</td></tr><tr><td>Italian</td><td>Italiano</td><td>it</td></tr><tr><td>Japanese</td><td>日本語</td><td>ja</td></tr><tr><td>Korean</td><td>한국어</td><td>ko</td></tr><tr><td>Norwegian</td><td>Norsk</td><td>no</td></tr><tr><td>Persian</td><td>فارسی</td><td>fa</td></tr><tr><td>Polish</td><td>Polski</td><td>pl</td></tr><tr><td>Portuguese</td><td>Português</td><td>pt</td></tr><tr><td>Romanian</td><td>Română</td><td>ro</td></tr><tr><td>Russian</td><td>Русский</td><td>ru</td></tr><tr><td>Serbian</td><td>Србија</td><td>sr</td></tr><tr><td>Slovak</td><td>Slovenčina</td><td>sk</td></tr><tr><td>Slovenian</td><td>Slovène</td><td>sl</td></tr><tr><td>Spanish</td><td>Español</td><td>es</td></tr><tr><td>Swedish</td><td>Svenska</td><td>sv</td></tr><tr><td>Thai</td><td>ไทย</td><td>th</td></tr><tr><td>Turkish</td><td>Türkçe</td><td>tr</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/shopping-carts/inline/use-cases/set-the-cart-language-for-inline-cart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
