Skip to content
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

Merged
merged 8 commits into from
May 24, 2024
Merged

Conversation

hmhealey
Copy link
Member

Summary

This is part of my mission to eradicate t from last week. Most of it is pretty straightforward replacement of t with defineMessage/defineMessages, and I also occasionally removed some use of localizeMessage as well, but I'll comment on anything noteworthy below.

Ticket Link

https://mattermost.atlassian.net/browse/MM-58324

Release Note

NONE

@hmhealey hmhealey added the 2: Dev Review Requires review by a developer label May 17, 2024
@mm-cloud-bot mm-cloud-bot added release-note-none Denotes a PR that doesn't merit a release note. labels May 17, 2024
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.';
Copy link
Member Author

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({
Copy link
Member Author

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;
Copy link
Member Author

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) {
Copy link
Member Author

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({
Copy link
Member Author

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

Copy link
Contributor

@nickmisasi nickmisasi left a 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.
Copy link
Contributor

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

Copy link
Member Author

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

@hmhealey hmhealey added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a developer labels May 24, 2024
@hmhealey hmhealey merged commit 30ef1d3 into master May 24, 2024
33 checks passed
@hmhealey hmhealey deleted the hh_may17-t-3 branch May 24, 2024 16:05
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants