I have a problem with my multilingual website to show the correct language on the contact form success page (custom).
My website
- uses a CNAME for a custom domain (upon private request)
- is available in 3 different languages (which are located in directories)
- uses Netlify language redirection (netlify.toml)
- makes use of Netlify forms for the contact form
- makes use of a Netlify function to clean up contact requests after sending
Language redirects:
[[redirects]]
from = "/"
to = "/de-de/"
status = 302
force = true
conditions = {Language = ["de"]}
[[redirects]]
from = "/"
to = "/en-us/"
status = 302
force = true
conditions = {Language = ["en"]}
[[redirects]]
from = "/"
to = "/es-es/"
status = 302
force = true
conditions = {Language = ["es"]}
Forms and behavior
<form action='/en-us/contact/success' ...
:
/en-us/contact/ (form page in English) after sending:
/en-us/contact/sent (thank you page in English)
<form action='/de-de/kontakt/gesendet' ...
:
/de-de/kontakt/ (form page in German) after sending:
/de-de/kontakt/gesendet (thank you page in English)
<form action='/es-es/contacto/enviado' ...
:
/es-es/contacto/ (form page in Spanish) after sending:
/es-es/contacto/enviado (thank you page in English)
Further problem description
- In all cases, the success page URL is correct but the language is always English.
- Only after clicking F5 (refresh) on the success page, the correct language version is displayed.
- The error also occurs in incognito mode/private browsing (different browsers), tested with the 3 different browser languages.
Something is fishy here and whatever is causing the error seems to happen on Netlify’s side.
Can somebody look into this?
Thank you for your help in advance.