mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-03-16 22:10:30 +00:00
24 lines
533 B
Python
24 lines
533 B
Python
# coding utf-8
|
|
|
|
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',
|
|
'seo_title',
|
|
'search_description',
|
|
)
|
|
if settings.TRANSLATE_SLUGS:
|
|
fields += (
|
|
'slug',
|
|
'url_path',
|
|
)
|