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

AO3-5053 Update bookmarker byline when pseud or username changes #4773

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

irrationalpie7
Copy link
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-5053

Purpose

Updates bookmark blurbs when a bookmarker changes their username or pseud

Testing Instructions

See Jira.

References

I modeled some of my approach on https://otwarchive.atlassian.net/browse/AO3-4120

Credit

irrationalpie, they/them

<% blurb_cache_key = (is_author_of?(bookmark) ? "bookmark-owner-blurb-#{bookmark.cache_key}-v2" : "bookmark-blurb-#{bookmark.cache_key}-v2") %>
<!--bookmarker-->
<h5 class="byline heading">
<%= t("Bookmarked by") %> <%= link_to(bookmark.pseud.byline, user_pseud_bookmarks_path(bookmark.pseud.user, bookmark.pseud)) %>
Copy link
Contributor

@Bilka2 Bilka2 Apr 3, 2024

Choose a reason for hiding this comment

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

The feature test error is happening because you switched from ts to t. The switch is great, t is preferred. But then the link to the user should be integrated into the translation call so it looks like t(".bookmarked_by_html", pseud_link: link_to(....)) and the translation needs to be in config/locales/views/en.yml, in this case in a new section for bookmarks:

bookmarks:
  bookmark_user_module:
    bookmarked_by_html: Bookmarked by %{pseud_link}

Copy link
Contributor

Choose a reason for hiding this comment

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

For context: Normally the tests would let you know that the translation for "Bookmarked by" is missing (in the yml file). The missing translation caused it to get converted to "Bookmarked By" in the feature tests. And the test for missing translations fails, as it should. However, the reporting for it on GitHub is broken, see https://otwarchive.atlassian.net/browse/AO3-6703.

I found what the issue was because I tried to look at the blurb in my local dev install and got the "translation missing" error there.

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