-
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 from cloud-related and license-related code #27055
Conversation
let defaultMessage; | ||
if (props.config?.EnableSignUpWithGitLab === 'true') { | ||
id = t('announcement_bar.error.site_url_gitlab.full'); | ||
defaultMessage = 'Please configure your <linkSite>site URL</linkSite> either on the <linkConsole>System Console<linkConsole> or, if you\'re using GitLab Mattermost, in gitlab.rb.'; |
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.
There's a small typo I fixed here because this previously had <linkConsole>System Console<linkConsole>
which is missing the slash on the closing tag. I don't know if it caused any issues because it's just a default value, but I wanted to mention it since it's one of the few user-visible changes here
@@ -31,50 +30,50 @@ export default function LHSNearingLimitsModal() { | |||
const [limits] = useGetLimits(); | |||
|
|||
const primaryAction = { | |||
message: { | |||
id: t('workspace_limits.modals.view_plans'), | |||
message: defineMessage({ |
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.
As I noted in another PR, we could group these together in one defineMessages
, but using defineMessage
here made the diff much easier to read
|
||
type Props = { | ||
icon: JSX.Element; | ||
title?: string; |
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.
It looks like this component was originally written to take strings for all these props and then the "formatted" versions were added. I got rid of those to simplify this
@@ -88,19 +72,6 @@ export default function IconMessage(props: Props) { | |||
{formattedLinkText} | |||
</div> | |||
); | |||
} else if (linkText && linkURL) { |
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.
This case isn't used
t('FIVE_HUNDRED_TO_1000'); | ||
t('ONE_THOUSAND_TO_2500'); | ||
t('TWO_THOUSAND_FIVE_HUNDRED_AND_UP'); | ||
defineMessages({ |
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 tried adding this inline to the enum below. I'm pretty sure that shouldn't be written using an enum because we also use it as the source of translation strings, but trying to change that ended up being far too much work to be worth cleaning it up a little
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.
LGTM!
@@ -2,8 +2,7 @@ | |||
// See LICENSE.txt for license information. |
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.
looks like I missed this one in the self serve clean up - if you want to remove it now you can, same with the scss file it imports (looks to not be imported) otherwise you can leave it for me to get later
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 think I'll leave those for you in case there's any related components or anything else to remove. I'm trying my best to keep these changes to just i18n-related code since I've already spent too much time on them
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