# controller\_language\_set

Source: https://zotonic.com/docs/1884/controller_language_set

URI: https://zotonic.com/id/1884

Language: en



Controller which sets the language as given in the `code` argument, and redirects the user back to the page given in the `p` argument.

Arguments:

- `code` is the requested enabled language code and is normally supplied by the `language_select` dispatch path.
- `p` is the optional return URL and defaults to `/`.

Only same-site return URLs are accepted. The controller removes any existing language prefix, adds the newly selected language, and responds with a permanent redirect. The response is not cached or indexed.

```django
<a href="{% url language_select code="nl" p=q.p %}">Nederlands</a>
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1884?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1884?language=en>)
