mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-03-16 22:10:30 +00:00
Update translation.py
This commit is contained in:
parent
11cbedfe13
commit
dcf2651ee7
1 changed files with 8 additions and 2 deletions
|
|
@ -2,17 +2,23 @@
|
|||
|
||||
from modeltranslation.decorators import register
|
||||
from modeltranslation.translator import TranslationOptions
|
||||
from wagtail_modeltranslation import settings
|
||||
try:
|
||||
from wagtail.core.models import Page
|
||||
except ImportError:
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
||||
|
||||
|
||||
@register(Page)
|
||||
class PageTR(TranslationOptions):
|
||||
fields = (
|
||||
'title',
|
||||
'slug',
|
||||
'seo_title',
|
||||
'search_description',
|
||||
'url_path',
|
||||
)
|
||||
if settings.TRANSLATE_SLUGS:
|
||||
fields += (
|
||||
'slug',
|
||||
'url_path',
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue