Add Locale test
edwardrowe opened this issue · comments
We should add a test to verify that every instance of LocaleManager.GetTranslation(key) has a corresponding key in all languages.
(errorTryintToGetOriginalName is not translated, for ex (because I suspect a typo).
We could also add tests to make sure all translated strings are unique (though that may be a valid use case). But I noticed these duplicates are incorrect:
{
"key" : "addSelectedObjects",
"value" : "Trying to get original name for RenameResultSequence at index that's out of bounds. Index: {0}"
},
{
"key" : "errorTryingToGetOriginalNameOutOfBounds",
"value" : "Trying to get original name for RenameResultSequence at index that's out of bounds. Index: {0}"
},
For purposes of patch v1.7, we could consider writing a script to verify all keys against their GetTranslation. i tried to manually do it but clearly missed some.
I created some test cases for the locale manager with this last PR.
I dont think we should add the test to check for duplicated values, as you said, I also think at some point we might have duplicates. Maybe we could do something (outside the test runner) to check that.
Do you want me to re-check the pt translations?
The main thing I'm concerned about is that all old hard coded strings got properly moved into the language files. I'm being a stickler here because there's no way I've tested all code paths where these get displayed.
Given that writing a script to do this would take a long long time, it's probably best if we both just go through the diff one more time. I'll try to do a pass on it in a few hours, and comment here when I'm done.
Phew ok did a very manual pass on the commit that added the keys (057479d#diff-4d91a18ce0a11ec4ef3f069f662ee946).
I verified everywhere we request a key, it exists in the en language, and verified the Value was the same as the text it replaced. Only found one minor issue, which was errorTryintToGetOriginalName
. I fixed it in Portuguese as well, because it's just a duplicated value of key errorTryingToGetOriginalNameOutOfBounds
.
I also removed a redundant key, countByLetter
. I think we could also add a test to check for doubled up keys.