Skip to content

Commit e89d02b

Browse files
authored
Merge branch 'internetarchive:master' into fix/covers-webp
2 parents bf15fff + 6d2c117 commit e89d02b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+224
-198
lines changed

openlibrary/i18n/cs/messages.po

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ msgstr ""
319319

320320
#: borrow.html:264
321321
msgid "Internet Archive"
322-
msgstr ""
322+
msgstr "Internetový Archiv"
323323

324324
#: borrow.html:266
325325
msgid "eBooks everywhere"
326-
msgstr ""
326+
msgstr "eKnihy kdekoliv"
327327

328328
#: borrow.html:268
329329
msgid ""
@@ -334,7 +334,7 @@ msgstr ""
334334

335335
#: borrow.html:274
336336
msgid "physical books from your local library"
337-
msgstr ""
337+
msgstr "fyzické knížky z Vaší místní knihovny"
338338

339339
#: borrow.html:276
340340
msgid ""
@@ -352,6 +352,8 @@ msgid ""
352352
"All you need to borrow a book scanned at the Internet Archive is an Open "
353353
"Library account and Adobe Digital Editions."
354354
msgstr ""
355+
"Vše, co potřebujete pro vypůjčení knihy naskenované v Internet Archive je"
356+
"účet u Open Library a Adobe Digital Editions.
355357
356358
#: borrow.html:283
357359
msgid ""
@@ -364,6 +366,8 @@ msgid ""
364366
"Check out the <a href=\"/help/faq#section-borrowing\"><strong>Lending "
365367
"FAQ</strong></a> for more information."
366368
msgstr ""
369+
"Podívejte se <a href=\"/help/faq#section-borrowing\"><strong>Výpujčky "
370+
"FAQ</strong></a> pro více informací.
367371
368372
#: borrow.html:288
369373
#, python-format
@@ -1986,7 +1990,7 @@ msgstr "Novější"
19861990

19871991
#: default/message.html:25 edit-book/message.html:25
19881992
msgid "opened a new Open Library account!"
1989-
msgstr ""
1993+
msgstr "vytvořil nový Open Library účet!"
19901994

19911995
#: merge-authors/message.html:9
19921996
#, python-format
@@ -2069,7 +2073,7 @@ msgstr "Zobrazit nebo upravit váše seznamy"
20692073

20702074
#: openlibrary/templates/account.html:20
20712075
msgid "Please contact us if you need help with anything else."
2072-
msgstr ""
2076+
msgstr "Kontaktujte nás prosím, pokud potřebujete pomoc s něčím dalším."
20732077

20742078
#: openlibrary/templates/diff.html:3
20752079
#, python-format

openlibrary/i18n/messages.pot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,10 @@ msgstr ""
10661066
msgid "Buy this book"
10671067
msgstr ""
10681068

1069+
#: openlibrary/plugins/openlibrary/code.py
1070+
msgid "Arabic"
1071+
msgstr ""
1072+
10691073
#: openlibrary/plugins/openlibrary/code.py
10701074
msgid "Czech"
10711075
msgstr ""

openlibrary/plugins/openlibrary/code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ def setup_template_globals():
12731273

12741274
def get_supported_languages():
12751275
return {
1276+
"ar": {"code": "ar", "localized": _('Arabic'), "native": "العربية"},
12761277
"cs": {"code": "cs", "localized": _('Czech'), "native": "Čeština"},
12771278
"de": {"code": "de", "localized": _('German'), "native": "Deutsch"},
12781279
"en": {"code": "en", "localized": _('English'), "native": "English"},

openlibrary/plugins/openlibrary/js/book-page-lists.js

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { buildPartialsUrl } from './utils'
2-
import { PersistentToast } from './Toast'
2+
import { initAsyncFollowing } from './following'
3+
34
/**
45
* Initializes lazy-loading the "Lists" section of Open Library book pages.
56
*
@@ -84,42 +85,3 @@ async function fetchPartials(workId, editionId) {
8485

8586
return fetch(buildPartialsUrl('BPListsSection', params));
8687
}
87-
88-
async function initAsyncFollowing(followForms) {
89-
followForms.forEach(form => {
90-
form.addEventListener('submit', async e => {
91-
e.preventDefault();
92-
const url = form.action;
93-
const formData = new FormData(form);
94-
const submitButton = form.querySelector('button[type=submit]')
95-
const stateInput = form.querySelector('input[name=state]')
96-
97-
const isFollowRequest = stateInput.value === '0'
98-
const i18nStrings = JSON.parse(submitButton.dataset.i18n)
99-
submitButton.disabled = true
100-
101-
await fetch(url, {
102-
method: 'POST',
103-
headers: {
104-
'Content-Type': 'application/x-www-form-urlencoded',
105-
},
106-
body: new URLSearchParams(formData)
107-
})
108-
.then(resp => {
109-
if (!resp.ok) {
110-
throw new Error('Network response was not ok');
111-
}
112-
submitButton.classList.toggle('cta-btn--primary')
113-
submitButton.classList.toggle('cta-btn--delete')
114-
submitButton.textContent = isFollowRequest ? i18nStrings.unfollow : i18nStrings.follow
115-
stateInput.value = isFollowRequest ? '1' : '0'
116-
})
117-
.catch(() => {
118-
new PersistentToast(i18nStrings.errorMsg).show();
119-
})
120-
.finally(() => {
121-
submitButton.disabled = false
122-
});
123-
});
124-
});
125-
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { PersistentToast } from './Toast';
2+
3+
export async function initAsyncFollowing(followForms) {
4+
followForms.forEach(form => {
5+
form.addEventListener('submit', async (e) => {
6+
e.preventDefault();
7+
const url = form.action;
8+
const formData = new FormData(form);
9+
const submitButton = form.querySelector('button[type=submit]');
10+
const stateInput = form.querySelector('input[name=state]');
11+
12+
const isFollowRequest = stateInput.value === '0';
13+
const i18nStrings = JSON.parse(submitButton.dataset.i18n);
14+
submitButton.disabled = true;
15+
16+
await fetch(url, {
17+
method: 'POST',
18+
headers: {
19+
'Content-Type': 'application/x-www-form-urlencoded',
20+
},
21+
body: new URLSearchParams(formData)
22+
})
23+
.then(resp => {
24+
if (!resp.ok) {
25+
throw new Error('Network response was not ok');
26+
}
27+
submitButton.classList.toggle('cta-btn--primary');
28+
submitButton.classList.toggle('cta-btn--delete');
29+
submitButton.textContent = isFollowRequest ? i18nStrings.unfollow : i18nStrings.follow;
30+
stateInput.value = isFollowRequest ? '1' : '0';
31+
})
32+
.catch(() => {
33+
new PersistentToast(i18nStrings.errorMsg).show();
34+
})
35+
.finally(() => {
36+
submitButton.disabled = false;
37+
});
38+
});
39+
});
40+
}

openlibrary/plugins/openlibrary/js/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,13 @@ jQuery(function () {
549549
.then(module => module.initListsSection(listSection))
550550
}
551551

552+
// Initialize follow forms lazily
553+
const followForms = document.querySelectorAll('.follow-form');
554+
if (followForms.length) {
555+
import(/* webpackChunkName: "following" */ './following')
556+
.then(module => module.initAsyncFollowing(followForms))
557+
}
558+
552559
// Generalized carousel lazy-loading
553560
const lazyCarousels = document.querySelectorAll('.lazy-carousel')
554561
if (lazyCarousels.length) {

openlibrary/templates/account/reading_log.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@
9797
<p>$_("You haven't added any books to this shelf yet.")</p>
9898
<p>$:_('<a href="/search">Search for a book</a> to add to your reading log. <a href="/help/faq/reading-log">Learn more</a> about the reading log.')</p>
9999
$elif key == 'feed':
100-
<p>$_("There are no recent books in your feed. When you follow public accounts, their book updates will appear here.")</p>
100+
<p>$_("There are no recent books in your feed. When you follow public accounts, their book updates will appear here.")</p>
101101
</ul>
102102
</div>

static/css/base/common.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ body {
3939
font-size: 100%;
4040
line-height: normal;
4141
background-color: @beige;
42-
font-family: @lucida_sans_serif-1;
42+
font-family: @body-family;
4343
}
4444
fieldset {
4545
width: 100%;
@@ -78,7 +78,7 @@ h3,
7878
h4,
7979
h5,
8080
h6 {
81-
font-family: @lucida_sans_serif-1;
81+
font-family: @body-family;
8282
color: @grey;
8383
font-weight: 600;
8484
}

static/css/base/headings.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ h1,
5959
h2 {
6060
&.edition {
6161
color: @black;
62-
font-family: @lucida_sans_serif-2;
62+
font-family: @body-family;
6363
font-size: 1.125em;
6464
margin: 0;
6565
padding: 0;
@@ -84,19 +84,19 @@ h4 {
8484
font-size: 0.8125em;
8585
&.publisher,
8686
&.observer-count {
87-
font-family: @lucida_sans_serif-1;
87+
font-family: @body-family;
8888
font-weight: normal;
8989
}
9090
&.facetHead {
91-
font-family: @lucida_sans_serif-1;
91+
font-family: @body-family;
9292
font-size: 0.6875em;
9393
font-weight: 700;
9494
color: @black;
9595
text-transform: uppercase;
9696
margin: 0 0 5px;
9797
padding: 0;
9898
span.merge {
99-
font-family: @lucida_sans_serif-3;
99+
font-family: @body-family;
100100
font-size: @font-size-label-small;
101101
font-weight: normal !important;
102102
text-transform: none !important;
@@ -149,14 +149,14 @@ span.title,
149149
h6.title {
150150
font-size: @font-size-label-medium;
151151
font-weight: normal !important;
152-
font-family: @lucida_sans_serif-2;
152+
font-family: @body-family;
153153
color: @grey;
154154
margin: 0;
155155
padding: 0;
156156
}
157157

158158
.titleSmall {
159-
font-family: @lucida_sans_serif-2;
159+
font-family: @body-family;
160160
font-size: @font-size-label-small;
161161
font-weight: 600;
162162
}

static/css/base/helpers-misc.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ button {
194194

195195
.headline,
196196
.sansserif {
197-
font-family: @lucida_sans_serif-1 !important;
197+
font-family: @body-family !important;
198198
}
199199

200200
.arial {
201-
font-family: @arial_sans_serif !important;
201+
font-family: @body-family !important;
202202
}
203203

204204
.nowrap {

0 commit comments

Comments
 (0)