Search code examples
pythonpathlocalizationinternationalizationlektor

Localized / translated paths in Lektor


The Lektor docs clearly state:

If you have a page that exists in both German and English alternative then they will have the same path.

If you need localized paths, what would be the easiest / best way to get them? Anything better than solving it on the webserver level?


Solution

  • It is possible to overwrite the slug per content file with the _slug field (source).

    Say you have a contact page on an english site with german translation. You would probably have an english contact/contents.lr. Just add the following line to contact/contents+de.lr:

    _slug: kontakt