-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add multi-language 404 #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi there! 👋 Thank you for your contribution to the FIP Guide! 🚀 Checklist before merging:
|
✅ Deploy Preview for fipguide ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@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.
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). |
There was a problem hiding this 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 :)
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 Some websites have a solution where a message is displayed on the page if the browser language is supported for easy switching.
I'll try another improvement later and will merge it once it's done. |
added multi-language 404 page