Closed liammulh closed 1 year ago
After a short chat with @chrisklus it looks like this was done to create even spacing among the labels in the Half-Life Timescale Dialog.
I looked into changing this, and I do believe we can hardcode it through the sim by setting the monospace font when the Text
element is created. This would require some code restructuring (the css is overwriting Text
font options in a couple of places, which I don't love).
Before I continue moving forward with this:
What are the repercussions of changing string values when there is an already published prototype? Specifically when this sim goes to full publication?
There is a big red warning in the translation utility that strings in prototype sims might change, so it's preferable to change the strings before publication rather than after.
What are the repercussions of changing string values when there is an already published prototype? Specifically when this sim goes to full publication?
To answer the original question, the translators will have to re-translate the string if they've already translated it. But assuming they've read the warning, they are okay with that.
What @liammulh says about the translators re-translating is true, but if you use the same string keys, this will look pretty bad in the translated versions. I had a similar issue come up for Greenhouse Effect, and I did a manual fix of all of the translations before re-publishing it. It was essentially just a search and replace of the strings, so it wasn't hard, but it had to be timed to be done just before the sim was re-published. You could log an issue and plan to do the same thing.
Alternatively, you could change the English strings, then fix the translations, and then publish a maintenance release of the prototype. That would solve the problem and there would be no risk of missing this step with the next publication.
@Luisav1 and I decided that since her time on this sim is limited we will put this issue on hold until the sim is ready for publishing.
We are getting ready to sprint on this. Marking off hold.
@Luisav1 and I discussed this today, and would like to experiment with making the first letter its own Node. Then we can use an AlignBox to ensure the correct spacing.
This is blocking me testing stringTest=dynamic because of the html formatting. I'm going to work on this in correlation with https://github.com/phetsims/build-a-nucleus/issues/90. @marlitas recommended grid box with 3 columns: the letter, the hyphen, and the i18n sentence.
I got to a commit point, refactoring things to match exactly, but instead using grid box. I have some concerns:
We will keep the monospace font because it is the easiest solution to the jumbled-ness that occurs below without it:
We will work on fixing the translations too.
Ok. So we want to create a script that will basically convert all translations from something like:
"value": "<span style=\"font-family: monospace;\"><b>A</b></span>"
to A
.
Here is a script:
And here is the output. It will only output situations in which the translation wasn't identical to the input (`"<span style=\"font-family: monospace;\">C"). These we may need to handle manually.
Questions:
AA
)? @jbphet and I think we should make it just a single letter, this looks weird to us (and likely just a misunderstanding: https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_om.htmlam
and om
.REMEMBER THAT WE ABSOLUTELY DO NOT WANT TO DO THIS UNTIL RIGHT BEFORE PUBLICATION.
Updated script that is parsing out all the weird cases so we can provide the right value for translations.
Ok, I'm linking https://github.com/phetsims/build-a-nucleus/issues/125 into this issue, which includes fixing the dashes which are no longer in i18n strings. The commit that broke translations and needs patching is https://github.com/phetsims/build-a-nucleus/commit/8cae8de53cde01d66ae453c79a1ae51b823db3e5.
Here is a script that is pretty much complete at fixing both problems:
Steps once we are ready to publish:
I reviewed the above with @solaolateju and we both agree with the path forward.
\u202a
into the actually rendered character. I don't think we want to do this, so I need to look at babel to see how we keep the unicode language in the babel repo.After discussing with JB, I'll just revert that trouble before continuing.
Noting that this issue (I think 😂) is present in https://github.com/phetsims/qa/issues/977
tagging https://github.com/phetsims/qa/issues/988 to keep this on your radar 📡.
Alright we are ready to do this, pushed above. Proceeding to publication.
From Slack:
It looks like @Luisav1 and @marlitas are the responsible devs, so assigning them.