Procházet zdrojové kódy

Use native i18n link support; some other cleanup

pull/71/head
Ben Kurtovic před 2 měsíci
rodič
revize
1051537c58
12 změnil soubory, kde provedl 80 přidání a 100 odebrání
  1. +19
    -26
      i18n/en.json
  2. +10
    -17
      i18n/qqq.json
  3. +1
    -1
      src/copyvios/settings.py
  4. +0
    -1
      src/copyvios/static/css/style.css
  5. +1
    -1
      src/copyvios/static/style.min.css
  6. +1
    -1
      src/copyvios/templates/error.html.jinja
  7. +11
    -18
      src/copyvios/templates/index.html.jinja
  8. +2
    -2
      src/copyvios/templates/login.html.jinja
  9. +1
    -1
      src/copyvios/templates/settings.html.jinja
  10. +2
    -2
      src/copyvios/templates/support/base.html.jinja
  11. +10
    -9
      src/copyvios/templates/support/cv_result.html.jinja
  12. +22
    -21
      tool_translations_config.py

+ 19
- 26
i18n/en.json Zobrazit soubor

@@ -9,7 +9,7 @@
"log-in": "Log in",
"log-out": "Log out",
"settings": "Settings",
"maintained-by": "Maintained by $1",
"maintained-by": "Maintained by [$1 Ben Kurtovic]",
"api": "API",
"source-code": "Source code",
"background-image": "Background image",
@@ -23,20 +23,18 @@
"login-error": "Error trying to log in: $1",
"login-heading": "Login",
"after-login-search": "After logging in, your check will be run.",
"after-login-redirect": "After logging in, you will be redirected to $1.",
"after-login-redirect": "After logging in, you will be redirected to: $1",
"login-button": "Login",
"logout-heading": "Logout",
"logout-message": "Logging out will prevent you from making search engine checks.",
"logout-button": "Logout",
"error-heading": "Error!",
"error-description": "An error occurred. If it hasn't been reported (<a href=\"$1\">try to check</a>), please <a href=\"$2\">file an issue</a> or <a href=\"$3\">email me</a>. Include the following information:",
"error-bad-site-confirm": "Confirm its URL.",
"search-error-retry": "repeat the check without using the search engine",
"error-description": "An error occurred. If it hasn't been reported ([$1 try to check]), please [$2 file an issue] or [$3 email me]. Include the following information:",
"settings-heading": "Settings",
"settings-description": "This page contains some configurable options for the copyvio detector. Settings are saved as cookies.",
"settings-default-site": "Default site",
"settings-background": "Background",
"settings-background-list": "Randomly select from <a href=\"$1\">a subset</a> of previous <a href=\"$2\">Wikimedia Commons</a> <a href=\"$3\">Pictures of the Day</a> that work well as widescreen backgrounds, refreshed daily (default).",
"settings-background-list": "Randomly select from [$1 a subset] of previous [$2 Wikimedia Commons] [$3 Pictures of the Day] that work well as widescreen backgrounds, refreshed daily (default).",
"settings-background-potd": "Use the current Commons Picture of the Day, unfiltered. Certain POTDs may be unsuitable as backgrounds due to their aspect ratio or subject matter.",
"settings-background-plain": "Use a plain background.",
"settings-save": "Save",
@@ -59,24 +57,22 @@
"form-use-turnitin": "Use Turnitin",
"form-bypass-cache": "Bypass cache",
"form-submit": "Submit",
"error-bad-action": "Unknown action: <b><span class=\"mono\">$1</span></b>.",
"error-bad-action": "Unknown action: <b><code>$1</code></b>.",
"error-no-search-method": "No copyvio search methods were selected. A check can only be made using the search engine, links present in the page, or some combination of these.",
"error-invalid-oldid": "The revision ID <code>$1</code> is invalid. It should be an integer.",
"error-no-url": "Compare mode requires a URL to be entered. Enter one in the text box below, or choose copyvio search mode to look for content similar to the article elsewhere on the web.",
"error-unsupported-uri": "Unsupported URI scheme: $1.",
"error-no-data": "Couldn't find any text in $1. <i>Note:</i> only HTML documents, plain text pages, and PDFs are supported, and content generated by JavaScript or found inside iframes is ignored.",
"error-timeout": "The URL $1 timed out before any data could be retrieved.",
"error-search-error": "An error occurred while using the search engine ($1). <i>Note:</i> there is a daily limit on the number of search queries the tool is allowed to make. You may $2.",
"error-unsupported-uri": "Unsupported URI scheme: [$1 $2].",
"error-no-data": "Couldn't find any text in [$1 $2]. <i>Note:</i> only HTML documents, plain text pages, and PDFs are supported, and content generated by JavaScript or found inside iframes is ignored.",
"error-timeout": "The URL [$1 $2] timed out before any data could be retrieved.",
"error-search-error": "An error occurred while using the search engine ($1). <i>Note:</i> there is a daily limit on the number of search queries the tool is allowed to make. You may [$2 repeat the check without using the search engine].",
"error-unknown": "An unknown error occurred.",
"error-bad-site": "The given site (project=<b><span class=\"mono\">$1</span></b>, language=<b><span class=\"mono\">$2</span></b>) doesn't seem to exist. It may also be closed or private. $3",
"error-revision-not-found": "The revision ID couldn't be found: $1.",
"error-page-not-found": "The page couldn't be found: $1.",
"intro-paragraph-1": "This tool attempts to detect $1 in articles. In <i>search mode</i>, it will check for similar content elsewhere on the web using <a href=\"https://developers.google.com/custom-search/\">Google</a>, external links present in the text of the page, or <a href=\"https://en.wikipedia.org/wiki/Wikipedia:Turnitin\">Turnitin</a> (via <a href=\"https://en.wikipedia.org/wiki/User:EranBot\">EranBot</a>), depending on which options are selected. In <i>compare mode</i>, the tool will compare the article to a specific webpage without making additional searches, like the <a href=\"https://dupdet.toolforge.org/\">Duplication Detector</a>.",
"error-bad-site": "The given site (project=<b><code>$1</code></b>, language=<b><code>$2</code></b>) doesn't seem to exist. It may also be closed or private. [$3 Confirm its URL.]",
"error-revision-not-found": "The revision ID couldn't be found: [$1 $2].",
"error-page-not-found": "The page couldn't be found: [$1 $2].",
"intro-paragraph-1": "This tool attempts to detect [$1 copyright violations] in articles. In <i>search mode</i>, it will check for similar content elsewhere on the web using Google or external links present in the text of the page, depending on which options are selected. In <i>compare mode</i>, the tool will compare the article to a specific webpage without making additional searches, like the [$2 Duplication Detector].",
"intro-paragraph-1-copyvio-url": "https://en.wikipedia.org/wiki/WP:COPYVIO",
"intro-copyright-violations": "copyright violations",
"intro-paragraph-2": "Running a full check can take up to a minute if other websites are slow or if the tool is under heavy use. Please be patient. If you get a timeout, wait a moment and refresh the page.",
"intro-paragraph-3": "Be aware that other websites can copy from Wikipedia, so check the results carefully, especially for older or well-developed articles. Specific websites can be skipped by adding them to the $1.",
"intro-exclusions-list": "excluded URL list",
"intro-paragraph-3": "Be aware that other websites can copy from Wikipedia, so check the results carefully, especially for older or well-developed articles. Specific websites can be skipped by adding them to the [$1 excluded URL list].",
"cached-line": "Results <abbr title=\"$1\">cached</abbr> from $2. Originally generated in $3 seconds.",
"cached-line-search": "Results <abbr title=\"$1\">cached</abbr> from $2. Originally generated in $3 seconds using {{PLURAL:$4|$4 query|$4 queries}}.",
"cached-tooltip": "To save time (and money), this tool will retain the results of checks for up to 72 hours. This includes the URLs of the checked sources, but neither their content nor the content of the article. Future checks on the same page (assuming it remains unchanged) will not involve additional search queries, but a fresh comparison against the source URL will be made. If the page is modified, a new check will be run.",
@@ -89,14 +85,12 @@
"no-violation": "No violation",
"similarity": "similarity",
"no-matches-found": "No matches found.",
"redirected-from": "Redirected from $1. $2.",
"redirected-from-check-original": "Check original.",
"attribution-warning": "This article contains an attribution template: <code>{{$1}}</code>. Please verify that any potential copyvios are not from properly attributed sources.",
"redirected-from": "Redirected from [$1 $2]. [$3 Check original].",
"attribution-warning": "This article contains an attribution template: <code>{{[$1 $2]}}</code>. Please verify that any potential copyvios are not from properly attributed sources.",
"turnitin-results": "Turnitin Results",
"turnitin-no-matches": "No matching sources found.",
"turnitin-report": "Report $1",
"turnitin-report-link": "Report $1 for text added at $2:",
"turnitin-source": "$1% of revision text ($2 words) found at $3",
"turnitin-report": "[$1 Report $2] for text added at [$3 $4]:",
"turnitin-source": "$1% of revision text ($2 words) found at [$3 $4]",
"checked-sources": "Checked Sources",
"table-url": "URL",
"table-similarity": "Similarity",
@@ -106,8 +100,7 @@
"no-sources-checked": "No sources checked.",
"urls-hidden": "{{PLURAL:$1|$1 URL with lower similarity hidden.|$1 URLs with lower similarity hidden.}}",
"urls-hidden-show": "Show them.",
"search-ended-early": "The search ended early because a match was found with high similarity. $1",
"search-ended-early-retry": "Do a complete check.",
"search-ended-early": "The search ended early because a match was found with high similarity. [$1 Do a complete check.]",
"article-label": "Article:",
"source-label": "Source:",
"compare-action": "Compare",


+ 10
- 17
i18n/qqq.json Zobrazit soubor

@@ -5,11 +5,11 @@
]
},
"site-title": "Title of the tool shown in the browser tab",
"site-header-title": "Header title of the tool, shown at the top of every page. \"Earwig's\" is the author's username. \"Copyvio Detector\" should be bolded.",
"site-header-title": "Header title of the tool, shown at the top of every page. \"Earwig's\" is the tool maintainer's username. \"Copyvio Detector\" should be bolded.",
"log-in": "Label for the login link in the header",
"log-out": "Title attribute for the logout link in the header",
"settings": "Label for the settings link in the header",
"maintained-by": "Footer text with a link to the author's user page. $1 is the complete HTML link to the author's user page.",
"maintained-by": "Footer text with a link to the tool maintainer's user page. $1 is the URL of the maintainer's user page.",
"api": "Link to the API documentation page",
"source-code": "Link to the source code repository",
"background-image": "Link to the background image description page",
@@ -30,8 +30,6 @@
"logout-button": "Label for the logout button",
"error-heading": "Heading for the error page",
"error-description": "Instructions for the user when an unexpected error occurs. Contains links to GitHub issues and email. $1 is the GitHub issues list URL, $2 is the new issue URL, $3 is the author's email URL.",
"error-bad-site-confirm": "Link text for confirming a wiki site's URL.",
"search-error-retry": "Link text for retrying a search without the search engine.",
"settings-heading": "Heading for the settings page",
"settings-description": "Explanation of the settings page",
"settings-default-site": "Section heading for default wiki site selection",
@@ -63,20 +61,18 @@
"error-no-search-method": "Error shown when neither search engine nor page links are selected for checking",
"error-invalid-oldid": "Error shown when the revision ID is not a valid integer. $1 is the invalid ID.",
"error-no-url": "Error shown when no URL is provided for compare mode",
"error-unsupported-uri": "Error shown when the URL has an unsupported URI scheme. $1 is the URL.",
"error-no-data": "Error shown when no text could be extracted from a URL. $1 is the URL.",
"error-timeout": "Error shown when a URL times out. $1 is the URL.",
"error-unsupported-uri": "Error shown when the URL has an unsupported URI scheme. $1 is the URL. $2 is the URL title.",
"error-no-data": "Error shown when no text could be extracted from a URL. $1 is the URL. $2 is the URL title.",
"error-timeout": "Error shown when a URL times out. $1 is the URL. $2 is the URL title.",
"error-search-error": "Error shown when the search engine fails. $1 is the error cause. $2 is a URL to retry without search engine.",
"error-unknown": "Fallback error message for unrecognized error codes",
"error-bad-site": "Error shown when the wiki site does not exist. $1 is the project code, $2 is the language code, $3 is a URL to confirm.",
"error-revision-not-found": "Error shown when the revision ID is not found. $1 is the URL, $2 is the revision ID.",
"error-page-not-found": "Error shown when the page is not found. $1 is the URL, $2 is the page title.",
"intro-paragraph-1": "First introductory paragraph explaining what the tool does (search mode vs compare mode). $1 is a link to the copyright violations page. Contains several hardcoded links: Google, Turnitin, EranBot, Duplication Detector.",
"intro-paragraph-1": "First introductory paragraph explaining what the tool does (search mode vs compare mode). $1 is the URL of the copyright violations page (intro-paragraph-1-copyvio-url). $2 is the URL of the Duplication Detector tool.",
"intro-paragraph-1-copyvio-url": "URL of the copyright violations page on the local Wikipedia.",
"intro-copyright-violations": "Link text for the copyright violations page (WP:COPYVIO).",
"intro-paragraph-2": "Second introductory paragraph about performance and timeouts",
"intro-paragraph-3": "Third introductory paragraph explaining caution with results and the excluded URL list. $1 is a link to the excluded URL list page.",
"intro-exclusions-list": "Link text for the excluded URL list page.",
"intro-paragraph-3": "Third introductory paragraph explaining caution with results and the excluded URL list. $1 is the URL of the excluded URL list page.",
"cached-line": "Cached results sentence (compare mode). $1 is the tooltip text for the <abbr> around 'cached'. $2 is a complete '<abbr>' with the time difference (e.g. '1 hour ago'). $3 is the generation time in seconds.",
"cached-line-search": "Cached results sentence (search mode). $1 is the tooltip text for the <abbr> around 'cached'. $2 is a complete '<abbr>' with the time difference (e.g. '1 hour ago'). $3 is the generation time. $4 is the search query count (PLURAL).",
"cached-tooltip": "Tooltip text for the 'cached' <abbr> element in the cached results sentence.",
@@ -89,14 +85,12 @@
"no-violation": "Label indicating no copyright violation was found",
"similarity": "Label below the similarity percentage score",
"no-matches-found": "Text shown when no matching sources were found",
"redirected-from": "Notice that the page was redirected from another title. $1 is the redirect page URL, $2 is the original title, $3 is the URL to check the original.",
"redirected-from-check-original": "Link text for checking the original (non-redirected) page.",
"redirected-from": "Notice that the page was redirected from another title. $1 is the original page's URL, $2 is the original page's title, $3 is the URL to check the original.",
"attribution-warning": "Warning when the article contains an attribution template. $1 is the URL to the template, $2 is the template name.",
"turnitin-results": "Section heading for Turnitin results",
"turnitin-no-matches": "Text shown when Turnitin found no matching sources",
"turnitin-report": "Label for a Turnitin report link. $1 is the report ID.",
"turnitin-report-link": "Turnitin report link with timestamp. $1 is the report ID, $2 is the diff URL, $3 is the timestamp string.",
"turnitin-source": "Turnitin source match description. $1 is the percentage, $2 is the word count, $3 is the source URL.",
"turnitin-report": "Turnitin report link with timestamp. $1 is the report URL, $2 is the report ID, $3 is the diff URL, $4 is the timestamp string.",
"turnitin-source": "Turnitin source match description. $1 is the percentage, $2 is the word count, $3 is the source URL, $4 is the URL title.",
"checked-sources": "Section heading for the list of checked sources",
"table-url": "Column header for the URL column in the sources table",
"table-similarity": "Column header for the similarity column in the sources table",
@@ -107,7 +101,6 @@
"urls-hidden": "Notice that some URLs are hidden. $1 is the count of hidden URLs. Followed by a separate 'Show them.' link.",
"urls-hidden-show": "Link text to reveal hidden URLs.",
"search-ended-early": "Notice that the search ended early due to a high-similarity match. $1 is a URL to re-run with a complete check.",
"search-ended-early-retry": "Link text for re-running with a complete check after the search ended early.",
"article-label": "Label for the article text in the comparison view",
"source-label": "Label for the source text in the comparison view",
"compare-action": "Link text to compare a specific source URL",


+ 1
- 1
src/copyvios/settings.py Zobrazit soubor

@@ -52,7 +52,7 @@ def _do_delete(query: SettingsQuery) -> str | None:
cookie = query.cookie
if cookie and cookie in cookies:
delete_cookie(cookie)
return f'Deleted cookie <b><span class="mono">{markupsafe.escape(cookie)}</span></b>.'
return f"Deleted cookie <b><code>{markupsafe.escape(cookie)}</code></b>."
elif query.all:
number = len(cookies)
for cookie in list(cookies.values()):


+ 0
- 1
src/copyvios/static/css/style.css Zobrazit soubor

@@ -376,7 +376,6 @@ h2 {
background: linear-gradient(to right, #faa, #fff);
}

.mono { font-family: monospace; }
.light { color: #ccc; }
.medium { color: #aaa; }



+ 1
- 1
src/copyvios/static/style.min.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 1
src/copyvios/templates/error.html.jinja Zobrazit soubor

@@ -4,7 +4,7 @@
{% endblock %}
{% block content %}
<h2>{{ message('error-heading') }}</h2>
<p>{{ message('error-description', issues_url='https://github.com/earwig/copyvios/issues', new_issue_url='https://github.com/earwig/copyvios/issues/new', email_url='mailto:wikipedia.earwig@gmail.com') }}</p>
<p>{{ message('error-description', url_issues='https://github.com/earwig/copyvios/issues', url_new_issue='https://github.com/earwig/copyvios/issues/new', url_email='mailto:wikipedia.earwig@gmail.com') }}</p>
<div id="info-box" class="red-box">
<pre>{{ traceback | trim | e }}</pre>
</div>


+ 11
- 18
src/copyvios/templates/index.html.jinja Zobrazit soubor

@@ -19,44 +19,37 @@
{% elif error.code == ErrorCode.NO_URL %}
{{ message('error-no-url') }}
{% elif error.code == ErrorCode.BAD_URI %}
{% set url_link = '<a href="' ~ (query.url | e) ~ '">' ~ (query.url | e) ~ '</a>' %}
{{ message('error-unsupported-uri', target_url=url_link | safe) }}
{{ message('error-unsupported-uri', url_target=query.url | e, target_title=query.url | e) }}
{% elif error.code == ErrorCode.NO_DATA %}
{% set url_link = '<a href="' ~ (query.url | e) ~ '">' ~ (query.url | e) ~ '</a>' %}
{{ message('error-no-data', target_url=url_link | safe) }}
{{ message('error-no-data', url_target=query.url | e, target_title=query.url | e) }}
{% elif error.code == ErrorCode.TIMEOUT %}
{% set url_link = '<a href="' ~ (query.url | e) ~ '">' ~ (query.url | e) ~ '</a>' %}
{{ message('error-timeout', target_url=url_link | safe) }}
{{ message('error-timeout', url_target=query.url | e, target_title=query.url | e) }}
{% elif error.code == ErrorCode.SEARCH_ERROR %}
{% set retry_url = ((request.url | httpsfix) + '&use_engine=0') | e %}
{% set retry_link = '<a href="' ~ retry_url ~ '">' ~ (message('search-error-retry') | striptags) ~ '</a>' %}
{{ message('error-search-error', error_cause=error.__cause__, no_engine_url=retry_link | safe) }}
{{ message('error-search-error', error_cause=error.__cause__, url_no_engine=((request.url | httpsfix) + '&use_engine=0') | e) }}
{% else %}
{{ message('error-unknown') }}
{% endif %}
</p></div>
{% elif not g.site %}
<div id="info-box" class="red-box">
{% set site_confirm_link = '<a href="https://' ~ (query.lang | e) ~ '.' ~ (query.project | e) ~ '.org/">' ~ (message('error-bad-site-confirm') | striptags) ~ '</a>' %}
<p>{{ message('error-bad-site', project=query.project, lang=query.lang, site_url=site_confirm_link | safe) }}</p>
{% set bad_site_url = "https://" ~ query.lang ~ "." ~ query.project ~ ".org/" %}
<p>{{ message('error-bad-site', project=query.project, lang=query.lang, url_site=bad_site_url | e) }}</p>
</div>
{% elif query.oldid and not result %}
<div id="info-box" class="red-box">
{% set rev_link = '<a href="https://' ~ (g.site.domain | e) ~ '/w/index.php?oldid=' ~ (query.oldid | e) ~ '">' ~ (query.oldid | e) ~ '</a>' %}
<p>{{ message('error-revision-not-found', revision_url=rev_link | safe) }}</p>
{% set rev_url = "https://" ~ g.site.domain ~ "/w/index.php?oldid=" ~ query.oldid %}
<p>{{ message('error-revision-not-found', url_revision=rev_url | e, revision_id=query.oldid | e) }}</p>
</div>
{% elif query.title and not result %}
<div id="info-box" class="red-box">
{% set page_link = '<a href="' ~ (g.page.url | e) ~ '">' ~ (g.page.title | e) ~ '</a>' %}
<p>{{ message('error-page-not-found', page_url=page_link | safe) }}</p>
<p>{{ message('error-page-not-found', url_page=g.page.url | e, page_title=g.page.title | e) }}</p>
</div>
{% endif %}
{% endif %}
{% set ui_lang = query.lang or g.lang_code or 'en' %}
<p>{{ message('intro-paragraph-1',
copyright_url=('<a href="' ~ (message('intro-paragraph-1-copyvio-url') | e) ~ '">' ~ (message('intro-copyright-violations') | striptags) ~ '</a>') | safe) }}</p>
<p>{{ message('intro-paragraph-1', url_copyright=(message('intro-paragraph-1-copyvio-url') | e), url_dupdet='https://dupdet.toolforge.org') }}</p>
<p>{{ message('intro-paragraph-2') }}</p>
<p>{{ message('intro-paragraph-3', exclusions_url=('<a href="https://en.wikipedia.org/wiki/User:EarwigBot/Copyvios/Exclusions">' ~ (message('intro-exclusions-list') | striptags) ~ '</a>') | safe) }}</p>
<p>{{ message('intro-paragraph-3', url_exclusions='https://en.wikipedia.org/wiki/User:EarwigBot/Copyvios/Exclusions') }}</p>
{% include "support/cv_form.html.jinja" %}
{% if result %}
{% include "support/cv_result.html.jinja" %}


+ 2
- 2
src/copyvios/templates/login.html.jinja Zobrazit soubor

@@ -14,11 +14,11 @@
{% if is_search %}
<p>{{ message('after-login-search') }}</p>
{% else %}
<p>{{ message('after-login-redirect', redirect_url=request.args["next"]) }}</p>
<p>{{ message('after-login-redirect', redirect_url=request.args["next"] | e) }}</p>
{% endif %}
{% endif %}
<form action="{{ request.script_root }}/login" method="post">
<input type="hidden" name="next" value="{{ request.args.get('next', '/') | safe }}" />
<input type="hidden" name="next" value="{{ request.args.get('next', '/') | e }}" />
<div class="oo-ui-layout oo-ui-fieldLayout oo-ui-fieldLayout-align-left">
<div class="oo-ui-fieldLayout-body">
<span class="oo-ui-fieldLayout-field">


+ 1
- 1
src/copyvios/templates/settings.html.jinja Zobrazit soubor

@@ -53,7 +53,7 @@
<div class="oo-ui-fieldLayout-field">
<div class="oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-radioSelectInputWidget">
{% set background_options = [
("list", message('settings-background-list', potd_subset_url='https://commons.wikimedia.org/wiki/User:The_Earwig/POTD', commons_url='https://commons.wikimedia.org/', potd_url='https://commons.wikimedia.org/wiki/Commons:Picture_of_the_day')),
("list", message('settings-background-list', url_potd_subset='https://commons.wikimedia.org/wiki/User:The_Earwig/POTD', url_commons='https://commons.wikimedia.org/', url_potd='https://commons.wikimedia.org/wiki/Commons:Picture_of_the_day')),
("potd", message('settings-background-potd')),
("plain", message('settings-background-plain')),
] %}


+ 2
- 2
src/copyvios/templates/support/base.html.jinja Zobrazit soubor

@@ -24,7 +24,7 @@
<h1><a href="/">{{ message('site-header-title') }}</a></h1>
{% set logged_in_user = session.get("username") %}
{% if logged_in_user %}
<a class="logout-link" href="/logout" title="{{ message('log-out') | striptags | e }}">{{ logged_in_user | safe }}</a>
<a class="logout-link" href="/logout" title="{{ message('log-out') | striptags | e }}">{{ logged_in_user | e }}</a>
{% else %}
<a class="login-link" href="/login" title="{{ message('log-in') | striptags | e }}">{{ message('log-in') }}</a>
{% endif %}
@@ -44,7 +44,7 @@
</div>
<footer>
<ul>
<li>{{ message('maintained-by', author_url='<a href="https://en.wikipedia.org/wiki/User:The_Earwig">Ben Kurtovic</a>' | safe) }}</li>
<li>{{ message('maintained-by', url_author='https://en.wikipedia.org/wiki/User:The_Earwig') }}</li>
<li><a href="{{ request.script_root }}/api">{{ message('api') }}</a></li>
<li><a href="https://github.com/earwig/copyvios">{{ message('source-code') }}</a></li>
{% if desc_url %}


+ 10
- 9
src/copyvios/templates/support/cv_result.html.jinja Zobrazit soubor

@@ -29,9 +29,9 @@
{% endif %}
{% if query.redirected_from %}
<br />
{% set redirect_link = '<a href="https://' ~ (g.site.domain | e) ~ '/w/index.php?title=' ~ (result.metadata.redirected_from.title | urlencode) ~ '&redirect=no">' ~ (result.metadata.redirected_from.title | e) ~ '</a>' %}
{% set check_orig_link = '<a href="' ~ ((request.url | httpsfix) ~ '&noredirect=1' | e) ~ '">' ~ (message('redirected-from-check-original') | striptags) ~ '</a>' %}
<span id="redirected-from">{{ message('redirected-from', redirect_page_url=redirect_link | safe, check_original_url=check_orig_link | safe) }}</span>
{% set redirected_from_url = "https://" ~ g.site.domain ~ "/w/index.php?title=" ~ (result.metadata.redirected_from.title | urlencode) ~ "&redirect=no" %}
{% set check_original_url = (request.url | httpsfix) ~ "&noredirect=1" %}
<span id="redirected-from">{{ message('redirected-from', url_redirected_from=redirected_from_url | e, redirected_from_title=result.metadata.redirected_from.title | e, url_check_original=check_original_url | e) }}</span>
{% endif %}
</td>
<td>
@@ -62,9 +62,8 @@

{% set attrib = get_attribution_info(g.site, g.page) %}
{% if attrib %}
{% set template_link = '<a href="' ~ (attrib[1] | e) ~ '">' ~ (attrib[0] | e) ~ '</a>' %}
<div id="attribution-warning" class="yellow-box">
{{ message('attribution-warning', template_url=template_link | safe) }}
{{ message('attribution-warning', url_template=attrib[1] | e, template_title=attrib[0] | e) }}
</div>
{% endif %}

@@ -74,10 +73,12 @@
{% if result.metadata.turnitin_result.reports %}
<table id="turnitin-table"><tbody>
{% for report in turnitin_result.reports %}
<tr><td class="turnitin-table-cell"><a href="https://eranbot.toolforge.org/ithenticate.py?rid={{ report.reportid }}">{{ message('turnitin-report', report_id=report.reportid) }}</a> for text added at <a href="https://{{ query.lang | e }}.wikipedia.org/w/index.php?title={{ query.title | e }}&amp;diff={{ report.diffid }}"> {{ report.time_posted.strftime("%H:%M, %d %B %Y (UTC)") }}</a>:
{% set report_url = "https://eranbot.toolforge.org/ithenticate.py?rid=" ~ report.reportid %}
{% set diff_url = "https://" ~ query.lang ~ ".wikipedia.org/w/index.php?title=" ~ query.title ~ "&diff=" ~ report.diffid %}
<tr><td class="turnitin-table-cell">{{ message('turnitin-report', url_report=report_url | e, report_id=report.reportid | e, url_diff=diff_url | e, report_time=report.time_posted.strftime("%H:%M, %d %B %Y (UTC)")) }}:
<ul>
{% for source in report.sources %}
<li>{{ message('turnitin-source', percent=source['percent'], word_count=source['words'], source_url=('<a href="' ~ (source['url'] | e) ~ '">' ~ (source['url'] | e) ~ '</a>') | safe) }}</li>
<li>{{ message('turnitin-source', percent=source['percent'], word_count=source['words'], url_source=source['url'] | e, source_title=source['url'] | e }}</li>
{% endfor %}
</ul></td></tr>
{% endfor %}
@@ -136,8 +137,8 @@
{% endif %}
{% if skips or result.possible_miss %}
<div class="cv-source-footer">
{% set retry_link = '<a href="' ~ ((request.url | httpsfix) ~ '&noskip=1' | e) ~ '">' ~ (message('search-ended-early-retry') | striptags) ~ '</a>' %}
{{ message('search-ended-early', retry_url=retry_link | safe) }}
{% set retry_url = (request.url | httpsfix) ~ "&noskip=1" %}
{{ message('search-ended-early', url_retry=retry_url | e) }}
</div>
{% endif %}
</div>


+ 22
- 21
tool_translations_config.py Zobrazit soubor

@@ -8,43 +8,44 @@ config = TranslationsConfig(
"settings-updated": ["changes"],
"error-bad-action": ["action"],
"error-invalid-oldid": ["oldid"],
"error-unsupported-uri": ["target_url"],
"error-no-data": ["target_url"],
"error-timeout": ["target_url"],
"error-bad-site": ["project", "lang", "site_url"],
"error-revision-not-found": ["revision_url"],
"error-page-not-found": ["page_url"],
"error-search-error": ["error_cause", "no_engine_url"],
"error-unsupported-uri": ["url_target", "target_title"],
"error-no-data": ["url_target", "target_title"],
"error-timeout": ["url_target", "target_title"],
"error-bad-site": ["project", "lang", "url_site"],
"error-revision-not-found": ["url_revision", "revision_id"],
"error-page-not-found": ["url_page", "page_title"],
"error-search-error": ["error_cause", "url_no_engine"],
"check-results-time": ["time"],
"check-results-time-search": ["time", "num_queries"],
"cached-line": ["tooltip_text", "time_abbr", "gen_time"],
"cached-line-search": ["tooltip_text", "time_abbr", "gen_time", "num_queries"],
"redirected-from": ["redirect_page_url", "check_original_url"],
"attribution-warning": ["template_url"],
"turnitin-report": ["report_id"],
"turnitin-report-link": ["report_id", "diff_url"],
"turnitin-source": ["percent", "word_count", "source_url"],
"search-ended-early": ["retry_url"],
"redirected-from": [
"url_redirected_from",
"redirected_from_title",
"url_check_original",
],
"attribution-warning": ["url_template", "template_title"],
"turnitin-report": ["url_report", "report_id", "url_diff", "report_time"],
"turnitin-source": ["percent", "word_count", "url_source", "source_title"],
"search-ended-early": ["url_retry"],
"urls-hidden": ["num_urls"],
"ago-seconds": ["num"],
"ago-minutes": ["num"],
"ago-hours": ["num"],
"maintained-by": ["author_url"],
"error-description": ["issues_url", "new_issue_url", "email_url"],
"intro-paragraph-3": ["exclusions_url"],
"intro-paragraph-1": ["copyright_url"],
"intro-paragraph-1-copyvio-url": [],
"maintained-by": ["url_author"],
"error-description": ["url_issues", "url_new_issue", "url_email"],
"intro-paragraph-1": ["url_copyright", "url_dupdet"],
"intro-paragraph-3": ["url_exclusions"],
"after-login-redirect": ["redirect_url"],
"settings-background-list": ["potd_subset_url", "commons_url", "potd_url"],
"settings-background-list": ["url_potd_subset", "url_commons", "url_potd"],
},
allowed_html_elements={
"a": {"href", "id"},
"abbr": {"title"},
"b": set(),
"br": set(),
"code": set(),
"i": set(),
"span": {"class", "id"},
"strong": set(),
"em": set(),
},
)

Načítá se…
Zrušit
Uložit