---
title: "setLanguages"
slug: "api/basket/operations/setlanguages"
sidebar:
  order: 418
---

<a id="ref-aca48c83f935"></a>
<a id="ref-9bfe6abba5af"></a>
<a id="ref-ea29a75242f5"></a>

## Synopsis

```text
void setLanguages(SessionId sessionId, string[] languages)
throws BasketServiceFault;
```

See also: [SessionId](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [BasketServiceFault](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault#ref-d5adb74faa1b)

This operation sets the language list of the basket service (the product data languages) to the specified, possibly empty list of ISO 639 alpha-2 language codes. It then augments[^1] this list with the language of the current locale to build an effective list of product data languages. The effective list of product data languages is updated after each invocation of the session service’s [`setLocale`](/pCon/configuratorOnline/specs/api/session/operations/setlocale) operation to reflect possible changes to the locale language.

Natural language texts are returned in the first language from the list of effective product data languages supported by the package containing the product database for the article in question. The set of supported languages is defined by the value of the DSR key `languages`. In case the package does not support any of the listed languages then the Online Configurator returns the text in the first supported language.

Instead of a session ID the operation can also be invoked with a session context ID as their first argument (see also §[newSessionContext](/pCon/configuratorOnline/specs/api/session/operations/newsessioncontext#ref-71351064821d)). If so, the session ID stored in the session context will be used as the actual session ID. The languages will be changed for the whole session including all projects loaded in the session.

A [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault) is returned if any of the following conditions occurs:

- The `sessionId` parameter is not a valid string representation of an UUID or does not represent an open session.

- The `languages` parameter contains an invalid language code[^2].

[^1]: The locale language is appended to the list if it is not already part of the list.

[^2]: A language code is accepted as long as it consists of two lower case ASCII letters. It must not necessarily be defined by ISO 639.
