Skip to content

[SR] Prepare strings for translation - Add context to interactive graph strings #2407

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

Merged
merged 3 commits into from
Apr 21, 2025

Conversation

nishasy
Copy link
Contributor

@nishasy nishasy commented Apr 17, 2025

Summary:

We held off on translations until now, beacuse the Interactive Graph strings were
still in flux. Now that they're finalized, we can send them in for translations.

I added context to all the strings that need to be translated so that

  • it's clear for translators looking at the translation ticket what
    the context is for each individual string.
  • it'll be easy for us to create the translation ticket in the first place.
    Since these are going to count as new strings, they'll trigger the
    action on the PR that will create a translation ticket for us that's
    pre-populated with all new strings.

NOTE: This PR is probably easier to review with the "Hide whitespace" option.

Issue: https://khanacademy.atlassian.net/browse/LEMS-2660

Test plan:

  • I looked at the PR diff, and then did a page search for every string on the left side and confirmed it's the exact same on the right side to make sure that no strings accidentally got changed in this PR.
  • We'll have to make sure that the strings are detected in the webapp PR so we can create a translation ticket with the new context.

@nishasy nishasy self-assigned this Apr 17, 2025
Copy link
Contributor

github-actions bot commented Apr 17, 2025

Size Change: +1.36 kB (+0.29%)

Total Size: 466 kB

Filename Size Change
packages/perseus/dist/es/strings.js 7.49 kB +1.36 kB (+22.24%) 🚨
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.7 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 98.6 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.js 18.4 kB
packages/perseus-editor/dist/es/index.js 88.5 kB
packages/perseus-linter/dist/es/index.js 7.05 kB
packages/perseus-score/dist/es/index.js 9.04 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 199 kB
packages/pure-markdown/dist/es/index.js 1.22 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Apr 17, 2025

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (6bb64d0) and published it to npm. You
can install it using the tag PR2407.

Example:

pnpm add @khanacademy/perseus@PR2407

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.js -t PR2407

@nishasy nishasy marked this pull request as ready for review April 17, 2025 23:22
Copy link
Member

@benchristel benchristel left a comment

Choose a reason for hiding this comment

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

Wow, this is a lot of strings! I found a few things that don't look quite right, but most of this LGTM.

srQuadraticGraph: {
context:
"Aria label for the container containing a Quadratic function in the interactive graph widget.",
message: "A parabola on a 4-quadrant coordinate plane.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
message: "A parabola on a 4-quadrant coordinate plane.",
message: "A parabola.",

Why mention the number of quadrants shown in the graph? I don't think this is actually correct; e.g. the graph might only show quadrant 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we added "4-quadrant" this time because so many of the related strings refer to the quadrant number that something is in. Even if the vertex doesn't show up on the graph, it'll read the quadrant that it's in.

It's a fair point though. Since this would require copy updates from a designer, I'm going to punt it to the phase 2 string updates.

Copy link
Contributor

@SonicScrewdriver SonicScrewdriver left a comment

Choose a reason for hiding this comment

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

The contexts you've added to the strings are GREAT! Absolutely love it, thank you!

@@ -505,7 +504,6 @@ export type PerseusStrings = {
point2X: string;
point2Y: string;
}) => string;
// The above strings are used for interactive graph SR descriptions.
Copy link
Contributor

Choose a reason for hiding this comment

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

I actually liked having this context, as the organization made it easier for our future selves to quickly find the chunk of strings! I'm not fussed either way, however as I know we have some great context on the strings themselves. :)

@nishasy nishasy merged commit 016357a into main Apr 21, 2025
8 checks passed
@nishasy nishasy deleted the ig-add-string-context branch April 21, 2025 17:07
nishasy added a commit that referenced this pull request Apr 21, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @khanacademy/[email protected]

### Patch Changes

- [#2407](#2407)
[`016357a5b`](016357a)
Thanks [@nishasy](https://github.com/nishasy)! - [SR] Prepare strings
for translation - Add context to interactive graph strings

## @khanacademy/[email protected]

### Patch Changes

- Updated dependencies
\[[`016357a5b`](016357a)]:
    -   @khanacademy/[email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants