# with\_msgctxt

Source: https://zotonic.com/docs/3129/with_msgctxt

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

Language: en



Override gettext message context for a lexical scope:

```django
{% with_msgctxt "order: sorting" %}
    {_ Order _}
    {{ _"Position" }}
{% endwith_msgctxt %}
```

The context must be a literal string. Scopes may nest; closing a scope restores the previous context. This applies to translated literals, short translation tags, and `trans` tags. An explicit `msgctxt` argument on a `trans` tag takes precedence.

Included templates use their own contexts. See <a href="/id/doc_template_tag_tag_msgctxt" class="doc-reference doc-reference-tag"><code>tag#msgctxt</code></a> for template defaults and the contextual/contextless fallback rules.

License: 

Attribution: 

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