Fully translated external link blocker page

This commit is contained in:
Veloman Yunkan 2025-04-09 17:41:17 +04:00
parent 58a211d01d
commit 3cd1f7854a
6 changed files with 26 additions and 8 deletions

View File

@ -418,6 +418,9 @@ BlockExternalLinkResponse::BlockExternalLinkResponse(const RequestContext& reque
{"root", root },
{"external_link_detected", Data::fromMsgId("external-link-detected") },
{"url", externalUrl },
{"caution_warning", Data::fromMsgId("caution-warning") },
{"external_link_intro", Data::fromMsgId("external-link-intro") },
{"advice", Data::staticMultiParagraphText("external-link-advice", 3)},
});
}

View File

@ -33,6 +33,11 @@
, "500-page-heading" : "Internal Server Error"
, "500-page-text": "An internal server error occured. We are sorry about that :/"
, "external-link-detected" : "External Link Detected"
, "caution-warning" : "Caution!"
, "external-link-intro" : "You are about to leave Kiwix's ZIM reader to go online to"
, "external-link-advice.p1": "The link you're trying to access is not part of your offline package and requires an internet connection."
, "external-link-advice.p2": "If you can go online, you can attempt to open the link."
, "external-link-advice.p3": "You can otherwise return to your ZIM's offline content by using your browser's back button."
, "fulltext-search-unavailable" : "Fulltext search unavailable"
, "no-search-results": "The fulltext search engine is not available for this content."
, "search-results-page-title": "Search: {{SEARCH_PATTERN}}"

View File

@ -37,6 +37,11 @@
"500-page-heading": "Heading of the 500 error page",
"500-page-text": "Text of the 500 error page",
"external-link-detected" : "Title & heading of the external link blocker page",
"caution-warning" : "Warning of action that shouldn't be carried out carelessly",
"external-link-intro" : "Message introducing the external link (to be followed by the actual link)",
"external-link-advice.p1": "1st paragraph of the multiline advice on the external link blocker page (see external-link-advice.p1 through external-link-advice.p3 for full text)",
"external-link-advice.p2": "2nd paragraph of the multiline advice on the external link blocker page (see external-link-advice.p1 through external-link-advice.p3 for full text)",
"external-link-advice.p3": "3rd paragraph of the multiline advice on the external link blocker page (see external-link-advice.p1 through external-link-advice.p3 for full text)",
"fulltext-search-unavailable": "Title of the error page returned when search is attempted in a book without fulltext search database",
"no-search-results": "Text of the error page returned when search is attempted in a book without fulltext search database",
"search-results-page-title": "Title of the search results page",

View File

@ -23,6 +23,11 @@
, "404-advice.p4": "[I18N TESTING] Press the dice button"
, "404-advice.p5": "Good luck! [I18N TESTING]"
, "external-link-detected" : "External [I18] Link [TESTING] Detected"
, "caution-warning" : "[I18N] C5n! [TESTING]"
, "external-link-intro" : "[I18N TESTING] The following link may lead you to a place from which you won't ever be able to return"
, "external-link-advice.p1": "[I18N TESTING] The link you're trying to access points past the end of the ZIM file."
, "external-link-advice.p2": "[I18N TESTING] If you are an optimist, you can attempt to open the link."
, "external-link-advice.p3": "[I18N TESTING] But we strongly recommend you to be reasonable and press your browser's back button."
, "library-button-text": "[I18N TESTING] Navigate to the welcome page"
, "home-button-text": "[I18N TESTING] Jump to the main page of '{{BOOK_TITLE}}'"
, "random-page-button-text": "[I18N TESTING] I am tired of determinism"

View File

@ -14,19 +14,19 @@
<body>
<header>
<img src="{{root}}/skin/blocklink.svg?KIWIXCACHEID"
alt="Caution!"
aria-label="Caution!"
title="Caution!">
alt="{{caution_warning}}"
aria-label="{{caution_warning}}"
title="{{caution_warning}}">
</header>
<section class="intro">
<h1>{{external_link_detected}}</h1>
<p>You are about to leave Kiwix's ZIM reader to go online to</p>
<p>{{external_link_intro}}</p>
<p><a href="{{url}}">{{ url }}</a></p>
</section>
<section class="advice">
<p>The link you're trying to access is not part of your offline package and requires an internet connection.</p>
<p>If you can go online, you can attempt to open the link.</p>
<p>You can otherwise return to your ZIM's offline content by using your browser's back button.</p>
<p>{{advice.p1}}</p>
<p>{{advice.p2}}</p>
<p>{{advice.p3}}</p>
</section>
</body>
</html>

View File

@ -356,7 +356,7 @@ R"EXPECTEDRESULT( <link type="text/css" href="/ROOT%23%3F/skin/error.css?cach
/* url */ "/ROOT%23%3F/catch/external?source=https%3A%2F%2Fkiwix.org",
R"EXPECTEDRESULT( <link type="text/css" href="/ROOT%23%3F/skin/error.css?cacheid=b3fa90cf" rel="Stylesheet" />
<script type="module" src="/ROOT%23%3F/skin/i18n.js?cacheid=e9a10ac1"></script>
window.KIWIX_RESPONSE_TEMPLATE = "&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n &lt;title&gt;{{external_link_detected}}&lt;/title&gt;\n &lt;link type=&quot;text/css&quot; href=&quot;{{root}}/skin/error.css?cacheid=b3fa90cf&quot; rel=&quot;Stylesheet&quot; /&gt;\n &lt;script type=&quot;module&quot; src=&quot;{{root}}/skin/i18n.js?cacheid=e9a10ac1&quot;&gt;&lt;/script&gt;\n &lt;script&gt;\n window.KIWIX_RESPONSE_TEMPLATE = &quot;{{KIWIX_RESPONSE_TEMPLATE}}&quot;;\n window.KIWIX_RESPONSE_DATA = {{{KIWIX_RESPONSE_DATA}}};\n &lt;/script&gt;\n &lt;/head&gt;\n &lt;body&gt;\n &lt;header&gt;\n &lt;img src=&quot;{{root}}/skin/blocklink.svg?cacheid=bd56b116&quot;\n alt=&quot;Caution!&quot;\n aria-label=&quot;Caution!&quot;\n title=&quot;Caution!&quot;&gt;\n &lt;/header&gt;\n &lt;section class=&quot;intro&quot;&gt;\n &lt;h1&gt;{{external_link_detected}}&lt;/h1&gt;\n &lt;p&gt;You are about to leave Kiwix&apos;s ZIM reader to go online to&lt;/p&gt;\n &lt;p&gt;&lt;a href=&quot;{{url}}&quot;&gt;{{ url }}&lt;/a&gt;&lt;/p&gt;\n &lt;/section&gt;\n &lt;section class=&quot;advice&quot;&gt;\n &lt;p&gt;The link you&apos;re trying to access is not part of your offline package and requires an internet connection.&lt;/p&gt;\n &lt;p&gt;If you can go online, you can attempt to open the link.&lt;/p&gt;\n &lt;p&gt;You can otherwise return to your ZIM&apos;s offline content by using your browser&apos;s back button.&lt;/p&gt;\n &lt;/section&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n";
window.KIWIX_RESPONSE_TEMPLATE = "&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n &lt;head&gt;\n &lt;meta charset=&quot;utf-8&quot;&gt;\n &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n &lt;title&gt;{{external_link_detected}}&lt;/title&gt;\n &lt;link type=&quot;text/css&quot; href=&quot;{{root}}/skin/error.css?cacheid=b3fa90cf&quot; rel=&quot;Stylesheet&quot; /&gt;\n &lt;script type=&quot;module&quot; src=&quot;{{root}}/skin/i18n.js?cacheid=e9a10ac1&quot;&gt;&lt;/script&gt;\n &lt;script&gt;\n window.KIWIX_RESPONSE_TEMPLATE = &quot;{{KIWIX_RESPONSE_TEMPLATE}}&quot;;\n window.KIWIX_RESPONSE_DATA = {{{KIWIX_RESPONSE_DATA}}};\n &lt;/script&gt;\n &lt;/head&gt;\n &lt;body&gt;\n &lt;header&gt;\n &lt;img src=&quot;{{root}}/skin/blocklink.svg?cacheid=bd56b116&quot;\n alt=&quot;{{caution_warning}}&quot;\n aria-label=&quot;{{caution_warning}}&quot;\n title=&quot;{{caution_warning}}&quot;&gt;\n &lt;/header&gt;\n &lt;section class=&quot;intro&quot;&gt;\n &lt;h1&gt;{{external_link_detected}}&lt;/h1&gt;\n &lt;p&gt;{{external_link_intro}}&lt;/p&gt;\n &lt;p&gt;&lt;a href=&quot;{{url}}&quot;&gt;{{ url }}&lt;/a&gt;&lt;/p&gt;\n &lt;/section&gt;\n &lt;section class=&quot;advice&quot;&gt;\n &lt;p&gt;{{advice.p1}}&lt;/p&gt;\n &lt;p&gt;{{advice.p2}}&lt;/p&gt;\n &lt;p&gt;{{advice.p3}}&lt;/p&gt;\n &lt;/section&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n";
<img src="/ROOT%23%3F/skin/blocklink.svg?cacheid=bd56b116"
)EXPECTEDRESULT"
},