next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

Preview for translated nodes does not work

Open Kerchik opened this issue 3 years ago • 3 comments

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'.

Kerchik avatar Aug 25 '22 08:08 Kerchik

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:

  1. URL
  2. Selected Language
  3. UserInterface

devtim123 avatar Aug 25 '22 08:08 devtim123

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":

  1. URL
  2. Selected language
  3. Interface
  4. User

But still return 404 . Maybe I made mistake somewhere or chose wrong order ?

Kerchik avatar Aug 25 '22 09:08 Kerchik

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?

devtim123 avatar Aug 25 '22 14:08 devtim123