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

FEATURE: Show experimental language switcher for anon users #198

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented Jan 22, 2025

This PR allows anon users to select a language using a language switcher, this feature is behind an experimental site setting experimental_anon_language_switcher. The set of languages are defined by the same one available to existing users of the site, with the required allow_user_locale setting turned on:

https://github.com/discourse/discourse/blob/de7e213052c850aab0258131c47da777ec679621/app/models/locale_site_setting.rb#L37-L50

In the near future, we may consider shortening this list of languages, and will also expand this feature into user-contributed content.

anon-switch.copy.mp4

@nattsw nattsw force-pushed the language-selector branch from 32ee6ba to 9dc24a4 Compare January 22, 2025 11:02
nattsw added a commit to discourse/discourse that referenced this pull request Jan 23, 2025
…ions (#30924)

Related: discourse/discourse-translator#198

The new experimental feature on discourse-translator requires this
`SiteSetting.set_locale_from_cookie` to be set. This comment unhides the
existing site setting.
@nattsw nattsw changed the title FEATURE: Show language switcher for anon users FEATURE: Show experimental language switcher for anon users Jan 23, 2025
@nattsw nattsw marked this pull request as ready for review January 23, 2025 09:36
position: "first",
className: state.isTranslated ? "translated" : null,
};
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yikes! It's not perfect, this was accidentally removed. Will add it back.

@nattsw nattsw merged commit 48682c2 into main Jan 24, 2025
4 checks passed
@nattsw nattsw deleted the language-selector branch January 24, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants