-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Remove t from miscellaneous components #27058
Conversation
@@ -316,7 +315,8 @@ export default class SidebarCategory extends React.PureComponent<Props, State> { | |||
|
|||
let displayName = category.display_name; | |||
if (category.type !== CategoryTypes.CUSTOM) { | |||
displayName = localizeMessage(`sidebar.types.${category.type}`, category.display_name); | |||
const message = categoryNames[category.type as keyof typeof categoryNames]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent a while fighting with this, but I could not get it to stop complaining that categoryNames
didn't have an entry for 'custom'
even though the above line says that it can't be that value specifically. It also didn't work if I changed the above check to category.type in categoryNames
either, so I eventually just gave up and went with the type assertion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see how few we have t functions left after this
Summary
This is part of my mission to eradicate
t
from last week. Most of it is pretty straightforward replacement oft
withdefineMessage
/defineMessages
, and I also occasionally removed some use oflocalizeMessage
as well, but I'll comment on anything noteworthy below.Ticket Link
https://mattermost.atlassian.net/browse/MM-58324
Release Note