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

Cite author in quotations and alt text #3008

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

dato
Copy link
Contributor

@dato dato commented Sep 25, 2023

No description provided.

Copy link
Member

@mouse-reeve mouse-reeve left a comment

Choose a reason for hiding this comment

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

Thanks for this! Just a small change requested

return text
author = f"{name}: " if (name := self.author_text) else ""
edition = f" ({info})" if (info := self.edition_info) else ""
return f"{author}{self.title}{edition}"
Copy link
Member

Choose a reason for hiding this comment

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

In this case, I think this string should be localized, by wrapping it in _(), since it is used in the UI

Copy link
Contributor Author

@dato dato Oct 2, 2023

Choose a reason for hiding this comment

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

I think I see what you mean, but in that case... isn't this string a bit useless in translation context, since it's fully formatted already? (with colons, e.g.—this format being what might need changes in translation).

What I mean is: to make this translatable, shouldn't we produce three un-collapsed translation strings instead?:

  • {author}: {title}
  • {title} ({edition})
  • {author}: {title} ({edition})

(At this point could also be {title} by {author} ({edition}), but that's a separate matter.)

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see what you mean, since it's formatted in previous variables, translating the final string would be basically meaningless. It would be best from a translation standpoint to enumerate fully formed strings (even though that's annoying from a code standpoint), but I don't think that's a blocker to merging, since it already isn't translated


def save(self, *args: Any, **kwargs: Any) -> None:
"""can't be abstract for query reasons, but you shouldn't USE it"""
if not isinstance(self, Edition) and not isinstance(self, Work):
if not isinstance(self, (Edition, Work)):
Copy link
Member

Choose a reason for hiding this comment

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

👌

@dato dato requested a review from mouse-reeve October 9, 2023 04:17
@mouse-reeve mouse-reeve merged commit 2237a7e into bookwyrm-social:main Oct 19, 2023
10 checks passed
@dato dato deleted the author_in_citation branch October 20, 2023 02:09
dato added a commit to dato/bookwyrm that referenced this pull request Jan 25, 2024
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