> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/users/module-1/localization.md).

# Localization

Language utilities exposed to the storefront

## Switch active language

> Wraps Django’s \`set\_language\` helper to change the active UI language.\
> \
> \*\*Behaviour\*\*\
> \- Persists the selected language in session\
> \- Redirects to \`next\` parameter (defaults to homepage)\
> \- Supports AJAX clients (returns 200 without redirect when applicable)

```json
{"openapi":"3.1.0","info":{"title":"Users API - Public Endpoints","version":"1.0.0"},"tags":[{"name":"Localization","description":"Language utilities exposed to the storefront"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/i18n/setlang/":{"post":{"tags":["Localization"],"operationId":"postSetLanguage","summary":"Switch active language","description":"Wraps Django’s `set_language` helper to change the active UI language.\n\n**Behaviour**\n- Persists the selected language in session\n- Redirects to `next` parameter (defaults to homepage)\n- Supports AJAX clients (returns 200 without redirect when applicable)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLanguageRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SetLanguageRequest"}}}},"responses":{"200":{"description":"Language changed (AJAX fallback)"},"302":{"description":"Language changed, redirect issued","headers":{"Location":{"schema":{"type":"string"},"description":"Redirect destination"}}}}}}},"components":{"schemas":{"SetLanguageRequest":{"type":"object","description":"Form payload used by `set_language`","required":["language"],"properties":{"language":{"type":"string","description":"Language code defined in Django `LANGUAGES`"},"next":{"anyOf":[{"type":"string"}],"description":"Optional redirect path after switching language"}}}}}}
```

## List active and available languages

> Returns the active language, default language, and available language map\
> sourced from Django settings.

```json
{"openapi":"3.1.0","info":{"title":"Users API - Public Endpoints","version":"1.0.0"},"tags":[{"name":"Localization","description":"Language utilities exposed to the storefront"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/languages/":{"get":{"tags":["Localization"],"operationId":"getLanguages","summary":"List active and available languages","description":"Returns the active language, default language, and available language map\nsourced from Django settings.","responses":{"200":{"description":"Languages listed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguageListResponse"}}}}}}}},"components":{"schemas":{"LanguageListResponse":{"type":"object","description":"Available language information","required":["active_language","default_language","available_languages"],"properties":{"active_language":{"type":"string","description":"Language currently active in session"},"default_language":{"type":"string","description":"Project default language"},"available_languages":{"type":"object","description":"Mapping of language code to human-readable name","additionalProperties":{"type":"string"}}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/users/module-1/localization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
