Skip to content
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

[WIP] Fixing #521 default language issue #567

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yuhattor
Copy link
Member

No description provided.

@yuhattor yuhattor linked an issue Jun 19, 2023 that may be closed by this pull request
@yuhattor
Copy link
Member Author

It looks the following issue "Custom 404 per language" is related to this one

@yuhattor
Copy link
Member Author

yuhattor commented Jun 19, 2023

The following pages have been updated.

  • This is due to the fact that hugo currently does not support 404 pages in multiple languages. There is nothing we can do about it.
  • If this is not resolved, the language with the top hit locale ID in descending order will be the default language.
  • To fix this, I made a change to always make English the default 404 page language. Specifically, prevent 404 pages from being created in any language other than English, and add an option to the menu of the resulting page after running hugo
  • This build script is a bit of a hack, but I would like to wait for the implementation on the hugo side, but this should be fine for the time being.
  • Besides that, we changed the language priority. Specifically, they are now in alphabetical order.
# Delete unnecessary files to prevent hugo from creating shared 404.html files for the wrong default language - Temporary fix
find content -name '404.md' -not -path 'content/en/404.md' -exec rm {} +
# Build
hugo --minify
# Append language options to public/404.html - Temporary fix
sed -i 's|<option>English</option>|&<option value="/fr">Français</option><option value="/ja">Japanese</option>|g' public/404.html
Google.Chrome.2023-06-19.22.05.15.Jun.19.2023.1005.PM.mp4

@yuhattor yuhattor marked this pull request as ready for review June 19, 2023 13:06
@yuhattor yuhattor requested a review from a team as a code owner June 19, 2023 13:06
@rrrutledge
Copy link
Contributor

prevent 404 pages from being created in any language other than English

What part of the code changes accomplishes this?

@yuhattor
Copy link
Member Author

will take a look at the issue again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chinese set as language by default
2 participants