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

Finish support for dynamic locale #225

Open
pixelzoom opened this issue Nov 5, 2022 · 2 comments
Open

Finish support for dynamic locale #225

pixelzoom opened this issue Nov 5, 2022 · 2 comments

Comments

@pixelzoom
Copy link
Contributor

This sim mostly supports dynamic locale. But there's still one remaining task. In EquationMarkup, all occurrences of "StringProperty.value" should just be "StringProperty".

This will be a significant chunk of work. EquationMarkup is a set of utility functions that create fragments of various equations. And when locale changes, those equations need to update their translated symbols.

For equations, it might be easier (certainly more efficient) to observe localeProperty, and rebuilt the equations when the locale changes.

localeProperty is a singleton, imported via:

import localeProperty from '../i18n/localeProperty.js';
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Nov 5, 2022

For equations, it might be easier (certainly more efficient) to observe localeProperty, and rebuilt the equations when the locale changes.

Probably not a good idea, because it creates listener-order dependencies. Something is presumably observing localeProperty and updating the sim's localized StringProperties. And that observer would need to run first, so that the StringProperties were updated before Fourier's equation were updated. That will certainly happen with the current order that observers are added, but would presumably fail if the observers list is shuffled.

@pixelzoom
Copy link
Contributor Author

Support for dynamic locale has been completed. This will need to be reviewed before the sim is republished from main.

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

No branches or pull requests

1 participant