phetsims / rosetta

PhET's Simulation Translation Utility
MIT License
3 stars 1 forks source link

Remove `NO_LONGER_USED_FLAG` code #395

Open liammulh opened 1 year ago

liammulh commented 1 year ago

The single source of truth for a sim's strings should be the strings in the published sim.

It's been a while since I've dealt with the code that uses the NO_LONGER_USED_FLAG constant. I want to know what the scenario it covers is, and whether it's necessary to cover that scenario.

liammulh commented 1 year ago

@jbphet and I looked at the NO_LONGER_USED code, and we think it can be removed. We are going to do an informal regression test by:

If there are no discrepancies, I think we should remove the code.

liammulh commented 1 year ago

Okay, I just removed the NO_LONGER_USED_FLAG, and I can confidently say it is necessary. It messed up just about every stat. However, I am confused as to why this is the case.

stats
liammulh commented 1 year ago

I am going to defer further investigation and prioritize other tasks for now.

liammulh commented 1 year ago

@jbphet and I figured out that we do need this code. We added a comment above the constant:

// Define a value that indicates that a string is no longer used. It's
// possible that a sim could have a string "no longer used", so I
// (Liam Mulhall) added a nonsense word "gooble". The primary purpose of
// this constant is to strip out strings that were once used for accessibility like
// SCENERY_PHET/ResetAllButton.name or JOIST/HomeButton.name. These
// strings are present in some older sim publications, but not in the
// master version of their string file(s). Now, all accessibility strings
// are prefixed with a11y.

If someone accidentally removes a string from the English master string file for e.g. joist, then the string won't be presented to the user for translation, and that string won't be considered in the translation statistics. This is an edge case, but something to keep in mind if a translator writes in about not being able to translate a string.

If at some point we re-publish all sims off of master, then this code will be obsolete, and can be removed. At this point, it still serves a purpose, so we are deferring this issue.