mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Enable localization of special page.
- Improved: Special Page can now be translated using messages.
This commit is contained in:
11
i18n/de.json
11
i18n/de.json
@ -1,6 +1,11 @@
|
|||||||
{
|
{
|
||||||
"linktitles": "LinkTitles",
|
"linktitles": "LinkTitles",
|
||||||
"linktitles-desc": "Fügt beim Speichern von Seiten automatisch Querverweise zu vorhandenen Seiten ein.",
|
"linktitles-desc": "Fügt beim Speichern von Seiten automatisch Querverweise zu vorhandenen Seiten ein.",
|
||||||
"right-linktitles-batch": "LinkTitles-Stapelverarbeitung ausführen",
|
"linktitles-special-info": "LinkTitles-Erweiterung: $1\n== Stapelverarbeitung ==\nKlicken Sie auf den Button, um die Stapelverarbeitung zu beginnen. Die Erweiterung wird nacheinander alle Seiten Ihres Wikis mit automatischen Links versehen. Um zu verhindern, daß der Server bei der Ausführung blockiert wird, wird diese Seite sich wiederholt selbst aufrufen. Um die Stapelverarbeitung abzubrechen, schließen Sie einfach diese Seite.",
|
||||||
"action-linktitles-batch": "LinkTitles-Stapelverarbeitung auszuführen"
|
"linktitles-special-progress": "== Verarbeite die Seiten... ==\nDie [$1 LinkTitles-Erweiterung] verarbeitet gerade alle Seiten Ihres Wikis.\n=== Aktuelle Seite: $2 ===",
|
||||||
|
"linktitles-special-page-count": "Seite $1 von $2.\n",
|
||||||
|
"linktitles-special-cancel-notice": "=== Um abzubrechen, schließen Sie diese Seite, oder klicken Sie den 'Stopp'-Knopf in Ihrem Browser ===\n[[Special:LinkTitles|Zu Special:LinkTitles zurückkehren.]]",
|
||||||
|
"linktitles-special-completed-info": "== Stapelverarbeitung abgeschlossen! ==\n{| class=\"wikitable\"\n|-\n| Anzahl der verarbeiteten Seiten: || $1\n|-\n| Verarbeitungsintervall [s]: || $2\n|-\n| Reloads: || $3\n|-\n| Seiten pro Reload: || $4\n|}",
|
||||||
|
"right-linktitles-batch": "LinkTitles-Stapelverarbeitung ausführen",
|
||||||
|
"action-linktitles-batch": "LinkTitles-Stapelverarbeitung auszuführen"
|
||||||
}
|
}
|
||||||
|
11
i18n/en.json
11
i18n/en.json
@ -1,6 +1,11 @@
|
|||||||
{
|
{
|
||||||
"linktitles": "LinkTitles",
|
"linktitles": "LinkTitles",
|
||||||
"linktitles-desc": "Automatically adds links to existing pages whenever a page is saved.",
|
"linktitles-desc": "Automatically adds links to existing pages whenever a page is saved.",
|
||||||
"right-linktitles-batch": "Perform a LinkTitles batch operation",
|
"linktitles-special-info": "LinkTitles extension: $1\n== Batch Linking ==\nYou can start a batch linking process by clicking on the button below. This will go through every page in the normal namespace of your Wiki and insert links automatically. This page will repeatedly reload itself, in order to prevent blocking the server. To interrupt the process, simply close this page.",
|
||||||
"action-linktitles-batch": "perform a LinkTitles batch operation"
|
"linktitles-special-progress": "== Processing pages... ==\nThe [$1 LinkTitles] extension is currently going through every page of your wiki, adding links to existing pages as appropriate.\n=== Current page: $2 ===",
|
||||||
|
"linktitles-special-page-count": "Page $1 of $2.\n",
|
||||||
|
"linktitles-special-cancel-notice": "=== To abort, close this page, or hit the 'Stop' button in your browser ===\n[[Special:LinkTitles|Return to Special:LinkTitles.]]",
|
||||||
|
"linktitles-special-completed-info": "== Batch processing completed! ==\n{| class=\"wikitable\"\n|-\n| total number of pages: || $1\n|-\n| timeout setting [s]: || $2\n|-\n| webpage reloads: || $3\n|-\n| pages scanned per reload interval: || $4\n|}",
|
||||||
|
"right-linktitles-batch": "Perform a LinkTitles batch operation",
|
||||||
|
"action-linktitles-batch": "perform a LinkTitles batch operation"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
{
|
{
|
||||||
"linktitles": "Title of the LinkTitles extension; also used for the special page.",
|
"linktitles": "Name of the LinkTitles extension; also used for the special page.",
|
||||||
"linktitles-desc": "Description of the LinkTitles extension.",
|
"linktitles-desc": "Description of the LinkTitles extension.",
|
||||||
"right-linktitles-batch": "Describes the right to perform a LinkTitles batch operation.",
|
"linktitles-special-info": "Descriptive text that appears on the Special:LinkTitles page.",
|
||||||
"action-linktitles-batch": "Describes the action of performing a LinkTitles batch operation."
|
"linktitles-special-progress": "Text that is shown on the Special:LinkTitles page while batch processing is executing.",
|
||||||
|
"linktitles-special-page-count": "Number of pages.",
|
||||||
|
"linktitles-special-cancel-notice": "Informs the user how to cancel the LinkTitles batch processing.",
|
||||||
|
"linktitles-special-completed-info": "Text and statistics table that appear when batch processing has completed.",
|
||||||
|
"right-linktitles-batch": "Describes the right to perform a LinkTitles batch operation.",
|
||||||
|
"action-linktitles-batch": "Describes the action of performing a LinkTitles batch operation."
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ namespace LinkTitles;
|
|||||||
* Provides event handlers and entry points for the extension.
|
* Provides event handlers and entry points for the extension.
|
||||||
*/
|
*/
|
||||||
class Extension {
|
class Extension {
|
||||||
|
const URL = 'https://github.com/bovender/LinkTitles';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event handler for the PageContentSave hook.
|
* Event handler for the PageContentSave hook.
|
||||||
|
@ -175,21 +175,8 @@ class Special extends \SpecialPage {
|
|||||||
* and a form and button to start linking.
|
* and a form and button to start linking.
|
||||||
*/
|
*/
|
||||||
private function buildInfoPage( &$request, &$output ) {
|
private function buildInfoPage( &$request, &$output ) {
|
||||||
|
$output->addWikiText( $this->msg( 'linktitles-special-info', Extension::URL ) );
|
||||||
$url = $request->getRequestURL();
|
$url = $request->getRequestURL();
|
||||||
|
|
||||||
// TODO: Put the page contents in messages in the i18n file.
|
|
||||||
$output->addWikiText(
|
|
||||||
<<<EOF
|
|
||||||
LinkTitles extension: https://github.com/bovender/LinkTitles
|
|
||||||
|
|
||||||
== Batch Linking ==
|
|
||||||
You can start a batch linking process by clicking on the button below.
|
|
||||||
This will go through every page in the normal namespace of your Wiki and
|
|
||||||
insert links automatically. This page will repeatedly reload itself, in
|
|
||||||
order to prevent blocking the server. To interrupt the process, simply
|
|
||||||
close this page.
|
|
||||||
EOF
|
|
||||||
);
|
|
||||||
$output->addHTML(
|
$output->addHTML(
|
||||||
<<<EOF
|
<<<EOF
|
||||||
<form method="post" action="${url}">
|
<form method="post" action="${url}">
|
||||||
@ -211,34 +198,18 @@ EOF
|
|||||||
$progress = $index / $end * 100;
|
$progress = $index / $end * 100;
|
||||||
$percent = sprintf("%01.1f", $progress);
|
$percent = sprintf("%01.1f", $progress);
|
||||||
|
|
||||||
$output->addWikiText(
|
$output->addWikiText( $this->msg( 'linktitles-special-progress', Extension::URL, $curTitle ) );
|
||||||
|
$pageInfo = $this->msg( 'linktitles-page-count', $index, $end );
|
||||||
|
$output->addWikiText( 'linktitles-special-page-count', $index, $end );
|
||||||
|
$output->addHTML( // TODO: do not use the style attribute (to make it work with CSP-enabled sites)
|
||||||
<<<EOF
|
<<<EOF
|
||||||
== Processing pages... ==
|
<div style="width:100%; padding:2px; border:1px solid #000; position: relative; margin-bottom:16px;">
|
||||||
The [https://github.com/bovender/LinkTitles LinkTitles]
|
<span style="position: absolute; left: 50%; font-weight:bold; color:#555;">${percent}%</span>
|
||||||
extension is currently going through every page of your wiki, adding links to
|
|
||||||
existing pages as appropriate.
|
|
||||||
|
|
||||||
=== Current page: $curTitle ===
|
|
||||||
EOF
|
|
||||||
);
|
|
||||||
$output->addHTML(
|
|
||||||
<<<EOF
|
|
||||||
<p>Page ${index} of ${end}.</p>
|
|
||||||
<div style="width:100%; padding:2px; border:1px solid #000; position: relative;
|
|
||||||
margin-bottom:16px;">
|
|
||||||
<span style="position: absolute; left: 50%; font-weight:bold; color:#555;">
|
|
||||||
${percent}%
|
|
||||||
</span>
|
|
||||||
<div style="width:${progress}%; background-color:#bbb; height:20px; margin:0;"></div>
|
<div style="width:${progress}%; background-color:#bbb; height:20px; margin:0;"></div>
|
||||||
</div>
|
</div>
|
||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
$output->addWikiText(
|
$output->addWikiText( $this->msg( 'linktitles-special-cancel-notice' ) );
|
||||||
<<<EOF
|
|
||||||
=== To abort, close this page, or hit the 'Stop' button in your browser ===
|
|
||||||
[[Special:LinkTitles|Return to Special:LinkTitles.]]
|
|
||||||
EOF
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -276,20 +247,10 @@ EOF
|
|||||||
private function addCompletedInfo( &$output, $start, $end, $reloads ) {
|
private function addCompletedInfo( &$output, $start, $end, $reloads ) {
|
||||||
$pagesPerReload = sprintf('%0.1f', $end / $reloads);
|
$pagesPerReload = sprintf('%0.1f', $end / $reloads);
|
||||||
$output->addWikiText(
|
$output->addWikiText(
|
||||||
<<<EOF
|
$this->msg( 'linktitltes-special-completed-info', $end,
|
||||||
== Batch processing completed! ==
|
$config->specialPageReloadAfter, $reloads, $pagesPerReload
|
||||||
{| class="wikitable"
|
)
|
||||||
|-
|
);
|
||||||
| total number of pages: || ${end}
|
|
||||||
|-
|
|
||||||
| timeout setting [s]: || {$config->specialPageReloadAfter}
|
|
||||||
|-
|
|
||||||
| webpage reloads: || ${reloads}
|
|
||||||
|-
|
|
||||||
| pages scanned per reload interval: || ${pagesPerReload}
|
|
||||||
|}
|
|
||||||
EOF
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user