Use string literals for transaction category localized messages#10391
Merged
Use string literals for transaction category localized messages#10391
Conversation
Collaborator
Builds ready [b0d0613]
Page Load Metrics (1375 ± 115 ms)
|
b0d0613 to
cc1dc19
Compare
kumavis
reviewed
Feb 8, 2021
Member
There was a problem hiding this comment.
maybe weird that we dont hit this validation if the defaultTitle is present
Member
Author
There was a problem hiding this comment.
I meant the default case to imply that it was OK for the category to not be matched. That's how it's used in useTransactionDisplayData for example - there was a fallback present.
But now that you mention it... that doesn't seem ideal, I agree. Maybe we can remove the need for that fallback case. I'll look into that.
Member
Author
There was a problem hiding this comment.
This was addressed in a8ab8e8
The default case has been replaced by another condition in the one case it was relied upon.
Collaborator
Builds ready [cc1dc19]
Page Load Metrics (872 ± 20 ms)
|
We now use string literals for all transaction category localized messages. This makes it easier to verify that we have translations for each of them, and that we aren't leaving any unused translations around.
The default case of `getTransactionCategoryTitle` wasn't necessary. I audited all cases where the `transactionCategory` property is assigned, and they all assign it to known transaction categories. So it should be impossible for that to be an unrecognized value. The only real case the fallback was useful for was when `null` or `undefined` was given as the transaction category in the confirm transaction base component. That case was handled there instead.
de1aa5c to
a8ab8e8
Compare
Collaborator
Builds ready [a8ab8e8]
Page Load Metrics (969 ± 55 ms)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We now use string literals for all transaction category localized messages. This makes it easier to verify that we have translations for each of them, and that we aren't leaving any unused translations around.