Skip to content

FIX: Don't overwrite translated titles when updating badge #33731

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jul 21, 2025

What is the issue?

When using a non-English default locale and editing a badge, the titles for all badge holders using it is reset to the English name.

Why is this happening?

  1. We don't check if the badge name was actually changed before firing the bulk title update job.
  2. We fire the job with Badge#name which is the English name, instead of Badge#display_name which is the localized name.

expect_enqueued_with(
job: :bulk_user_title_update,
args: {
new_title: "Shieldbearer",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sad to change these custom fixtures, but not worth the hassle of injecting custom i18n test strings when we can use existing badges with existing translations. 😢

@Drenmi Drenmi merged commit 25bb2b7 into main Jul 23, 2025
27 of 29 checks passed
@Drenmi Drenmi deleted the fix/translated-badge-title branch July 23, 2025 07:46
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/trust-level-badge-change-causes-related-title-to-un-translate/342109/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants