Skip to content

Conversation

@me-and
Copy link

@me-and me-and commented Feb 26, 2025

Rather than hard-code to use en-US, pick up the language tag from the page or site in the same way as the minima layout.

Rather than hard-code to use en-US, pick up the language tag from the page or site in the same way as the minima layout.
@ashmaroli
Copy link
Member

Hello @me-and, this HTML page is actually the layout for generated redirect pages. Therefore, page.lang will always be undefined or null leading to unnecessary calls to the Liquid filter default. A better solution would be adding this attribute directly to the generated Redirect page via Ruby.

I recommend testing above hypothesis and solution using a sample site and make the necessary changes here.

@me-and
Copy link
Author

me-and commented Feb 26, 2025

I had the impression that one could set page.lang in the same place as page.redirect.to, but I was just trying to get a quick fix when I spotted a redirect I'd created using GitHub Pages unexpectedly giving en-US as the language, so I could well be misunderstanding how these things fit together!

In any case, I'm not sufficiently invested to set up a test environment, so if this isn't a quick and helpful fix and nobody else wants to fix things properly, I'm happy to just drop it.

@ashmaroli
Copy link
Member

Unfortunately yes, you have misunderstood the markup here. The generated redirect page(s) simply render an unstyled Redirecting... which is in en-US locale (or en lang).

So, if we were to interpolate page.lang to be say, fr_CA but still continue rendering Redirecting..., now that would be a bug / incorrect render.

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.

2 participants