diff --git a/src/server/response.cpp b/src/server/response.cpp index 9ece579e..aa3eadb1 100644 --- a/src/server/response.cpp +++ b/src/server/response.cpp @@ -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)}, }); } diff --git a/static/skin/i18n/en.json b/static/skin/i18n/en.json index cfd71b0e..0212e36c 100644 --- a/static/skin/i18n/en.json +++ b/static/skin/i18n/en.json @@ -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}}" diff --git a/static/skin/i18n/qqq.json b/static/skin/i18n/qqq.json index fdb006cb..e4c480ad 100644 --- a/static/skin/i18n/qqq.json +++ b/static/skin/i18n/qqq.json @@ -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", diff --git a/static/skin/i18n/test.json b/static/skin/i18n/test.json index b2d910f4..98f5a9e8 100644 --- a/static/skin/i18n/test.json +++ b/static/skin/i18n/test.json @@ -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" diff --git a/static/templates/captured_external.html b/static/templates/captured_external.html index f3470840..83a8a231 100644 --- a/static/templates/captured_external.html +++ b/static/templates/captured_external.html @@ -14,19 +14,19 @@
Caution! + alt="{{caution_warning}}" + aria-label="{{caution_warning}}" + title="{{caution_warning}}">

{{external_link_detected}}

-

You are about to leave Kiwix's ZIM reader to go online to

+

{{external_link_intro}}

{{ url }}

-

The link you're trying to access is not part of your offline package and requires an internet connection.

-

If you can go online, you can attempt to open the link.

-

You can otherwise return to your ZIM's offline content by using your browser's back button.

+

{{advice.p1}}

+

{{advice.p2}}

+

{{advice.p3}}

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