-
Notifications
You must be signed in to change notification settings - Fork 2
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
Identify unused strings in sims #460
Comments
I added a checklist item, which can be seen here: Should we also try to create automated tools to help with this (or are there already some in place that I am unaware of)? |
Does Rosetta show these unused strings to the translator, or does it get the set of strings that are actually used from the html file? If the latter, then I care less about this issue. |
@samreid says that rosetta.routes.js, line 407, looks like it's reading the English strings file, and therefore showing unused strings. |
So we need something like chipper.reportUnusedMedia, but for strings. As strings are loaded, add them to a list. When done, compare the list to the English string file, identify English keys that are not in the list - they are the unused strings. |
@jessegreenberg volunteered to looks at this. |
Example output from balloons-and-static-electricity:
|
Ran through grunt-all.sh, spot checking results. Reported unused strings were correct. @pixelzoom, would you mind reviewing reportUnusedStrings.js if you have the time? |
Looks great. I made one change, which was to clarify the warning message. For example, for this unused entry in function-builder-strings_en.json: "foo": {
"value": "Foo"
} The old message was:
The revised message is:
If that looks OK to you, feel free to close this issue. |
Thanks for reviewing! Yes, that does clarify the output. Change is good, closing this issue. |
For the record, I think the assertion that rosetta uses the English string file as the basis of what to present to users of the translation utility (as stated in #460 (comment) above) is incorrect. I'm basing this on two things:
What could be going on at the aforementioned line 407 in I could dig into the further if we need a definitive answer on this. |
Rosetta gets its strings from the published html file, so unused strings won't go away until a new sim version is published. A definitive answer to whether Rosetta presents unused strings to the translator is important only if PhET cares whether unused strings are being translated. Reopening and assigning to @ariel-phet to decide whether @jbphet should dig further. |
As far as I understand it, the strings are loaded with the requirejs plugin and hence only the used strings appear in the built HTML file. |
Since the currently published version of Bending Light (v1.0.0) is known to contain unused strings (see phetsims/bending-light#340), I figured that I'd test whether these strings appear on the translation page for this sim. The list of unused strings can be seen in this commit (where they were removed from the master branch): phetsims/bending-light@9922159. Below is a screenshot of the translation page that was presented by Rosetta. None of the missing strings are presented. It's still a good idea to get rid of the unused strings as part of our development process, but in my opinion doing maintenance releases on existing sims with unused strings is not a good use of our time, since it appears that such strings aren't seen by translators. |
Marking for developer meeting just so we are all on the same page. If such strings are not seen by translators I am fine with making sure they are removed, but not worrying about doing maintenance releases to address, as the issue will get addressed with future redeploys (phet-io, a11y, etc) |
My understanding is: |
The above list makes summarizes my thoughts as well. No need to redeploy, but unused strings should be removed as they pop up after the build. |
In phetsims/bending-light#340 I discovered that there were unused strings in Bending Light. We should add an automated tool to report on this (I had thought there was one?) or add steps in the code review to prevent this problem in the future because once a simulation is published it becomes difficult to change the strings file (due to concurrent modification by translators).
The text was updated successfully, but these errors were encountered: