-
Notifications
You must be signed in to change notification settings - Fork 5
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
undesirable '{0}' replacement #344
Comments
…r than deprecated '{0}'' pattern. #344
I made the refactor as suggested above and testing with several |
In phetsims/sun#472 (comment), it was suggested that we add an assertion to NumberDisplay and NumberSpinner, to verify that the required I think the solution is to skip the assertion in NumberDisplay and NumberSpinner if |
Fixed in the above commits. Tested masses-and-springs with and without @Denz1994 please verify. |
Thanks for looking into this. String test is looking good. |
…asses-and-springs#344 masses-and-springs-basics-1.0 branch. The masses-and-springs-basics-1.0 branch was created for this fix.
These changes have been applied to the Closing this issue |
Noted in phetsims/scenery-phet#446.
NumberControl requires either '{{value}}' or '{0}' in the string pattern. The former is preferred, the latter is deprecated in new code.
These 2 strings are used with NumberControl:
If '{{value}}' had been used in those strings, these replacements would be unnecessary:
Since these strings have been released and translated, it's probably too late (and too much work) to change them. But there's still room for improvement here.
Since NumberControl supports '{{value}}', replacement with '{0}' should be avoided. And proliferation of the string literals '{{value}}' and '{0}' should also be avoided. So recommended to replace '{0}' in the above with
NumberDisplay.NAMED_PLACEHOLDER
.The text was updated successfully, but these errors were encountered: