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

FEI-4409: Extract i18n strings #123

Merged
merged 4 commits into from Apr 22, 2022
Merged

FEI-4409: Extract i18n strings #123

merged 4 commits into from Apr 22, 2022

Conversation

kevinbarabash
Copy link
Member

@kevinbarabash kevinbarabash commented Apr 21, 2022

Summary:

Once we move the Perseus code into this repo we'll need to be able to extract strings from it. This PR ports the extract-perseus-strings.js script from webapp for just that purpose.

Since both perseus and perseus-editor will contain some i18n strings, we output one strings.js file per package. The file for perseus contains all of the strings for math-input as well.

TODO:

  • add a i18n._() call to perseus/index.js and perseus-editor/index.js to ensure that strings are being extracted from those locations

Issue: FEI-4409

Test plan:

  • yarn extract-strings, see that strings have been extracted to dist/strings.js
kevinbarabash@Kevins-MacBook-Pro perseus % yarn extract-strings
yarn run v1.22.17
$ ./utils/extract-strings.js
[INFO ]: wrote 46 strings to /Users/kevinbarabash/khan/perseus/packages/perseus/dist/strings.js
[INFO ]: wrote 1 strings to /Users/kevinbarabash/khan/perseus/packages/perseus-editor/dist/strings.js
✨  Done in 1.50s.

@kevinbarabash kevinbarabash self-assigned this Apr 21, 2022
@kevinbarabash kevinbarabash requested a review from a team April 21, 2022 22:14
Comment on lines +17 to +19
; sketchy-null=error
sketchy-number=error
unclear-type=error
; unclear-type=error
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll try turning these back on tomorrow and fixing the actual issue.

Copy link
Collaborator

@jeremywiebe jeremywiebe left a comment

Choose a reason for hiding this comment

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

Looks good. Was able to generate the strings on my machine and require them in a node REPL.

utils/extract-strings.js Outdated Show resolved Hide resolved
@kevinbarabash kevinbarabash requested a review from a team April 22, 2022 13:48
@kevinbarabash kevinbarabash merged commit aeaab5a into main Apr 22, 2022
@kevinbarabash kevinbarabash deleted the fei-4409 branch April 22, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants