Skip to content

docs: adding translation stats to docs #511

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RobPasMue
Copy link
Contributor

Adding a dependency to this package with plotly for providing nice stats graphs.

See rendered docs for demonstration but here is a snapshot

image

@RobPasMue
Copy link
Contributor Author

This PR is related to #493 -- second step declared in #493 (comment)

@RobPasMue
Copy link
Contributor Author

The solution involves creating a Sphinx extension that reads in the JSON data generated, and creates a Plotly graph (with plotlyjs) and embeds it into the docs. Full statistics reports for each module are shown when hovering over the bar (as a function of the locale and module). This uses the hover tooltip to render properly.

Hope you like it! Looking forward to feedback related to it @lwasser!

@lwasser lwasser requested review from flpm and sneakers-the-rat May 28, 2025 16:20
@lwasser
Copy link
Member

lwasser commented May 28, 2025

@RobPasMue this is awesome!! Here is my one question, and then I'll provide a suggestion, but let's see what @flpm and @sneakers-the-rat think! I suspect that because translating.md is NOT actually a part of our pshinx guide, that people won't be able to see the graphic that you made in the page (i could be wrong but it looks like it needs to render plotly).

So as a middle ground, could we do the following

  1. Could we export the plot as a PNG too, so we could drop it in the readme file?
  2. Could we make TRANSLATING.md a part of our Sphinx build and add a contributing tab?
  • That way the interactive plot gets rendered via Sphinx (and this page is no longer an "orphan".
  • We can also include a static image in our README file for drive-by contributors on GitHub.

y'all - let me know how that lands!

))

# Create figure
fig = go.Figure(data=traces)
Copy link
Member

Choose a reason for hiding this comment

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

@RobPasMue could we create a grid of plots - one for each language?

then each plot could have 3 bars - one for fuzzy, one for complete and one for incomplete (or it could be stacked bars too.

What you have now is awesome but if we add more languages it will get complex over time. And a static version of the plot would be nice too.


# Create figure
fig = go.Figure(data=traces)
fig.update_layout(
Copy link
Member

Choose a reason for hiding this comment

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

Could the plot please use our pyOS colors?

Dark Purple: #33205c
Light Purple: #735fab
Pale Purple: #bab3d4
Magenta: #bb82b0
Sea Green: #81c0aa

Copy link
Member

@lwasser lwasser left a comment

Choose a reason for hiding this comment

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

This looks so good - i just suggested a few changes. We could add translating, contributing etc to the guidebook as pages in another pr as well if we want to merge this. I just worry that the beautiful work done here won't render until we add these pages to the guide (i could be wrong!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants