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

Fix translations not working on commentModerationActions when user accounts are deleted #4427

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

nick-funk
Copy link
Contributor

What does this PR do?

There are two common.ftl files, one is server side, the other is in the shared library between the server and the client.

This moves the common-accountDeleted into the server side ftl so that it can be pulled by the i18n bundles duirng the user deletion task.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

No new indices.

How do I test this PR?

  • Modify the value of common-accountDeleted in server/src/core/server/locales/en-US/common.ftl to something obvious like THIS IS TRANSLATED
  • Leave the default in the code under server/src/core/server/services/users/delete.ts at the value of User account deleted so you can see that the text is translated
  • Modify the cronTime to "0,30 * * * * *" (five *'s, not 4) in server/src/core/server/cron/accountDeletion.ts so that it runs twice a minute
  • Start up the code base using multi-site-test and npm run development:withJobs
  • Enable DSA under Admin > Config > General > DSA with an admin/mod user
  • Enable user deletion under Admin > Config > Authentication > Commenter account management features with an admin/mod user
  • Create a new user (will delete them soon)
  • Post some comments with the new user
  • Schedule the user you created for deletion
  • Using Mongo, modify the scheduledForDeletionDate on that user to some time months ago
  • Wait 30-ish seconds for the account to be deleted
  • Check the users comments for commentModerationActions where the detailedExplanation is THIS IS TRANSLATED to prove that the translation happened properly for the rejected/deleted comments

Where any tests migrated to React Testing Library?

No

How do we deploy this PR?

No special considerations.

Copy link

netlify bot commented Nov 24, 2023

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit cb5875c
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/656136f0e45fc700085ae630

Copy link
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just left a comment on one more translation that I think needs to move over.

@@ -62,5 +62,3 @@ common-moderationReason-detailedExplanation-placeholder =

common-userBanned =
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 we probably need to move this one over to the server common translation file too?

@kabeaty kabeaty added this pull request to the merge queue Dec 4, 2023
Merged via the queue into develop with commit 64b978a Dec 4, 2023
5 checks passed
@kabeaty kabeaty deleted the fix/account-deletion-common-translation branch December 4, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants