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

Update Theme Template to Properly Indicate Current Language #648

Open
mulder999 opened this issue Jul 15, 2023 · 0 comments
Open

Update Theme Template to Properly Indicate Current Language #648

mulder999 opened this issue Jul 15, 2023 · 0 comments

Comments

@mulder999
Copy link

I would like to suggest an update to the current theme template in order to correctly indicate the current language using the .Lang variable instead of the static values .site.LanguageCode and site.Language.Lang.

Currently, the template uses the following code:

<html lang="{{ site.LanguageCode | default site.Language.Lang }}" ...

However, to accurately represent the current language, we should use the .Lang variable.

I propose updating the template as follows:

<html lang="{{ with .Lang }}{{ . }}{{ else }}{{ site.LanguageCode | default site.Language.Lang }}{{ end }}" ...

With this change, the template will check if .Lang is defined and use it as the language value. If it is not defined, it will fallback to site.LanguageCode if available, or site.Language.Lang if neither .Lang nor site.LanguageCode are available.

This modification ensures that the template accurately reflects the current language being used.

Thank you for considering this improvement.

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

No branches or pull requests

1 participant