Skip to content

Commit

Permalink
fix: if no keys, set number of translated to 0
Browse files Browse the repository at this point in the history
If there are no string keys for a given key type (sim-specific, shared,
or common), we set the number of translated strings in the form to 0.

For #345.

Came out of phetsims/qa#869.
  • Loading branch information
liammulh committed Feb 8, 2023
1 parent fdabad1 commit 7b5774f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/js/computeTranslatedStringsData.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const computeTranslatedStringsData = translationValues => {
}
translatedStringsData[ keyType ].translated = translatedStringsCount;
}
else {

// If there aren't any string keys for a given key type, set translated to 0.
// Thus, you'd get a message like "0 of 0 {key type} strings translated".
translatedStringsData[ keyType ].translated = 0;
}
}
}
return translatedStringsData;
Expand Down

0 comments on commit 7b5774f

Please sign in to comment.