mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-28 10:34:53 +00:00
Tweaks to multilingual tutorial
This commit is contained in:
parent
a4c847c35d
commit
f8a24ae255
1 changed files with 2 additions and 1 deletions
|
|
@ -70,10 +70,11 @@ Heres an example of how this could be implemented (with English as the main lang
|
|||
"""
|
||||
This returns the language code for this page.
|
||||
"""
|
||||
# Look through ancestors of this pages for its language homepage
|
||||
# Look through ancestors of this page for its language homepage
|
||||
# The language homepage is located at depth 3
|
||||
language_homepage = self.get_ancestors(inclusive=True).get(depth=3)
|
||||
|
||||
# The slug of language homepages should always be set to the language code
|
||||
return language_homepage.slug
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue