# set\_url\_language

Source: https://zotonic.com/docs/2373/set_url_language

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

Language: en



Change the language of an URL to another language. Useful to generate alternative URLs for a page.

Example, provide an URL to the German version of the current page:

```django
{{ m.req.raw_path|set_url_language:'de' }}
```

The URL is sanitized before the language is added. The returned URL is always an absolute URL with the correct hostname, port and protocol.

Note that it is possible to get an alternative language version of a resource’s page by providing a `z_language` argument:

```django
{{ id.page_url_abs with z_language = 'de' }}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2373?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/2373?language=en>)
