Skip to content

FEATURE: Also localize banners #32908

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 2 commits into from
May 26, 2025
Merged

FEATURE: Also localize banners #32908

merged 2 commits into from
May 26, 2025

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented May 26, 2025

Banners take a different route and are retrieved separately.

Screenshot 2025-05-23 at 4 54 22 PM

Comment on lines +1390 to +1393
html = post.cooked
if (guardian && ContentLocalization.show_translated_post?(post, guardian))
html = post.get_localization&.cooked.presence || html
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
html = post.cooked
if (guardian && ContentLocalization.show_translated_post?(post, guardian))
html = post.get_localization&.cooked.presence || html
end
html =
if (guardian && ContentLocalization.show_translated_post?(post, guardian))
post.get_localization&.cooked.presence
end
html ||= post.cooked

Little bit of code golf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I actually fiddled with this section quite a bit, but I found that the original one I wrote is more readable (html is post.cooked by default).

I will leave it as-is unless you think there is some perf issue.

@nattsw nattsw requested a review from tgxworld May 26, 2025 04:57
Copy link
Contributor

@tgxworld tgxworld 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 👍

@nattsw nattsw merged commit b485e04 into main May 26, 2025
16 checks passed
@nattsw nattsw deleted the banner-localize branch May 26, 2025 05:16
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.

2 participants