Translate 404 contents based on the locale used in global areas

On a multilingual website we’ve setup a 404 page. I see that when this page is displayed the global areas show the language that was previously opened, which is perfectly fine. But how do I translate the content, the message people read?

I tried some different ways and thought a Stack would be helpful because they can be localized.

For example:

  1. Go to Solutions d'extraction de poussière | Formula Air (now you are on French language)
  2. Go to https://www.formula-air.com/fr/non-existing-page

The 404-page will show with navigation in French, but content in English. I did see similar topics, but didn’t find an answer for me there, for example “Multi Language - 404 Page not using default language”

To clarify; I’m concerned with the content of the 404 page. It shows the correct navigation, but the content on the page appears not to be translatable.

How can I translate my 404 page?

Hi @RuudZuiderlicht,

So you are placing a stack on that section of the page and making it multilingual?

A couple things you might try:

1.) Making a global area on your 404 page template in your theme - that might behave better in a multilingual context?

2.) You might be able to t() string some content and hardcode your message in there.