Reputation: 151
So the problem is simple:
Translated home page is not connected to any site. Everything is working kind of properly, I can open translated pages manually like this: /en/...
. But for example there is no LIVE
button on the translated page, to which i'm used to.
This is the main home page, my site defaults to.
And this is translated home page.
Also in the explorer, it shows a warning that this page is not connected to any site, which I think should not be.
Here in the red boxes it was written in what language each page is.
This is not a very big deal, but it's a little bit annoying and I'm planning to release this site in production soon, so editors may not understand which page to edit. How can I fix this? Maybe there is a way to change something in the database, so translated home pages are properly connected to the main home page?
I tried to delete database and remigrate everyting(which by the way gave me this error, I fixed it by adding locale_id=1
to the migration), nothing worked. I think this happened when I changed LANGUAGE_CODE
from en-us
to ru-ru
, I'm not sure, but deleting and remigrating database should have fixed it but it didn't. :(
Somebody with 1500 reputation please create a wagtail-localize
tag xD
Upvotes: 1
Views: 753
Reputation: 1
You need define the abbreviation of language in IETF_language
https://en.wikipedia.org/wiki/IETF_language_tag
For example:
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
('vn', "Tiếng Việt"), #wrong
('vi', "Tiếng Việt Chuẩn"), #right
('en', "English"),
]
Upvotes: 0
Reputation: 151
Of course, posted a question, answer came up... Nevermind, I think many people will find this Q&A useful.
So the problem was in wagtail_localize.locales
app, I changed it to wagtail.locales
and everything is working now, I thought these apps are basically the same thing, but I was wrong.
.url
function on pages was not working too because of this issue. Just replace the app!
Hope this helps! :P
Upvotes: 1