File: using-i18n-context.md

package info (click to toggle)
mkdocs-static-i18n 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,412 kB
  • sloc: python: 3,131; xml: 45; makefile: 21; sh: 17
file content (9 lines) | stat: -rw-r--r-- 496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
# Using i18 context variables

The plugin exports some useful i18n variables that you can access through the page context:

- `i18n_config`: the i18n plugin configuration
- `i18n_file_locale`: the locale of the source file used to build the page
- `i18n_page_locale`: the current rendering locale of the page

Those context [variables can be accessed using Jinja2 notation](https://jinja.palletsprojects.com/en/latest/templates/#variables), like `{{ i18n_page_locale }}` in your theme overrides.