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

Maintenance: Add language switcher to the page header. #169

Merged
merged 7 commits into from
Sep 18, 2023

Conversation

dvuckovic
Copy link
Contributor

@ralf401 @mgruner I think we should apply this only to the main branch, since we don't publish translations for the pre-release. What do you think?

@dvuckovic dvuckovic self-assigned this Sep 15, 2023
@mgruner
Copy link
Contributor

mgruner commented Sep 15, 2023

I think we can't prevent it from going to pre-release as well (latest with the next merge/reset). It must be robust enough to detect that. How does it work for the pre-release warning badge that is there currently? It must detect this somehow, based on build environment data.

@mgruner
Copy link
Contributor

mgruner commented Sep 15, 2023

OTOH, pre-release can also be translated. We just don't publish the translations (yet).

@dvuckovic
Copy link
Contributor Author

I think we can't prevent it from going to pre-release as well (latest with the next merge/reset). It must be robust enough to detect that. How does it work for the pre-release warning badge that is there currently? It must detect this somehow, based on build environment data.

Unless we don't reset it anymore? Note that pre-release is also the default branch of the repo: all clones have to reset their state which is really an inconvenience.

Warning badge is powered by the versionwarning extension for Sphinx. So, it's injected at build time, while our new language switcher is currently run time only and is always injected.

I found a way to skip the injection of the language switcher in pre-release mode. However, I did build in a condition to show the language switcher only if translations are enabled: it should work as long as the number of link sections in the RTD panel does not change (a bit flimsy, but works well). This will be needed for future stable versions, since they will have translations in place.

Copy link
Contributor

@mgruner mgruner left a comment

Choose a reason for hiding this comment

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

Looks very nice!

conf.py Show resolved Hide resolved
Copy link
Contributor

@ralf401 ralf401 left a comment

Choose a reason for hiding this comment

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

Looks really nice!!

@dvuckovic dvuckovic merged commit de559d0 into zammad:main Sep 18, 2023
1 check passed
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.

3 participants