From d9e5424beb2cf524aaf30452e5a6254afce384b3 Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Tue, 30 Apr 2024 11:49:57 -0400 Subject: [PATCH] Fix some i18n-related bugs --- openlibrary/templates/account/reading_log.html | 2 +- openlibrary/templates/lists/list_overview.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openlibrary/templates/account/reading_log.html b/openlibrary/templates/account/reading_log.html index 0298027cbec..486e51d7596 100644 --- a/openlibrary/templates/account/reading_log.html +++ b/openlibrary/templates/account/reading_log.html @@ -4,7 +4,6 @@ $ meta_photo_url = "https://archive.org/services/img/%s" % get_internet_archive_id(user.key) $ userDisplayName = user.displayname or ctx.user.displayname $ readlog_keys = ['want-to-read', 'already-ready', 'current-reading'] -$ shelves = [_('want to read'), _('currently reading'), _('already read')] $if key == 'currently-reading': $ og_title = _("Books %(username)s is reading", username=userDisplayName) @@ -68,6 +67,7 @@ $if docs: $ bookshelf_id = {'want-to-read': 1, 'currently-reading': 2, 'already-read': 3}.get(key, None) $ doc_number = 1 + $ shelves = ['want to read', 'currently reading', 'already read'] $# enumerate because using zip() will result in empty iterator when no ratings are passed, and ratings are only used on already-read. $for idx, doc in enumerate(docs): $if doc.get('work', {}): diff --git a/openlibrary/templates/lists/list_overview.html b/openlibrary/templates/lists/list_overview.html index b76be6d1d34..5756dd3c4b5 100644 --- a/openlibrary/templates/lists/list_overview.html +++ b/openlibrary/templates/lists/list_overview.html @@ -23,6 +23,11 @@ [X] $if has_owner: - $:_('from You', link=link) + + $if is_owner: + $:_('from You', link=list.owner.key) + $else: + $:_('from %(name)s', link=list.owner.key, name=websafe(list.owner.displayname)) +