next-drupal
next-drupal copied to clipboard
Preview for translated nodes does not work
Preview works fine for nodes, that were created in the DeafultLocale, but when I try to Preview nodes in other languages, it returns me 404. Iframe src loooks like this: http://site.local/api/preview?secret=key&slug=/en/jaunumi/eng&locale=en&defaultLocale=lv&resourceVersion=rel%3Alatest-version
Also i found out, that for some reason in [...slug] file context.locale is equal to 'LV', and not to 'EN'. But when I try to open page with URL http://site.local/en/jaunumi/eng everything works as expected, and context.locale is equal to 'EN'.
For me i was also wondering if language was working fine. after reconfigure the language selection in backend of drupal, it was important to set the right order of detection because otherwise subrequests answers in wrong language. for me this order for content translation works fine now:
- URL
- Selected Language
- UserInterface
3. UserInterface
Did I understand you correctly, that I need to change configs in /admin/config/regional/language/detection page? I tries to change order of "Content language detection":
- URL
- Selected language
- Interface
- User
But still return 404 . Maybe I made mistake somewhere or chose wrong order ?
yes you understood me correctly. for me that helped. but getting a 404 seems like an other issue i guess. did you set i18n config in next.config correctly?
did you check ticket https://github.com/chapter-three/next-drupal/issues/147 already?