-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wonder-stuff-i18n package. (#216)
## Summary: This moves the i18n logic out of Webapp and into Wonder Stuff so that it can be more-easily shared. In the process I converted the code to use ES6 imports/exports and also use Flow types. I had to add some logic to our build-settings so that we can generate bin scripts (since this is the first package to have them). Issue: FEI-4434 ## Test plan: I confirmed the bin scripts worked by making a simple test file and then running `yarn build` in the root and then the following in `packages/wonder-blocks-i18n`: ``` packages/wonder-stuff-i18n (i18n-pkg) > ./dist/bin/gen-potfile.js foo.js msgid "" msgstr "" #: foo.js:1 msgid "Test String" msgstr "" #: foo.js:3 #, python-format msgid "Singular %(num)s" msgid_plural "Plural %(num)s" msgstr[0] "" msgstr[1] "" packages/wonder-stuff-i18n (i18n-pkg) > ./dist/bin/all-i18n-strings.js foo.js Test String Singular %(num)s (plural: Plural %(num)s) ``` Author: jeresig Reviewers: kevinbarabash, jeresig Required Reviewers: Approved By: kevinbarabash Checks: ✅ Test (macOS-latest, 16.x), ✅ Test (macOS-latest, 12.x), ✅ Test (ubuntu-latest, 12.x), ✅ codecov/project, ✅ CodeQL, ✅ Lint, flow, and coverage check (ubuntu-latest, 16.x), ✅ gerald, ✅ Analyze (javascript), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 16.x), ⏭ dependabot Pull Request URL: #216
- Loading branch information
Showing
27 changed files
with
5,473 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@khanacademy/wonder-stuff-i18n": major | ||
"ws-dev-build-settings": patch | ||
--- | ||
|
||
Add wonder-stuff-i18n package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// flow-typed signature: 02e095fc2135e742ae3a993ce37b6294 | ||
// flow-typed version: <<STUB>>/ancesdir_v1.1.0/flow_v0.176.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'ancesdir' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'ancesdir' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'ancesdir/dist' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'ancesdir/dist/index' { | ||
declare module.exports: $Exports<'ancesdir/dist'>; | ||
} | ||
declare module 'ancesdir/dist/index.js' { | ||
declare module.exports: $Exports<'ancesdir/dist'>; | ||
} |
Oops, something went wrong.