Internationalization of download options

This commit is contained in:
Veloman Yunkan 2022-11-26 14:19:12 +04:00
parent 2825c4c63d
commit 0581da44fe
5 changed files with 42 additions and 15 deletions

View File

@ -34,4 +34,13 @@
, "book-filtering-all-categories": "All categories"
, "book-filtering-all-languages": "All languages"
, "count-of-matching-books": "{{COUNT}} book(s)"
, "download": "Download"
, "direct-download-link-text": "Direct"
, "direct-download-alt-text": "direct download"
, "hash-download-link-text": "Sha256 hash"
, "hash-download-alt-text": "download hash"
, "magnet-link-text": "Magnet link"
, "magnet-alt-text": "download magnet"
, "torrent-download-link-text": "Torrent file"
, "torrent-download-alt-text": "download torrent"
}

View File

@ -36,4 +36,13 @@
, "book-filtering-all-categories": "Choosing this filter will disable filtering of books by category"
, "book-filtering-all-languages": "Choosing this filter will disable filtering of books by language"
, "count-of-matching-books": "Reporting the count of books matching the filter"
, "download": "A general download action"
, "direct-download-link-text": "Link text for a direct download"
, "direct-download-alt-text": "Hint for a direct download icon"
, "hash-download-link-text": "Link text for downloading the hash"
, "hash-download-alt-text": "Hint for the icon of hash download"
, "magnet-link-text": "Link text for a magnet link"
, "magnet-alt-text": "Hint for the icon of a magnet link"
, "torrent-download-link-text": "Link text for downloading the torrent file"
, "torrent-download-alt-text": "Hint for the icon of torrent download"
}

View File

@ -23,4 +23,13 @@
, "book-filtering-all-categories": "All [I18N TESTING] categories"
, "book-filtering-all-languages": "All [I18N TESTING] languages"
, "count-of-matching-books": "[I18N TESTING] Number of matching books: {{COUNT}}"
, "download": "[I18N Download TESTING]"
, "direct-download-link-text": "[I18N TESTING] HTTP(S)"
, "direct-download-alt-text": "[I18N TESTING] download directly"
, "hash-download-link-text": "Sha256 [I18N TESTING] hash"
, "hash-download-alt-text": "download [I18N TESTING] hash"
, "magnet-link-text": "Magnet [I18N TESTING] link"
, "magnet-alt-text": "download [I18N TESTING] magnet"
, "torrent-download-link-text": "Torrent [I18N TESTING] file"
, "torrent-download-alt-text": "download [I18N TESTING] torrent"
}

View File

@ -143,7 +143,7 @@
<div class="book__icon" ${faviconAttr}></div>
<div class="book__header">
<div id="book__title">${title}</div>
${downloadLink ? `<div class="book__download"><span data-link="${downloadLink}">Download ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}</span></div>`: ''}` : ''}
${downloadLink ? `<div class="book__download"><span data-link="${downloadLink}">${$t("download")} ${humanFriendlyZimSize ? ` - ${humanFriendlyZimSize}</span></div>`: ''}` : ''}
</div>
<div class="book__description" title="${description}">${description}</div>
</div>
@ -209,27 +209,27 @@
<div class="modal-content">
<div class="modal-regular-download">
<a href="${downloadLink}" download>
<img src="${root}/skin/download.png?KIWIXCACHEID" alt="direct download" />
<div>Direct</div>
<img src="${root}/skin/download.png?KIWIXCACHEID" alt="${$t("direct-download-alt-text")}" />
<div>${$t("direct-download-link-text")}</div>
</a>
</div>
<div class="modal-regular-download">
<a href="${downloadLink}.sha256" download>
<img src="${root}/skin/hash.png?KIWIXCACHEID" alt="download hash" />
<div>Sha256 hash</div>
<img src="${root}/skin/hash.png?KIWIXCACHEID" alt="${$t("hash-download-alt-text")}" />
<div>${$t("hash-download-link-text")}</div>
</a>
</div>
${magnetLink ?
`<div class="modal-regular-download">
<a href="${magnetLink}" target="_blank">
<img src="${root}/skin/magnet.png?KIWIXCACHEID" alt="download magnet" />
<div>Magnet link</div>
<img src="${root}/skin/magnet.png?KIWIXCACHEID" alt="${$t("magnet-alt-text")}" />
<div>${$t("magnet-link-text")}</div>
</a>
</div>` : ``}
<div class="modal-regular-download">
<a href="${downloadLink}.torrent" download>
<img src="${root}/skin/bittorrent.png?KIWIXCACHEID" alt="download torrent" />
<div>Torrent file</div>
<img src="${root}/skin/bittorrent.png?KIWIXCACHEID" alt="${$t("torrent-download-alt-text")}" />
<div>${$t("torrent-download-link-text")}</div>
</a>
</div>
</div>

View File

@ -63,7 +63,7 @@ const ResourceCollection resources200Compressible{
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" },
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=316dbc21" },
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" },
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=a1d9a5d5" },
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=1f5f1cce" },
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" },
{ STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" },
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" },
@ -283,7 +283,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=316dbc21"
<script type="module" src="/ROOT%23%3F/skin/i18n.js?cacheid=6da2bca0" defer></script>
<script src="/ROOT%23%3F/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
<script src="/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
<script type="text/javascript" src="/ROOT%23%3F/skin/index.js?cacheid=a1d9a5d5" defer></script>
<script type="text/javascript" src="/ROOT%23%3F/skin/index.js?cacheid=1f5f1cce" defer></script>
<img src="/ROOT%23%3F/skin/feed.png?cacheid=56a672b1" class="feedLogo" alt="Library OPDS Feed" aria-label="Library OPDS Feed" title="Library OPDS Feed">
)EXPECTEDRESULT"
},
@ -294,10 +294,10 @@ R"EXPECTEDRESULT( background-image: url('../skin/search-icon.svg?cacheid=b10a
},
{
/* url */ "/ROOT%23%3F/skin/index.js",
R"EXPECTEDRESULT( <img src="${root}/skin/download.png?cacheid=a39aa502" alt="direct download" />
<img src="${root}/skin/hash.png?cacheid=f836e872" alt="download hash" />
<img src="${root}/skin/magnet.png?cacheid=73b6bddf" alt="download magnet" />
<img src="${root}/skin/bittorrent.png?cacheid=4f5c6882" alt="download torrent" />
R"EXPECTEDRESULT( <img src="${root}/skin/download.png?cacheid=a39aa502" alt="${$t("direct-download-alt-text")}" />
<img src="${root}/skin/hash.png?cacheid=f836e872" alt="${$t("hash-download-alt-text")}" />
<img src="${root}/skin/magnet.png?cacheid=73b6bddf" alt="${$t("magnet-alt-text")}" />
<img src="${root}/skin/bittorrent.png?cacheid=4f5c6882" alt="${$t("torrent-download-alt-text")}" />
)EXPECTEDRESULT"
},
{