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

Fix all i18n issues detected by new script #9499

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,449 changes: 1,304 additions & 145 deletions openlibrary/i18n/messages.pot

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions openlibrary/macros/DisplayCode.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<tr>
<td>
<pre>\
$for i in range(n): <span rel="#L$(i+1)">$("%4d" % (i+1))</span>
$for i in range(n): <span rel="#L$(i+1)">$(("%4d" % (i+1)))</span>
</pre>
</td>
<td style="width:100%;"><pre>$text</pre></td>
Expand All @@ -20,7 +20,7 @@
</table>

<div class="contenttext">
<div class="red" style="background-color: white; padding: 20px;">Templates in the website are disabled now. Editing them will not have any effect on the live website.</div>
<div class="red" style="background-color: white; padding: 20px;">$_("Templates in the website are disabled now. Editing them will not have any effect on the live website.")</div>

$:splitlines(code)
</div>
4 changes: 2 additions & 2 deletions openlibrary/macros/FulltextSnippet.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</section>

$if availability.get('status') == 'open':
<p class="center"><a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">See All Results</a></p>
<p class="center"><a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">$_("See All Results")</a></p>

$if availability.get('status') == 'borrow_available':
<p class="center">Borrow &amp; <a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">See All Results</a></p>
<p class="center">$_("Borrow") &amp; <a href="https://archive.org/stream/$(ia)?ref=ol&access=1#search/$(q)">$_("See All Results")</a></p>
1 change: 1 addition & 0 deletions openlibrary/macros/IABook.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h3 itemprop="name" class="booktitle">
</h3>
</div>
</div>
$# detect-missing-i18n-skip-line
$# The following (empty) <div> is to aid in formatting the layout.
rebecca-shoptaw marked this conversation as resolved.
Show resolved Hide resolved
<div class="searchResultItemCTA">
</div>
Expand Down
6 changes: 3 additions & 3 deletions openlibrary/macros/ManageLoansButtons.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$def with (loan, book)

<div data-userid="$(loan['userid'])">
Borrowed $datestr(datetime_from_utc_timestamp(loan['loaned_at']))
$_('Borrowed %(date)s', date=datestr(datetime_from_utc_timestamp(loan['loaned_at'])))
</div>
$ wlsize = book.get_waitinglist_size()
$if wlsize:
Expand All @@ -12,8 +12,8 @@
<div>
$if loan['expiry'] is None:
$# Not yet fulfilled
<span class="red">Not yet downloaded. </span><br/>
<a href="$loan['loan_link']">Download Now</a>
<span class="red">$_("Not yet downloaded.") </span><br/>
<a href="$loan['loan_link']">$_("Download Now")</a>
$else:
$:macros.FormatExpiry(loan['expiry'])
</div>
Expand Down
10 changes: 5 additions & 5 deletions openlibrary/macros/ManageWaitlistButton.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
$ delta_hours = book.waitinglist_record.get_expiry_in_hours()
<div class="smaller" style="padding-top: 5px;">
$if delta_hours == 0:
You have less than an hour to borrow it.
$_("You have less than an hour to borrow it.")
$elif delta_hours == 1:
You have one more hour to borrow it.
$_("You have one more hour to borrow it.")
$else:
You have $delta_hours more hours to borrow it.
$_('You have %(count)d more hours to borrow it.', count=delta_hours)
</div>
</div>

<div class="actions">
$if status == "available":
<form action="$book.url('/borrow')" method="post">
<input type="hidden" name="action" value="borrow" />
<input type="submit" value="Borrow Now" />
<input type="submit" value="$_('Borrow Now')" />
</form>
<form action="$book.url('/borrow?redirect=/account/loans')" method="POST" class="wlform">
<input type="hidden" name="action" value="leave-waitinglist"/>
<a href="javascript:;" class="leave">Leave the waiting list?</a>
<a href="javascript:;" class="leave">$_("Leave the waiting list?")</a>
</form>
</div>
8 changes: 4 additions & 4 deletions openlibrary/macros/Profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<table>
<thead>
<tr>
<th>Component</th>
<th>Time</th>
<th>$_("Component")</th>
<th>$_("Time")</th>
<th>%</th>
</tr>
</thead>
<tbody>
$for component in sorted(component_times.items(), key=lambda x: x[1]):
<tr>
<td>$component[0]</td>
<td>$("%.2f" % component[1])</td>
<td>$("%.2f" % (component[1] / component_times['TotalTime'] * 100.))</td>
<td>$(("%.2f" % component[1]))</td>
<td>$(("%.2f" % (component[1] / component_times['TotalTime'] * 100.)))</td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion openlibrary/macros/QueryCarousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<input type="hidden" name="q" value="$query"/>
$if has_fulltext_only:
<input type="hidden" name="has_fulltext" value="true"/>
<input type="text" placeholder="Search collection" name="q2"/>
<input type="text" placeholder="$_('Search collection')" name="q2"/>
<input type="submit"/>
</form>

Expand Down
2 changes: 1 addition & 1 deletion openlibrary/macros/RecentChangesAdmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</tr>
$else:
<tr>
<td colspan="4" class="comment"><em>No edit history available.</em></td>
<td colspan="4" class="comment"><em>$_("No edit history available.")</em></td>
</tr>
</tbody>

Expand Down
2 changes: 1 addition & 1 deletion openlibrary/macros/RecentChangesUsers.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$ show_users = (query_param('show_users', 'false').lower() == 'true')

$if len(changes) > 1:
<h2>Recent Activity</h2>
<h2>$_("Recent Activity")</h2>
<table class="changeHistory" style="width:100%;">
<thead>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions openlibrary/macros/SearchResults.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</span>
</span>
$if fulltext:
<span class="small sansserif">Pages:
$if len(pages)==0: <i>Unknown</i>
<span class="small sansserif">$_("Pages:")
$if len(pages)==0: <i>$_("Unknown")</i>
$ a = []
$for pn, pg in pages:
$ a.append('<a href="//archive.org/stream/%s#page/n%s/mode/1up">%s</a>'% (book.ocaid, pn-1, pg))
Expand All @@ -48,7 +48,7 @@
<span class="actions">
<a href="//archive.org/stream/$book.ocaid">
<span class="image read"></span>
<span class="label">Read</span>
<span class="label">$_("Read")</span>
</a>
</span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/macros/TableOfContents.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
$if label and not label.endswith('.'):
$ label = label.strip() + '. '
$if highlighting:
$# This isn't html injection, because solr returns everything
$# already html escaped except for the <em> of the highlight
$# detect-missing-i18n-skip-line
$# This isn't html injection, because solr returns everything already html escaped except for the <em> of the highlight
$:label
$:chapter.title
$else:
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/macros/WorkInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
$if this_lang:
<span class="tag">$this_lang.lang: <a href="$this_lang.url">$(this_lang.title or this_lang.url)</a></span>
$else:
<span class="tag">No link to Wikipedia in your language</span>
<span class="tag">$_("No link to Wikipedia in your language")</span>
$if simple:
<span class="tag">
Simple English: <a href="$simple.url">$(simple.title or simple.url)</a>
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/macros/WorldcatLink.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p class="cta-section-title world-cat-link">$_("Check nearby libraries")</p>
<ul class="book-locate-options">
$if isbn:
<li><a href="https://labs.library.link/services/borrow/?isbn=$isbn&embed=True&radius=500&refer=$(referer)">Library.link</a></li>
<li><a class="worldcat-link" data-ol-link-track="worldcat-search" href="$macros.WorldcatUrl(isbn=isbn, oclc_numbers=oclc_numbers)" title="$_('Check WorldCat for an edition near you')">WorldCat</a></li>
<li><a href="https://labs.library.link/services/borrow/?isbn=$isbn&embed=True&radius=500&refer=$(referer)">$('Library.link')</a></li>
<li><a class="worldcat-link" data-ol-link-track="worldcat-search" href="$macros.WorldcatUrl(isbn=isbn, oclc_numbers=oclc_numbers)" title="$_('Check WorldCat for an edition near you')">$_("WorldCat")</a></li>
</ul>
</div>
4 changes: 2 additions & 2 deletions openlibrary/macros/databarWork.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
$if page.volumes:
<h3 class="header">
<span class="icon read"></span>
<span class="head">Browse</span>
<span class="head">$_("Browse")</span>
</h3>
$for v in page.volumes:
$if v.ia_id != "-":
<div class="panel">
<p><a href="$viewbook.replace('XXX', v.ia_id)">View Volume $v.volume_number</a></p>
<p><a href="$viewbook.replace('XXX', v.ia_id)">$_('View Volume %(num)d', num=v.volume_number)</a></p>
</div>

<div class="panel">
Expand Down
38 changes: 14 additions & 24 deletions openlibrary/templates/about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,26 @@
$ _x = ctx.setdefault('cssfile', 'team')

<div class="teamPage__top">
<h1 class="teamPageroledescription__role">The Open Library Team</h1>
<p class="teamPageTagLine">
Open Library is made possible because of a dedicated team of staff and
over 100 volunteers from around the globe.
<a href="https://openlibrary.org/volunteer"> Want to join us?</a>
</p>
<h1 class="teamPageroledescription__role">$_("The Open Library Team")</h1>
<p class="teamPageTagLine">$_("Open Library is made possible because of a dedicated team of staff and over 100 volunteers from around the globe.") <a href="https://openlibrary.org/volunteer">$_("Want to join us?")</a></p>
<div class="teamPage__selectElements">
<div class="selectElement">
<label for="roles">Role:</label>
<label for="roles">$_("Role:")</label>
<select name="roles" id="role">
<option value="All" selected>All</option>
<option value="staff">Staff</option>
<option value="fellow">Fellows</option>
<option value="volunteer">Volunteers</option>
<option value="All" selected>$_("All")</option>
<option value="staff">$_("Staff")</option>
<option value="fellow">$_("Fellows")</option>
<option value="volunteer">$_("Volunteers")</option>
</select>
</div>
<div>
<label for="departments">Department:</label>
<label for="departments">$_("Department:")</label>
<select name="departments" id="department">
<option value="All" selected>All</option>
<option value="communication">Communications</option>
<option value="design">Design</option>
<option value="engineer">Engineering</option>
<option value="librarian">Librarianship</option>
<option value="All" selected>$_("All")</option>
<option value="communication">$_("Communications")</option>
<option value="design">$_("Design")</option>
<option value="engineer">$_("Engineering")</option>
<option value="librarian">$_("Librarianship")</option>
</select>
</div>
</div>
Expand All @@ -34,11 +30,5 @@ <h1 class="teamPageroledescription__role">The Open Library Team</h1>
<div class="teamCards_container"></div>

<div class="teamPage__bottom">
<p class="teamPageTagLine">
If you volunteer with Open Library and would like to be listed as part
of the team, then complete the
<a href="https://forms.gle/zPyuXGf4Bg6RzbDA7"
>Open Library team information form</a
>.
</p>
<p class="teamPageTagLine">$:_('If you volunteer with Open Library and would like to be listed as part of the team, then complete the <a href="https://forms.gle/zPyuXGf4Bg6RzbDA7">Open Library team information form</a>.')</p>
</div>
16 changes: 8 additions & 8 deletions openlibrary/templates/account/email/forgot.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

<div id="contentHead">
<h2>$_('Forgot Your Internet Archive Email?')</h2>
<p class="instruct">To lookup your Archive.org email, <a href="/account/email/forgot-ia">click here</a>.</p>
<p class="instruct">$:_('To look up your Archive.org email, <a href="/account/email/forgot-ia">click here</a>.')</p>

<hr class="forgot-padding"/>

<h2>$_('Forgot Your Open Library Email?')</h2>
$if not email:
<p class="instruct">Please enter your Open Library username and password, and we’ll retrieve your email.</p>
<p class="instruct">$_("Please enter your Open Library username and password, and we’ll retrieve your email.")</p>
</div>

<div id="contentBody" class="defaultstyling">
$if email:
<p>Your email is: <strong>$email</strong></p>
<p><a href="/account/login">&larr; Return to Log In?</a></p>
<p>$_("Your email is:") <strong>$email</strong></p>
<p><a href="/account/login">&larr; $_("Return to Log In?")</a></p>

$else:
$if err:
Expand All @@ -25,13 +25,13 @@ <h2>$_('Forgot Your Open Library Email?')</h2>
<form class="forgot-email-form" action="/account/email/forgot" method="POST">
<div class="form-row">
<div>
<label>Open Library Username</label>
<label>$_("Open Library Username")</label>
</div>
<input type="text" name="username"/>
</div>
<div class="form-row">
<div>
<label>Password</label>
<label>$_("Password")</label>
</div>
<input type="password" name="password"/>
</div>
Expand All @@ -45,7 +45,7 @@ <h2>$_('Forgot Your Open Library Email?')</h2>
</div>
</div>
<hr/>
<h3>Need help updating your account email address?</h3>
<p>First login with your current email address and then follow <a href="https://openlibrary.org/help/faq/my_account#update-email">these instructions</a> to change it to something new.</p>
<h3>$_("Need help updating your account email address?")</h3>
<p>$:_('First login with your current email address and then follow <a href="https://openlibrary.org/help/faq/my_account#update-email">these instructions</a> to change it to something new.')</p>
</form>
</div>
12 changes: 6 additions & 6 deletions openlibrary/templates/account/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="import-export">
<div class="import-export__section">
<h3>$_("Import from Goodreads")</h3>
<p>For instructions on exporting data refer to: <a href="https://www.goodreads.com/review/import">Goodreads Import/Export</a></p>
<p>$:_('For instructions on exporting data refer to: <a href="https://www.goodreads.com/review/import">Goodreads Import/Export</a>')</p>
<form method="POST" action="/account/import/goodreads"
enctype="multipart/form-data" class="olform olform--decoration">
<div>
Expand Down Expand Up @@ -79,7 +79,7 @@ <h3>$_("Export your star ratings")</h3>
$else:
<div class="import-buttons">
<div id="myProgress" class="hidden">
<div id="myBar">Importing...</div>
<div id="myBar">$_("Importing...")</div>
</div>
<div>
<button class="hidden cta-btn cta-btn--available cta-btn--small cancel-button"
Expand All @@ -99,10 +99,10 @@ <h3>$_("Export your star ratings")</h3>
$for key in keys:
<th scope="col">$key</th>
<th scope="col" class="import-status hidden">
Status
$_("Status")
</th>
<th scope="col" class="status-reason hidden">
Reason
$_("Reason")
</th>
</tr>
</thead>
Expand All @@ -128,8 +128,8 @@ <h3>$_("Export your star ratings")</h3>
$if books_wo_isbns[id].get(key) != '=""':
$books_wo_isbns[id].get(key)
</td>
<td class="books-wo-isbn hidden error-imported">Error</td>
<td class="books-wo-isbn hidden error-imported">No ISBN</td>
<td class="books-wo-isbn hidden error-imported">$_("Error")</td>
<td class="books-wo-isbn hidden error-imported">$_("No ISBN")</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/templates/account/readinglog_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<li>
<a href="$work.key" style="font-style: oblique">$full_title</a>
$ first_publish_year = work.first_publish_year or '????'
<span title="First published in $first_publish_year">($first_publish_year)</span>
<span title="$_('First published in %(year)s', year=first_publish_year)">($first_publish_year)</span>
by
$for author in work.authors:
<a href="$author.key">$author.name</a>$cond(not loop.last, ', ', '')
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/templates/admin/attach_debugger.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<div id="contentHead">
$:render_template("admin/menu")
<h1>Attach Debugger on Python $python_version</h1>
<h1>$_('Attach Debugger on Python %(version_number)d', version_number=python_version)</h1>
</div>

<div id="contentBody">
<div>
Start a debugger on port 3000.<br/>
$_("Start a debugger on port 3000.")<br/>
</div>

<form method="POST" class="olform">
Expand Down
6 changes: 3 additions & 3 deletions openlibrary/templates/admin/block.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

<div id="contentHead">
$:render_template("admin/menu")
<h1>Block IP address</h1>
<h1>$_("Block IP address")</h1>
</div>

<div id="contentBody">
$if query_param("ip") != None:
<div>IP address $query_param("ip") has been added to the textarea. Please click Save to block that IP.
<div>$_('IP address %(address)s has been added to the textarea. Please click Save to block that IP.', address=query_param("ip"))
<br/>
<br/>
</div>
Expand All @@ -26,7 +26,7 @@ <h1>Block IP address</h1>
$:query_param("ip")
</textarea>
</div>
<input type="submit" name="_submit" value="Save"/>
<input type="submit" name="_submit" value="$_('Save')"/>
</form>


Expand Down
Loading
Loading