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

New block: "Available translations" to list other translations for a theme #72

Merged
merged 2 commits into from
May 17, 2024

Conversation

ryelle
Copy link
Collaborator

@ryelle ryelle commented May 16, 2024

Fixes #28 — This adds a new block into the "Translations" section of the single theme sidebar, to list out all of the available languages for a given theme.

This is similar to what's on plugins, but I intentionally did not put it behind a dropdown (we can't reuse the plugins one, and it's not a true modal anyway). TBH I think having the full list is a good indicator of "theme health" — if a theme has been translated into many languages, people clearly thought it was worth translating for whatever reason.

Screenshots

On a theme with many translations (Twenty Nineteen).

theme-many-translations

On a theme with a few translations.

theme-few-translations

On a theme with no translations. No message appears when viewing from the English site, just the "translate" link.

theme-no-translations

Same theme, but viewed from a Rosetta site, links back to the main English site. No message about it not being supported in whatever you're viewing from, but the banner takes care of that with "This theme is not translated into Español yet. Help translate it!"

theme-no-translations-es

How to test the changes in this Pull Request:

Requires a sandbox for the locale database.

View a theme with active translations, they should be linked in the sidebar. Clicking the link takes you to the theme page on that Rosetta site.

@ryelle ryelle added the [Component] Blocks Custom blocks or block variations label May 16, 2024
@ryelle ryelle requested review from StevenDufresne and a team May 16, 2024 17:50
@ryelle ryelle self-assigned this May 16, 2024
@jasmussen
Copy link

This is similar to what's on plugins, but I intentionally did not put it behind a dropdown (we can't reuse the plugins one, and it's not a true modal anyway). TBH I think having the full list is a good indicator of "theme health" — if a theme has been translated into many languages, people clearly thought it was worth translating for whatever reason.

Happy to try this. The particular example is a bit long, so that is indeed the first instinct, the main concern, I suppose, would be cases where the sidebar ends up being longer than the main content column. Though that would, to your point, be a curious theme, successful in translations despite barely any description.

In any case, this seems like a collapsible we can make at a later time, if the need presents itself, so I can go either way on this one.

@ryelle
Copy link
Collaborator Author

ryelle commented May 17, 2024

For a little more reference, while Twenty Nineteen is translated into 63 languages, only 25 themes have >50 languages, so it is an extreme case. Most themes that have translations have <5.

In any case, I'll merge this and if it seems off in practice we can revisit a collapsible view.

@ryelle ryelle merged commit ea6c4f7 into trunk May 17, 2024
@ryelle ryelle deleted the add/available-translations branch May 17, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Blocks Custom blocks or block variations
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Theme Translations should be viewable directly
2 participants