Skip to content

Conversation

@therobrob
Copy link
Member

@therobrob therobrob commented Dec 19, 2025

added multi-language 404 page

@github-actions
Copy link

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@therobrob therobrob linked an issue Dec 19, 2025 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit a6edabd
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/694fac7ebd2b710008118663
😎 Deploy Preview https://deploy-preview-514--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@therobrob
Copy link
Member Author

@MoritzWeber0 i’ve tried this one, but in local development and netlify preview i couldn’t check, if it works. Could you check it? :)

@therobrob therobrob added content Improvements or additions to the content (countries, news, operators, general content) technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. labels Dec 19, 2025
@MoritzWeber0
Copy link
Member

MoritzWeber0 commented Dec 23, 2025

@MoritzWeber0 i’ve tried this one, but in local development and netlify preview i couldn’t check, if it works. Could you check it? :)

The multi-language 404 page does work locally, but it will always open the English version of the page when deployed via GitHub. The reason is this line in the workflow that we have to update: https://github.com/fipguide/fipguide.github.io/blob/main/.github/workflows/deploy.yaml#L71.

There has to be a small 404 wrapper that redirects to the correct language. But it's already better than before, so I'd be fine with merging already.

MoritzWeber0
MoritzWeber0 previously approved these changes Dec 23, 2025
@therobrob
Copy link
Member Author

@MoritzWeber0 i’ve tried this one, but in local development and netlify preview i couldn’t check, if it works. Could you check it? :)

The multi-language 404 page does work locally, but it will always open the English version of the page when deployed via GitHub. The reason is this line in the workflow that we have to update: https://github.com/fipguide/fipguide.github.io/blob/main/.github/workflows/deploy.yaml#L71.

There has to be a small 404 wrapper that redirects to the correct language. But it's already better than before, so I'd be fine with merging already.

I’m not exactly sure what needs to be done, so it would be great if you could take care of it.

And dynamically create the languages, before fr was missing.
@MoritzWeber0
Copy link
Member

I’m not exactly sure what needs to be done, so it would be great if you could take care of it.

I implemented it, feel free to have a look around. I make use of the aliasing feature that we also use for the language detection on the home page, but rewrote it using modern methods (navigator.languages is commonly available in modern browsers).

@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review December 25, 2025 22:35
Copy link
Member Author

@therobrob therobrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks :)
One case doesn’t work, but i think it is unnessasary to fix:
if i’m typing the english 404-page-URL and open the page, there is no redirect to my preferred language.

P. S.: i cannot approve the PR because it’s mine. So if you think it’s fine, you can merge :)

@MoritzWeber0
Copy link
Member

MoritzWeber0 commented Dec 26, 2025

One case doesn’t work, but i think it is unnessasary to fix:
if i’m typing the english 404-page-URL and open the page, there is no redirect to my preferred language.

That's the desired behaviour. The user asks for a specific language page via the URL, so we deliver the requested language. It's the same behaviour on all other pages, for example /en/operator/eurostar delivers the English page, even if the browser language is set to German. Otherwise, this could lead to annoying behaviour when sharing links to pages.

Some websites have a solution where a message is displayed on the page if the browser language is supported for easy switching.

P. S.: i cannot approve the PR because it’s mine. So if you think it’s fine, you can merge :)

I'll try another improvement later and will merge it once it's done.

@MoritzWeber0 MoritzWeber0 merged commit ed187d2 into main Dec 27, 2025
7 checks passed
@MoritzWeber0 MoritzWeber0 deleted the feat/multi-language-404 branch December 27, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Improvements or additions to the content (countries, news, operators, general content) technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add multi-language 404 page

3 participants