wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

Wagtail 2.11 Multi-language support. #199

Open ghost opened 3 years ago

ghost commented 3 years ago

Issue summary

Wagtail 2.11 just released, the main feature being multi-language support I'm wondering if/how this will be integrated into wagtailtrans ? I would like to upgrade to 2.11 to get all the other features that came with the release but I do not want to break my website and loose content

My two main questions are :

Alx101 commented 3 years ago

At least pip-compile won't let you upgrade wagtail to 2.11 if you've got wagtailtrans installed too, so I would guess that there isn't any official support

enginhu commented 3 years ago

wagtail 2.11 has wagtail.locales module which i need to to explicitly set the default language.

kaedroho commented 3 years ago

wagtail 2.11 has wagtail.locales module which i need to to explicitly set the default language.

Languages in Wagtail 2.11 are defined in the LANGUAGE, and the default language is set with the LANGUAGE_CODE setting.

The locales module is used for setting up and managing locale records in the database based on these languages.

enginhu commented 3 years ago

wagtail 2.11 has wagtail.locales module which i need to to explicitly set the default language.

Languages in Wagtail 2.11 are defined in the LANGUAGE, and the default language is set with the LANGUAGE_CODE setting.

The locales module is used for setting up and managing locale records in the database based on these languages.

I've got 2 languages in webpage. Turkish and English, turkish is default language but when i try to open the wep page it show english. i want to set the language turkish. whoever visits the site will see the turkish page first. Is there a way to do this?

kaedroho commented 3 years ago

Setting the LANGUAGE_CODE to 'tr' should do that

enginhu commented 3 years ago

I already did that. I should have doing something wrong but i don't know what. Can it be because of the of order of middlewares?

LANGUAGE_CODE = 'tr'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True
MIDDLEWARE = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    'wagtailtrans.middleware.TranslationMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',

    'wagtail.contrib.redirects.middleware.RedirectMiddleware',
]
jkevingutierrez commented 3 years ago

Are there any plans to support Wagtail 2.11? I know that Wagtail 2.11 has now wagtail-localize But it would be great if Wagtailtrans would add support for Wagtail 2.11 (that could be the ultimate version supported), especially having in mind that 2.11 is an LTS release and it is the first version that introduced wagtail-trans