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
Add language switcher to Learn WordPress for UI translations #187
Comments
On meta projects, translations are usually applied string-by-string. Then there's a delay, consisting of a cron-task for committing changes plus waiting for next deploy. (If there are no commits made for several days, and thus no deploys, then translations won't propagate.) |
My one concern about not setting a threshold is that experience could come across as a little buggy (namely, when you click on the language switcher, if there are only a few strings translated it might seem like nothing changed). Including some sort of badge/tooltip with a call to action, however, sounds like it could both address that and encourage contributions, which I'm a fan of 😄 Perhaps we can start with implementing the switcher for any language with 1 < strings translated, and then, as a second step, see if we can get some design input for tooltip ideas. |
This adds a script that retrieves taxonomy term names and descriptions from Learn WP via the REST API and writes them to a file that can get picked up by the pot file generator. This way the terms will get imported into the learn-wordpress translation project and can get translated by community volunteers. This new script will get run by a scheduled GitHub action and committed directly back to this repo. The generated file is outside of the wp-content directory, so it should never end up being committed to SVN or otherwise make an appearance on the production server. This also adds the filter to dynamically translate term names and descriptions when they are output on the front end, and adds a notice on term edit screens so users know that the strings will get translated. Refs #187
…ranslated (#202) Adds a locale switcher as a wp.org mu-plugin. It lives up in the Admin Bar at the top of the screen, which shows on the front end of Learn (and other wp.org sites) even if the visitor isn't signed in. The reasoning for putting the switcher here is: * It will be in the same place on every page. If it was lower down within the site header, it would have to be in a different place on the homepage than on internal pages. * It is reusable across all wp.org sites, should we have other places in the future where it makes sense to use it (and we have sufficient translation). The switcher uses WP/Gutenberg's native Combobox component for selecting the locale, rather than the select2 JavaScript library (or the selectWoo variant). The hope is that this will be both more accessible and more maintainable, since the future of development for select2/selectWoo is uncertain. This also adds a dismissible notice to the Learn theme right beneath the site header that shows when a chosen locale has less than 90 percent translation coverage. The notice explains the situation and provides links to the translation project where a visitor could add translations for their chosen locale if they want to. Refs #187
@coreymckrill Can this issue be closed now? The local switcher is live and looks like it works well, but I might be missing something. |
Hmm, yep, I think this can be closed. Not sure now why I kept it open... |
All static strings for Learn WordPress are currently available for translation via GlotPress. To be able to display these strings on the front-end of the Learn WordPress site, can we implement a language switcher like the one available on https://wp15.wordpress.net/?
The language switcher should show all locale variants that have 90% or more of the strings translated. (This percentage mimics the threshold for language packs for plugins and themes.) Locales with a smaller amount of strings translated, then, can be hidden from the language switcher to help filter available languages for visitors to the site.
Likewise, adding the ability to search for a language like the example language switcher will help filter choices for site visitors as the number of translated locales increases. We might also want to add the locale abbreviation for clarity, as well - i.e.
Français (fr_FR)
.Related discussion (Polyglots P2).
The text was updated successfully, but these errors were encountered: