User:SpBot/How to make SpBot archive your wiki

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

{{Autoarchive resolved section}} and the related bot service is available on many wikis as you can see here. If you want to add your wiki to that, there are some steps to do. Please note, I (User:Euku) only understand German, English and Russian - so, you are the one who needs to translate. :)

Notify Euku

[edit]

You should inform me about your idea. Is there any similar project or language that is already operated by SpBot? If yes, this can answer many questions. If you need to send some texts to me, http://pastebin.com/ is a good and fast tool for that.

Import templates from other wikis

[edit]

First off: the service and functions will only be translated. There are no special functions or features for certain wiki projects, except for technical reasons. Especially, parameters or template names are the same for one language, like the German Wikipedia, Wikisource and Wiktionary or Meta, Commons and Wikidata...

You should think of a good name for these main templates in your local wiki:

Template:Autoarchive resolved section
Template:Section resolved: Some wikis already use some kind of "resolved" template. This one can use one and two parameters.

You should not reuse templates that are already used for other purposes as this confuses people. Also, these templates use some programming to validate the given parameters and to generate error lists.

If SpBot is not already operating in a different project with the same language, you should better start from the templates on Commons. That means:

Unfortunately - for now - all English projects use automatic translation. So, you will see a lot of these templates in the source code. If they are not available in your wiki, there is no other way than to exclude the most important parts.

One part is to translate the descriptions used in the documentation. But the more important part for me/the bot are the translations of:

  • the template parameters. Don't forget timecompare = resolved. It is also very helpful to leave <!-- comments --> with the English original names, as we did for example for the Korean Wikipedia.
  • “Archive” parameter variables: Same applies here.
    • Does your language and country use the en:ISO week date? ISO 8601 means: Weeks start with Monday. Each week's year is the Gregorian year in which the Thursday falls. If not, what comes close?
    • How should I abbreviate months for ((month:short))?
  • Signature format: Is your timestamp format self-explanatory? I also need to know all the abbreviation of the month names in the timestamp, if they are not the same as above. Do they vary for the same month?

At the end, please add the new templates to d:Q15818920 and d:Q15818852.

Translate the bot messages

[edit]

The bot also needs to learn the new language for the messages and edit comments. Please translate the following fragments. %s and {variable} are a placeholder. Please copy the main line below and translate.

  • What template should be used for the head of a new archive? For Commons it is: {{Talkarchive}}.
    self.headTemplate = "{{Talkarchive}}"
  • If the bot finds an error, it will write the error message to the page. Please translate the messages:
    self.errorCategory = "Category:{{ns:Project}}:Incorrect Autoarchive parameter/SpBot"
    self.errorText = "== Archiving could not be finished ==\n"
    self.errorText += f"The bot-run at ~~~~~ was not successful, because the template {self.archiveTemplateName} contains incorrect parameters. %s"
    self.errorText += f"Please have a look at the [[{self.archiveTemplateName}|documentation]] and fix the mistake. Regards --~~~~"
    self.errorText += f"\n\n[[{self.errorCategory}]]<!-- remove this line, if the problem was resolved -->"
    self.errorTextSummary = "reporting an error"
  • Edit comments:
    self.archiveSumTargetS = "archiving 1 section from [[{sourcePage}]]"
    self.archiveSumTargetP = "archiving {numOfSections} sections from [[{sourcePage}]]"
    self.archiveSumOriginS = "1 section"
    self.archiveSumOriginP = "{numberOfSectionsRemovedFromOrigin} sections"
    self.archiveSumOriginMulti = "{noOfDisuccionsToThisTarget} to [[{targetPageName}]]"
    self.firstNewSectionInArchiveSummary = " (after section [[{firstNewSectionInArchiveLink}]])"
    self.archiveSumLastEdit= " - previous edit: [[:User:%s|%s]], %s"
    self.archiveOverallSummary = "archive {numberOfSectionsRemovedFromOriginStr}: {distributionComment}{firstNewSectionInArchiveSummary}{lastEditComment}"
  • The note that will replace the {{Section resolved|1=\\1}} template while archiving:
    self.sectResolved1P = ":<small>This section was archived on a request by: \\1</small>"
    self.sectResolved2P = ":<small>This section was archived on a request by \\1 \\7</small>"

Is there any {{DNAU}}? Does it work in the same way?

Ready to start

[edit]

If (in the meantime) my request for a bot flag was successful, I will start the bot to operate automatically at night.