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

Updates to typescript handling of i18n dynamic strings #892

Closed
zepumph opened this issue Dec 12, 2022 · 2 comments
Closed

Updates to typescript handling of i18n dynamic strings #892

zepumph opened this issue Dec 12, 2022 · 2 comments

Comments

@zepumph
Copy link
Member

zepumph commented Dec 12, 2022

While working on phetsims/chipper#1366, I found that most of the @ts-expect-errors in joist have to do with the newish dynamic locales, mapping a locale string to a general string and then trying to pull the string union back out. Luckily, in my working copy I'm finding it quite easy to base everything on the typeof the locale map object for exact type checking.

@zepumph
Copy link
Member Author

zepumph commented Dec 12, 2022

Ok. I had good success here. I like all of the changes, specifying Locale instead of string is a huge improvement in joist and expanded to a large number of other places.

@zepumph zepumph closed this as completed Dec 12, 2022
zepumph added a commit to phetsims/brand that referenced this issue Dec 12, 2022
zepumph added a commit to phetsims/number-play that referenced this issue Dec 12, 2022
zepumph added a commit to phetsims/chipper that referenced this issue Dec 12, 2022
zepumph added a commit to phetsims/sound-waves that referenced this issue Dec 12, 2022
samreid added a commit to phetsims/chipper that referenced this issue Dec 16, 2022
@samreid
Copy link
Member

samreid commented Dec 16, 2022

I found some sims such as Molecule Shapes allow empty english strings, so I adjusted the assertion. Tagging @zepumph in case this is unexpected.

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

No branches or pull requests

2 participants