diff --git a/.gitignore b/.gitignore index 11515fd..86a8d86 100644 --- a/.gitignore +++ b/.gitignore @@ -20,10 +20,6 @@ pip-log.txt .coverage .tox -#Translations -*.mo -bot/locale - #Other wp_private.py *.swp diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 85c9a00..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include locale/*/*/*.mo \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index cdf9d1a..0000000 --- a/Makefile +++ /dev/null @@ -1,113 +0,0 @@ -# encoding=utf-8 -# vim: fenc=utf-8 noet sw=4 ts=4 sts=4 ai - -# Add more languages here! Beware that this is a makefile snippet and -# you have to adhere to make syntax. -LINGUAS = nb_NO \ - ca_ES \ - fi_FI \ - gl_ES \ - es_ES \ - eu_ES - -# Textdomain for our package. -TEXTDOMAIN = messages - -localedir = ./locale -targetdir = ./locale -sourcedir = ./ukbot - -CATALOGS = $(LINGUAS) -MO_FILES = $(addprefix $(localedir)/, $(addsuffix .mo, $(LINGUAS))) -SOURCE_FILES = $(wildcard ukbot/*.py ukbot/rules/*.py ukbot/filters/*.py) -MSGMERGE = msgmerge -MSGFMT = msgfmt -XGETTEXT = xgettext -CATOBJEXT = .po - -TD = $(strip $(TEXTDOMAIN)) - -default: help - -all: $(TD).pot update-po update-mo install -# makedb - -help: - @echo "Available targets:" - @echo " pot - Regenerate master catalog from source files" - @echo " update-po - Update po files from master catalog" - @echo " update-mo - Regenerate mo files from po files" - @echo " install - Install mo files" - @echo " all - All of the above" - -#POTFILES = $(localedir)/POTFILES.in \ -# $(shell cat $(localedir)/POTFILES.in) - -pot: $(TD).pot - -clean: - for dir in ./ $(localedir); do \ - rm -fv $$dir/*~ $$dir/*.bak $$dir/*.mo $$dir/*.pox $$dir/*.pot; \ - done - - -# Use xgettext to extract strings from the source code -# files listed in POTFILESS.in - -$(TD).pot: $(SOURCE_FILES) - $(XGETTEXT) --output=$(localedir)/$(TD).pox $(SOURCE_FILES) - rm -f $(localedir)/$@ && mv $(localedir)/$(TD).pox $(localedir)/$@ - -install: $(MO_FILES) - languages='$(LINGUAS)'; \ - for lang in $$languages; do \ - mkdir -p "$(targetdir)/$$lang/LC_MESSAGES" || exit 1; \ - dest="$(targetdir)/$$lang/LC_MESSAGES/$(TD).mo"; \ - cat="$(localedir)/$$lang.mo"; \ - echo "installing $$cat as $$dest"; \ - mv -f $$cat $$dest && chmod 644 $$dest || exit 1; \ - done - -update-mo: $(MO_FILES) - -update-po: - $(MAKE) $(TD).pot - cd $(localedir); \ - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ - echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(TD).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ - else \ - echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ - fi; \ - done - -.SUFFIXES: -.SUFFIXES: .po .mo - -.po.mo: - $(MSGFMT) --verbose -o $@ $< - -# $(MSGFMT) --check --statistics --verbose -o $@ $< - - -#makedb: -# ./db/initialize.sh - - -#MSGSRC=$(wildcard locale/*/LC_MESSAGES/messages.po) -#MSGOBJ=$(addprefix $(TARGET_BUILD_PATH)/$(target)/,$(MSG_SRC:.po=.mo)) - -#gettext: $(MSGOBJS) - -#locale/%/LC_MESSAGES/messages.mo: locale/%/LC_MESSAGES/messages.po -# msgfmt -c $< -o $@ - - -#.PHONY: makedb diff --git a/config/config.no-mk.yml b/config/config.no-mk.yml index a86bbc6..8b4ec08 100644 --- a/config/config.no-mk.yml +++ b/config/config.no-mk.yml @@ -11,11 +11,6 @@ othersites: - smn.wikipedia.org # - www.wikidata.org # - commons.wikimedia.org - # FOR INDIAN CONTEST APRIL 2025 – remove in May - - bn.wikipedia.org - - hi.wikipedia.org - - kn.wikipedia.org - - syl.wikipedia.org contestPages: resultsSection: 'Resultater' participantsSection: 'Delta[kg]ere' diff --git a/config/sites/cawiki.yml b/config/sites/cawiki.yml index 9035326..1ad3078 100644 --- a/config/sites/cawiki.yml +++ b/config/sites/cawiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [ca_ES, ca_AD, ca_FR, ca_IT, ca_ES@valencia] wiki_timezone: Europe/Berlin homesite: ca.wikipedia.org othersites: diff --git a/config/sites/enwiki.yml b/config/sites/enwiki.yml index 9885d58..015fde8 100644 --- a/config/sites/enwiki.yml +++ b/config/sites/enwiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [en_US] homesite: en.wikipedia.org default_prefix: en wikidata_languages: ['en'] diff --git a/config/sites/eswiki.yml b/config/sites/eswiki.yml index 15786e2..c04fc70 100644 --- a/config/sites/eswiki.yml +++ b/config/sites/eswiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [es_ES,en_US] homesite: es.wikipedia.org default_prefix: es wikidata_languages: ['es', 'en'] diff --git a/config/sites/euwiki.yml b/config/sites/euwiki.yml index f57032f..8ec0cac 100644 --- a/config/sites/euwiki.yml +++ b/config/sites/euwiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [eu_ES,en_US] wiki_timezone: Europe/Berlin homesite: eu.wikipedia.org othersites: diff --git a/config/sites/fiwiki.yml b/config/sites/fiwiki.yml index 1cd6b9a..b4bf78c 100644 --- a/config/sites/fiwiki.yml +++ b/config/sites/fiwiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: fi_FI wiki_timezone: Europe/Helsinki homesite: fi.wikipedia.org default_prefix: fi diff --git a/config/sites/glwiki.yml b/config/sites/glwiki.yml index 8ff2a7a..dd5de2d 100644 --- a/config/sites/glwiki.yml +++ b/config/sites/glwiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [gl_ES,en_US] homesite: gl.wikipedia.org default_prefix: gl wikidata_languages: ['gl', 'en'] diff --git a/config/sites/nowiki.yml b/config/sites/nowiki.yml index 4f8a667..bc8aa71 100644 --- a/config/sites/nowiki.yml +++ b/config/sites/nowiki.yml @@ -1,5 +1,4 @@ _extends: default.yml -locale: [nb_NO, no_NO] wiki_timezone: Europe/Berlin homesite: no.wikipedia.org othersites: @@ -104,6 +103,7 @@ templates: name: sparql # as in {{ ukb criterion | sparql }} params: query: spørring # as in {{ ukb criterion | sparql | query=... }} + columns: Kolonner awards: blå: { file: Article blue.svg, winner: true } rød: { file: Article red.svg, winner: true } diff --git a/locale/ca_ES.po b/locale/ca_ES.po deleted file mode 100644 index fca60d1..0000000 --- a/locale/ca_ES.po +++ /dev/null @@ -1,429 +0,0 @@ -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# SPDX-FileCopyrightText: 2025 Joan Creus \n" -"Language-Team: Catalan \n" -"Language: ca_ES\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 23.08.5\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "El nom de filtre \"%s\" no s'ha entès" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "No s'ha trobat la llista de participants!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"No hi ha regles de puntuació definides per aquest concurs. Les regles de" -" punts es defineixen amb {{tl|%(template)s}}." - -#: ukbot/contest.py:228 -#, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "" -"No s'ha pogut interpretar la plantilla {{tlx|%(template)s|%(firstarg)s}}: " -"%(err)s" - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "Argument desconegut passat a {{tl|%(template)s}}: %(argument)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "" -"No s'ha pogut interpretar la data donada a la plantilla {{tl|%(template)s}}." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"No s'ha trobat l'usuari %(user)s passat a la plantilla {{tl|%(template)s}}." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" -"No s'ha pogut analitzar la plantilla %(template)s: no s'ha trobat un lloc que" -" concordi amb el prefix de lloc %(prefix)s" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"No s'ha trobat l'usuari %(user)s passat a la plantilla {{tl|%(template)s}}." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Dia" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Punts" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%e. %B %Y, %H:%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Actualitzat %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Concurs setmanal de la setmana %(week)d" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Concurs setmanal de la setmana %(startweek)d–%(endweek)d" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Salutacions" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "i" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Ara caldria comprovar si el resultat sembla correcte. Si hi ha missatges" -" d'error al final de la [[%(page)s|pàgina de concurs]], caldria comprovar si" -" les contribucions relacionades amb aquest missatge han rebut el nombre de" -" punts correcte. Comproveu també si hi ha comentaris o queixes a la pàgina de" -" discussió. Si tot sembla que està bé, [%(link)s cliqueu aquí] (i deseu) per" -" indicar que puc enviar els premis de seguida que pugui." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Gràcies, ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "Els premis s'han [%(link)s enviat]." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBot ha trobat un problema" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Aquest concurs està tancat – gràcies a tothom que hi ha participat! Els" -" premis s'enviaran de seguida que l'organitzador del concurs hagi comprovat" -" els resultats." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "Aquest concurs està tancat – gràcies a tothom que hi ha participat!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Actualitzat per darrera vegada a %(lastupdate)s. El concurs està obert des de" -" %(startdate)s fins " -"%(enddate)s." - -#: ukbot/contest.py:960 -#, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBot ha trobat els següents problemes amb la pàgina [[%s]]" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" -"No s'han trobat els marcadors de resultats %(start_marker)s i %(end_marker)s" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "No s'ha trobat la secció \"%(section_name)s\"." - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "Actualitzant amb els resultats finals, el concurs queda tancat." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Comprovant els resultats i repartint premis" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Actualitzant" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "El concurs setmanal és: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "suspès des de" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A, %H:%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Encara no s'hi han registrat contribucions qualificades" - -#: ukbot/contributions.py:181 -#, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "%d article" -msgstr[1] "%d articles" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Columnes}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%d.%m, %H:%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "limitat al màxim" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Categoria trobada" - -#: ukbot/contributions.py:278 -#, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "Total: %(bytecount)d bytes, %(wordcount)d paraules" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Nota: Les contribucions a aquest article estan " -"desqualificades actualment." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "N" - -#: ukbot/contributions.py:305 -msgid "W" -msgstr "W" - -#: ukbot/filters.py:150 -msgid "Too few arguments given to this template." -msgstr "Massa pocs arguments passats a aquesta plantilla." - -#: ukbot/filters.py:198 -#, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"No s'ha pogut analitzar la pàgina %(article)s perquè la revisió %(rev)d no" -" s'ha pogut analitzar: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "No s'ha pogut interpretar la pàgina catignore" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "No s'han donat valors a les categories!" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "S'ha trobat un bucle infinit de categories:" - -#: ukbot/filters.py:483 -msgid "No byte limit (second argument) given" -msgstr "No s'ha donat el límit de bytes (segon argument)" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "No s'ha donat el paràmetre \"%s\"" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" -"Revisió [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: La" -" diferència de paraules podria estar malament perquè no s'han trobat paraules" -" a la revisió anterior (%(parentid)s) de mida %(size)d, possiblement per" -" culpa de tags o plantilles mal tancades en aquella revisió." - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" -"Revisió [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: La" -" diferència de paraules podria estar malament perquè l'increment en nombre de" -" paraules (%(words)d) és més gran que l'increment en bytes (%(bytes)d). Els" -" errors en comptar paraules poden ser deguts a viquitext incorrecte." - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "La pàgina no existeix: [[%(pagename)s]]" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "No s'ha trobat un site que concordi amb el prefix \"%(key)s\"" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#REDIRECT [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "Redirigint a %s" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "articles" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Columnes}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f bytes" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "contribució" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "enllaços" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "imatges" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "pàgina nova" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "qualificada" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "redirecció" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "referències" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "punters a referència" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "expressió regular" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "secció" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "bonificació %(words)d paraules" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "treure {{tl|%(template)s}}" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "etiqueta (%(lang)s)" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "descripció (%(lang)s)" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "àlies (%(lang)s)" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "declaració de %(property)s" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "%(count)d declaracions de %(property)s" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f paraules" - diff --git a/locale/es_ES.po b/locale/es_ES.po deleted file mode 100644 index 665c7e5..0000000 --- a/locale/es_ES.po +++ /dev/null @@ -1,433 +0,0 @@ -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# Rubén Ojeda , 2025 -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: 2020-11-24 20:36+0100\n" -"Last-Translator: Rubén Ojeda \n" -"Language: es_ES\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 19.12.3\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "No se entendió el nombre del filtro \"%s\"" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "¡No se ha encontrado la lista de participantes!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"No existen reglas de puntos definidas para este concurso. Las reglas de " -"puntos se definen con {{tl|%(template)s}}." - -#: ukbot/contest.py:228 -#, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "" -"No se pudo analizar la plantilla {{tlx|%(template)s|%(firstarg)s}}: %(err)s" - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "" -"Argumento desconocido proporcionado a {{tl|%(template)s}}: %(argument)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "" -"No se pudo entender la fecha proporcionada a la plantilla {{tl|" -"%(template)s}}." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"No se pudo encontrar el usuario %(user)s proporcionado a la plantilla {{tl|" -"%(template)s}}." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" -"No se pudo analizar la plantilla %(template)s: no hemos encontrado un site " -"que concuerde con el prefijo que tenemos: %(prefix)s" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"No se pudo encontrar el usuario %(user)s proporcionado a la plantilla {{tl|" -"%(template)s}}." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Día" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Puntos" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%e %B %Y, %H:%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Actualizado %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Concurso semanal de la semana %(week)d" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Concurso semanal de la semana %(startweek)d–%(endweek)d" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Atentamente" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "y" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Ahora debes comprobar si los resultados parecen correctos. Si hay mensajes " -"de error al final de la [[%(page)s|página del concurso]], deberías comprobar " -"que las contribuciones relacionadas han recibido el número correcto de " -"puntos. Comprueba también si hay comentarios o quejas en la página de " -"discusión. Si todo está bien, [%(link)s haz clic aquí] (y guarda) para " -"indicar que puedo enviar los premios en cuanto pueda." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Gracias, ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "Se han [%(link)s enviado] los premios." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBot ha encontrado un problema" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Este concurso ha acabado – ¡gracias a todas las personas que han " -"participado! Los premios se enviarán en cuanto el organizador del concurso " -"haya comprobado los resultados." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "" -"Este concurso ha acabado – ¡gracias a todas las personas que han participado!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Última actualización %(lastupdate)s. El concurso está abierto desde " -"%(startdate)s hasta %(enddate)s." - -#: ukbot/contest.py:960 -#, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBot ha encontrado los siguientes problemas con la página [[%s]]" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" -"Los marcadores de resultados %(start_marker)s y %(end_marker)s no se han " -"encontrado" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "No se ha encontrado la sección \"%(section_name)s\"." - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "Actualizando con los resultados finales, el concurso ha acabado." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Comprobando los resultados y entregando premios" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Actualizando" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "El concurso semanal es: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "suspendido desde" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A, %H:%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Aún no se han registrado contribuciones calificadas" - -#: ukbot/contributions.py:181 -#, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "%d artículo" -msgstr[1] "%d artículos" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Columnas}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%d.%m, %H:%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "limitado al máximo" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Coincidencia de categoría" - -#: ukbot/contributions.py:278 -#, fuzzy, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "Total: {{formatnum:%(bytecount)d}} bytes, %(wordcount)d palabras" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Nota: Las contribuciones a este artículo están " -"descalificadas actualmente." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "N" - -#: ukbot/contributions.py:305 -msgid "W" -msgstr "W" - -#: ukbot/filters.py:150 -msgid "Too few arguments given to this template." -msgstr "Esta plantilla tiene demasiados pocos argumentos." - -#: ukbot/filters.py:198 -#, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"No se pudo analizar la página %(article)s porque la revisión %(rev)d no se " -"ha podido entender: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "No se pudo entender la página catignore" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "¡No se han dado valores de categoría!" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "Se ha encontrado un bucle de categorías infinito:" - -#: ukbot/filters.py:483 -msgid "No byte limit (second argument) given" -msgstr "No se ha dado el límite de bytes (segundo argumento)" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "No se ha dado el parámetro \"%s\"" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" -"Revisión [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: la " -"diferencia en el número de palabras puede estar equivocada, porque no se han " -"encontrado palabras en la revisión (%(parentid)s) de tamaño %(size)d, " -"posiblemente porque que hay tags o plantillas mal cerradas en aquella " -"revisión." - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" -"Revisión [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: la " -"diferencia en el número de palabras puede estar equivocada, porque el " -"aumento (%(words)d) en el número de palabras es mayor que el aumento de " -"bytes (%(bytes)d). Pueden salir recuentos incorrectos si el wikitexto no es " -"válido." - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "La página no existe: [[%(pagename)s]]" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "No se ha encontrado un site que concuerde con el prefijo \"%(key)s\"" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#REDIRECT [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "Redirigiendo a %s" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "artículos" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Columnas}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f bytes" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "contribución" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "enlaces" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "imágenes" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "página nueva" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "calificado" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "redirección" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "referencias" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "punteros de referencia" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "regexp" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "sección" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "%(words)d palabras extra" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "borrado de {{tl|%(template)s}}" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "etiqueta (%(lang)s)" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "descripción (%(lang)s)" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "alias (%(lang)s)" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "declaración de %(property)s" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "%(count)d declaraciones de %(property)s" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f palabras" diff --git a/locale/eu_ES.po b/locale/eu_ES.po deleted file mode 100644 index 71f51d6..0000000 --- a/locale/eu_ES.po +++ /dev/null @@ -1,471 +0,0 @@ -# Basque translation for UKBot -# Copyright (C) 2017 -# This file is distributed under the same license as the UKBot package. -# Galder Gonzalez Larrañaga , 2017 -# -msgid "" -msgstr "" -"Project-Id-Version: UKBot\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: 2019-09-05 01:57+0200\n" -"Last-Translator: Galder Gonzalez \n" -"Language-Team: \n" -"Language: eu\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.3\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "Ezin izan da parte-hartzaileen zerrendarik aurkitu!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"Ez dago puntuazio araurik lehiaketa honetan. Puntuak {{tx|%(template)s}}." -"txantiloiak definitzen ditu." - -#: ukbot/contest.py:228 -#, fuzzy, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "Ezin izan da {{tx|%(template)s}} txantiloia irakurri." - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "Parametro ezezaguna eman da {{tx|%(template)s}}: %(argument)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "Ezin izan da emandako data kalkulatu {{tx|%(template)s}} txantiloian." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"Ezin izan da %(user)s wikilaria aurkitu {{tx|%(template)s}} txantiloian." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"Ezin izan da %(user)s wikilaria aurkitu {{tx|%(template)s}} txantiloian." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Eguna" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Puntuak" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%Y %B %e, %H:%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Azken gaurkotzea: %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Asteroko lehiaketa aste honetan: %(week)d" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Asteroko lehiaketa aste honetan: %(startweek)d-%(endweek)d" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Ondo segi" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "eta" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Orain ikusi behar duzu ea emaitzek itxura ona duten. Akatsik badago mezuetan " -"[[%(page)s|lehiaketaren orrialdearen]] amaieran, begiratu beharko zenuke ea " -"ekarpen guztiek puntu kopuru zuzena jaso ote duten. Gainera konproba ezazu " -"denak itxura ona duela, [%(link)s egin klik hemen] (eta gorde) esateko bidal " -"ditzakedala jada sariak." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Eskerrik asko, ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "Sariak [%(link)s bidali dira]." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBotek arazo bat aurkitu du" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Lehiaketa hau itxita dago - eskerrik asko parte-hartzaile guztiei! Sariak " -"emango dira lehiaketaren antolatzaileak emaitzak berrikusten dituenean." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "Lehiaketa hau itxita dag - eskerrik asko parte-hartzailee guztiei!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Azken gaurkotzea: %(lastupdate)s. Lehiaketa hau %(startdate)s eta " -"%(enddate)s bitarte irekita dago." - -#: ukbot/contest.py:960 -#, fuzzy, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBotek honako akatsa aurkitu du artikuluan: [[:%s]]" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "" - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "Azken emaitzekin gaurkotzen, lehiaketa itxiko da." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Emaitzak konprobatzen eta sariak ematen" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Gaurkotzen" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "Aste honetako lehiaketa: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "noiztik suspenditua" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A, %H.%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Ez du egin lehiaketa honetarako ekarpen baliagarririk oraindik" - -#: ukbot/contributions.py:181 -#, fuzzy, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "artikulu" -msgstr[1] "artikulu" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Multicol}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%Y %B %e, %H:%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Kategoria" - -#: ukbot/contributions.py:278 -#, fuzzy, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "Guztira: {{formatnum:%(bytecount)d}} byte, %(wordcount)d hitzetan" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Oharra: Artikulu honi egindako ekarpenak oraintxe " -"deskalifikaturik daude." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "B" - -#: ukbot/contributions.py:305 -#, fuzzy -msgid "W" -msgstr "B" - -#: ukbot/filters.py:150 -#, fuzzy -msgid "Too few arguments given to this template." -msgstr "Parametro ezezaguna eman da {{tx|%(template)s}}: %(argument)s" - -#: ukbot/filters.py:198 -#, fuzzy, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"Ezin izan da %(article)s artikulua aztertu berrikuspenetako bat %(prevrev)d " -"edo %(rev)d ezin izan delako ikusi: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "Ezin izan da catignore orrialdea kargatu" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "Kategoria infinitu lotuar bat aurkitu da: " - -#: ukbot/filters.py:483 -#, fuzzy -msgid "No byte limit (second argument) given" -msgstr "" -"Ez zaio byte mugarik eman (bigarren argumentua) {tx|%(template)s|" -"%(firstarg)s}} txantiloiari" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" -"[//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s] berrikusketa: " -"Hitz zenbaketa ezberdina izan daiteke eta akatsak izan, ez direlako hitzak " -"aurkitu aurreko berriskupenean (%(parentid)s) tamaina honekin %(size)d, " -"ziurrenik itxi gabeko etiketa edo txantiloiak direla eta." - -#: ukbot/revision.py:142 -#, fuzzy, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" -"[//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s] berrikuspena: " -"hitz zenbaketa ezberdintasuna gaizki egon daiteke, hitz kontaketaren aldea " -"(%(words)d) handiagoa delako byte kontaketaren aldea baino (%(bytes)d)." -"Gaizki egindako hitz kontaketa wiki testu okerra dela eta gerta daiteke." - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#BIRZUZENDU [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "%s orrialdera birzuzentzen" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "artikulu" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Multicol}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f byte" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "ekarpena" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "%(links).f lotura" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "%(images).f irudi" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "orrialde berria" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "kalifikatua" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "birzuzeneketa" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "erreferentziak" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "erreferentzia berrerabilpena" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "bonus %(words)d hitz" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "{{tx|%(template)s}} txantiloia kentzea" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f hitz" - -#~ msgid "This contest is missing a {{tl|%(template)s}} template." -#~ msgstr "Lehiaketa honek ez du {{tx|%(template)s}} txantiloia." - -#~ msgid "" -#~ "Did not find %(week)s+%(year)s or %(start)s+%(end)s in {{tl|" -#~ "%(templates)s}}." -#~ msgstr "" -#~ "Ez da aurkitu %(week)s+%(year)s edo %(start)s+%(end)s hemen: {{tx|" -#~ "%(templates)s}}." - -#~ msgid "" -#~ "Note that the contest this week is [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Join in!" -#~ msgstr "" -#~ "Aste honetako lehiaketa honakoa da: [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Batu!" - -#~ msgid "max" -#~ msgstr "gehienez" - -#~ msgid "added reference section" -#~ msgstr "erreferentzia atala gehitu du" - -#~ msgid "bonus %(bytes).f bytes" -#~ msgstr "bonus %(bytes).f byte" - -#~ msgid "" -#~ "No template (second argument) given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "" -#~ "Ez zaio bigarren argumentudun txantiloirik eman {{tx|%(template)s|" -#~ "%(firstarg)s}}" - -#~ msgid "No categories given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Ez zaio kategoriarik eman {{tx|%(template)s|%(firstarg)s}}" - -#, fuzzy -#~ msgid "" -#~ "No \"%(query)s\" parameter given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Ez zaio kategoriarik eman {{tx|%(template)s|%(firstarg)s}}" - -#~ msgid "Unknown argument given to {{tl|%(template)s}}: %(argument)s" -#~ msgstr "Parametro ezezaguna eman da {{tx|%(template)s}}: %(argument)s" - -#~ msgid "Found no \"%(section)s\" sections in the page \"%(page)s\"" -#~ msgstr "Ez da \"%(section)s\" sekziorik aurkitu \"%(page)s\" orrialdean" diff --git a/locale/fi_FI.po b/locale/fi_FI.po deleted file mode 100644 index 1971e62..0000000 --- a/locale/fi_FI.po +++ /dev/null @@ -1,472 +0,0 @@ -# Finnish translation for UKBot -# Copyright (C) 2013 -# This file is distributed under the same license as the UKBot package. -# Gálaniitoluodda, 2013 -# -msgid "" -msgstr "" -"Project-Id-Version: UKBot\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: 2019-09-05 01:56+0200\n" -"Last-Translator: Dan Michael O. Heggø \n" -"Language-Team: \n" -"Language: fi\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.2.3\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "Osallistujaluettelon löytäminen epäonnistui!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"Tähän kilpailuun ei ole asetettu pistelaskusääntöjä. Säännöt merkitään näin: " -"{{tl|%(template)s}}." - -#: ukbot/contest.py:228 -#, fuzzy, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "{{tl|%(template)s}}-mallineen ymmärtäminen epäonnistui." - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "" -"Tuntematon argumentti on annettu kohteeseen {{tl|%(template)s}}: %(argument)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "" -"{{tl|%(template)s}}-mallineeseen annettu päivämäärä ei tullut ymmärretyksi." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "Käyttäjää %(user)s ri löytynyt {{tl|%(template)s}}-mallineesta." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "Ei löydetty käyttäjää %(user)s {{tl|%(template)s}}-mallineesta." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Päivä" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Pisteet" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%e. %Bta %Y kello %H.%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Päivitetty %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Viikon %(week)d kilpailu" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Viikkojen %(startweek)d–%(endweek)d kilpailu" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Terveisin" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "ja" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Nyt sinun on tarkistettava tulokset. Mikäli [[%(page)s|kilpailusivun]] " -"lopussa on virheilmoituksia, on sinun tarkistettava, että muokkauksista on " -"saatu oikea määrä pisteitä. Katso myös onko keskustelusivulla kommentteja " -"tai valituksia. Jos kaikki näyttää olevan kunnossa, paina [%(link)s tästä] " -"(ja tallenna), niin rusetit lähetetään melko nopeasti." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Terveisin, ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "Rusetit on nyt [%(link)s jaettu]." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBot havaitsi ongelman" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Tämä kilpailu on päättynyt – kiitos kaikille osallistuneille! Rusetit " -"jaetaan heti kun kilpailun järjestäjä on tarkistanut tulokset." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "Tämä kilpailu on päättynyt – kiitos kaikille osallistuneille!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Päivitetty viimeksi %(lastupdate)s. Kilpailu on avoinna %(startdate)s – " -"%(enddate)s." - -#: ukbot/contest.py:960 -#, fuzzy, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBot havaitsi seuraavat ongelmat artikkeliin [[:%s]] liittyen" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "" - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "Lisätään lopulliset tulokset ja merkitään kilpailu päättyneeksi." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Tarkistetaan tulokset ja jaetaan rusetit" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Päivitetään" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "Viikon kilpailu on: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "suspendert siden" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A kello %H.%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Hyväksyttyjä muokkauksia ei ole vielä rekisteröity" - -#: ukbot/contributions.py:181 -#, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "%d artikkeli" -msgstr[1] "%d artikkelia" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Sarakkeet}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%e. %Bta %Y kello %H.%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Luokkaosuma" - -#: ukbot/contributions.py:278 -#, fuzzy, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "" -"Yhteensä: {{formatnum:%(bytecount)d}} {{subst:PLURAL:%(bytecount)d|tavu|" -"tavua}}, %(wordcount)d {{subst:PLURAL:%(wordcount)d|sana|sanaa}}" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Huomio: Muokkaukset tähän artikkeliin on toistaiseksi " -"hylätty." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "U" - -#: ukbot/contributions.py:305 -#, fuzzy -msgid "W" -msgstr "U" - -#: ukbot/filters.py:150 -#, fuzzy -msgid "Too few arguments given to this template." -msgstr "" -"Tuntematon argumentti on annettu kohteeseen {{tl|%(template)s}}: %(argument)s" - -#: ukbot/filters.py:198 -#, fuzzy, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"Artikkelin %(article)s analysointi epäonnistui sillä versio %(prevrev)d tai " -"%(rev)d ei tullut ymmärreyksi: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "Catignore-sivun sisältöä ei ymmärretty" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "Jumiutunut loputtomaan luokkasilmukkaan: " - -#: ukbot/filters.py:483 -#, fuzzy -msgid "No byte limit (second argument) given" -msgstr "" -"Tavurajaa (toinen argumentti) ei ole annettu kohteeseen {{tlx|%(template)s|" -"%(firstarg)s}}" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#OHJAUS [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "Ohjaus sivulle %s" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "" -"%(articlecount)d {{subst:PLURAL:%(articlecount)d|artikkeli|artikkelia}}" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Sarakkeet}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f {{subst:PLURAL:%(bytes).f|tavu|tavua}}" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "%(links).f {{subst:PLURAL:%(links).f|linkkit|linkkiä}}" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "%(images).f {{subst:PLURAL:%(images).f|kuva|kuvaa}}" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "uusi sivu" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "hyväksytty" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "uudelleenohjaus" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "" -"{{subst:PLURAL:%(num)d|Yksi lähde on lisätty|%(num)d lähdettä on lisätty}}" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "" -"{{subst:PLURAL:%(num)d|Yksi viittaus jo olemassa olevaan lähteeseen|%(num)d " -"viittausta jo olemassa oleviin lähteisiin}}" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "bonus %(words)d {{subst:PLURAL:%(words)d|sana|sanaa}}" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "mallineen {{tl|%(template)s}} poisto" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f {{subst:PLURAL:%(words).f|sana|sanaa}}" - -#~ msgid "This contest is missing a {{tl|%(template)s}} template." -#~ msgstr "Tästä kilpailusta puuttuu {{tl|%(template)s}}-malline." - -#~ msgid "" -#~ "Did not find %(week)s+%(year)s or %(start)s+%(end)s in {{tl|" -#~ "%(templates)s}}." -#~ msgstr "" -#~ "Kohteesta {{tl|%(templates)s}} ei ole löydetty %(week)s+%(year)s eikä " -#~ "%(start)s+%(end)s." - -#~ msgid "" -#~ "Note that the contest this week is [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Join in!" -#~ msgstr "" -#~ "Muista, että tämän viikon kilpailu on [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Onnea matkaan!" - -#~ msgid "max" -#~ msgstr "maks" - -#~ msgid "added reference section" -#~ msgstr "yksi viittaus jo olemassaolevaan lähteeseen" - -#~ msgid "bonus %(bytes).f bytes" -#~ msgstr "bonus %(bytes).f {{subst:PLURAL:%(bytes).f|tavu|tavua}}" - -#~ msgid "" -#~ "No template (second argument) given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "" -#~ "Mallineita (toinen argumentti) ei ole annettu kohteeseen {{tlx|" -#~ "%(template)s|%(firstarg)s}}" - -#~ msgid "No categories given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Kohteeseen {{tlx|%(template)s|%(firstarg)s}} ei ole annettu luokkia" - -#, fuzzy -#~ msgid "" -#~ "No \"%(query)s\" parameter given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Kohteeseen {{tlx|%(template)s|%(firstarg)s}} ei ole annettu luokkia" - -#~ msgid "Unknown argument given to {{tl|%(template)s}}: %(argument)s" -#~ msgstr "" -#~ "Tuntematon argumentti on annettu kohteeseen {{tl|%(template)s}}: " -#~ "%(argument)s" - -#~ msgid "Found no \"%(section)s\" sections in the page \"%(page)s\"" -#~ msgstr "Ei löydettyjä \"%(section)s\"-osioita sivulla \"%(page)s\"" diff --git a/locale/gl_ES.po b/locale/gl_ES.po deleted file mode 100644 index 6cc1b34..0000000 --- a/locale/gl_ES.po +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# Francisco Prieto , 2025. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: 2020-11-24 20:36+0100\n" -"Last-Translator: Francisco Prieto \n" -"Language-Team: Galician \n" -"Language: gl_ES\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Lokalize 19.12.3\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "O nome de filtro \"%s\" non se entendeu" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "Non se atopou a lista de participantes!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"Non hai regras de puntos definidas para este concurso. As regras de puntos " -"defínense con {{tl|%(template)s}}." - -#: ukbot/contest.py:228 -#, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "" -"Non se puido analizar o modelo {{tlx|%(template)s|%(firstarg)s}}: %(err)s" - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "Argumento descoñecido pasado a {{tl|%(template)s}}: %(argumento)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "Non se puido entender a data que se deu ao modelo {{tl|%(template)s}}." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"Non se puido atopar o usuario %(user)s que se deu ao modelo {{tl|" -"%(template)s}}." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" -"Non se puido analizar o modelo %(template)s: non se atopou un site que " -"concorde co prefixo que temos: %(prefix)s" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" -"Non se puido atopar o usuario %(user)s que se pasou ao {{tl|%(template)s}} " -"modelo." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Día" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Puntos" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%e %B %Y, %H:%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Actualizado %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Concurso semanal da semana %(week)d" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Concurso semanal da semana %(startweek)d–%(endweek)d" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Atentamente" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "e" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Agora tes que comprobar se os resultados semellan correctos. Se hai mensaxes " -"de erro ao final da [[%(page)s|páxina do concurso]], deberías comprobar que " -"as achegas relacionadas recibiron o número correcto de puntos. Comproba " -"tamén se hai comentarios ou queixas na páxina de conversa. Se todo ten boa " -"pinta, [%(link)s fai clic aquí] (e garda) para sinalar que podo enviar os " -"premios tan axiña como sexa posible." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Grazas, ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "[%(link)s Enviáronse] os premios." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBot atopou un problema" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Este concurso rematou – grazas a todas as persoas que participaron! Os " -"premios enviaranse tan axiña como o organizador do concurso comprobe os " -"resultados." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "Este concurso rematou – grazas a todas as persoas que participaron!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Última actualización %(lastupdate)s. O concurso está aberto dende " -"%(startdate)s até %(enddate)s." - -#: ukbot/contest.py:960 -#, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBot atopou os seguintes problemas coa páxina [[%s]]" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" -"Os marcadores de resultados %(start_marker)s e %(end_marker)s non se atoparon" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "Non se atopou a sección \"%(section_name)s\"." - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "Actualizando cos resultados finais, o concurso rematou." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Comprobando os resultados e repartindo os premios" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Actualizando" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "O concurso semanal é: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "suspendido dende" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A, %H:%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Aínda non se rexistraron achegas cualificadas" - -#: ukbot/contributions.py:181 -#, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "%d artigo" -msgstr[1] "%d artigos" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Columnas}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%d.%m, %H:%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "limitado ao máximo" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Coincidencia de categoría" - -#: ukbot/contributions.py:278 -#, fuzzy, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "Total: {{formatnum:%(bytecount)d}} bytes, %(wordcount)d palabras" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Nota: As achegas a este artigo están descualificadas " -"actualmente." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "N" - -#: ukbot/contributions.py:305 -msgid "W" -msgstr "W" - -#: ukbot/filters.py:150 -msgid "Too few arguments given to this template." -msgstr "Este modelo ten moi poucos argumentos." - -#: ukbot/filters.py:198 -#, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"Non se puido analizar a páxina %(article)s porque a revisión %(rev)d non se " -"puido entender: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "Non se puido entender a páxina catignore" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "Non se deron valores de categoría!" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "Atopouse un bucle de categorías infinito:" - -#: ukbot/filters.py:483 -msgid "No byte limit (second argument) given" -msgstr "Non se deu o límite de bytes (segundo argumento)" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "Non se deu o parámetro \"%s\"" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" -"Revisión [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: a " -"diferenza no número de palabras pode estar trabucada, porque non se atoparon " -"palabras na revisión (%(parentid)s) de medida %(size)d, posiblemente porque " -"que hai tags ou modelos mal pechados naquela revisión." - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" -"Revisión [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: a " -"diferenza no número de palabras pode estar trabucada, porque o aumento " -"(%(words)d) no número de palabras é meirande ca o aumento de bytes " -"(%(bytes)d). Poden saír recontos incorrectos se o wikitexto non é válido." - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "A páxina non existe: [[%(pagename)s]]" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "Non se atopou un site que concorde co prefixo \"%(key)s\"" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#REDIRECT [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "Redirixindo a %s" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "artigos" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Columnas}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f bytes" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "achega" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "ligazóns" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "imaxes" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "páxina nova" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "cualificado" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "redirección" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "referencias" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "punteiros de referencia" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "expresión regular" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "sección" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "%(words)d palabras extra" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "borrado de {{tl|%(template)s}}" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "etiqueta (%(lang)s)" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "descrición (%(lang)s)" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "alcume (%(lang)s)" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "declaración de %(property)s" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "%(count)d declaracións de %(property)s" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f palabras" diff --git a/locale/messages.pot b/locale/messages.pot deleted file mode 100644 index 250b26b..0000000 --- a/locale/messages.pot +++ /dev/null @@ -1,395 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" - -#: ukbot/contest.py:228 -#, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "" - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "" - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "" - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "" - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" - -#: ukbot/contest.py:960 -#, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "" - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "" - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "" - -#: ukbot/contributions.py:181 -#, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "" -msgstr[1] "" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "" - -#: ukbot/contributions.py:278 -#, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "" - -#: ukbot/contributions.py:305 -msgid "W" -msgstr "" - -#: ukbot/filters.py:150 -msgid "Too few arguments given to this template." -msgstr "" - -#: ukbot/filters.py:198 -#, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "" - -#: ukbot/filters.py:483 -msgid "No byte limit (second argument) given" -msgstr "" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "" diff --git a/locale/nb_NO.po b/locale/nb_NO.po deleted file mode 100644 index a12e82a..0000000 --- a/locale/nb_NO.po +++ /dev/null @@ -1,482 +0,0 @@ -# Norwegian Bokmål translation for UKBot -# Copyright (C) 2013 -# This file is distributed under the same license as the UKBot package. -# -# Dan Michael Heggø , 2013. -# Jon Harald Søby , 2025. -msgid "" -msgstr "" -"Project-Id-Version: UKBot\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-02 15:46+0200\n" -"PO-Revision-Date: 2025-03-29 13:18+0100\n" -"Last-Translator: Jon Harald Søby \n" -"Language-Team: Norwegian Bokmal \n" -"Language: nb\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 21.12.3\n" - -#: ukbot/contest.py:65 -#, python-format -msgid "The filter name \"%s\" was not understood" -msgstr "Filternavnet «%s» ble ikke forstått" - -#: ukbot/contest.py:155 -msgid "Couldn't find the list of participants!" -msgstr "Fant ikke deltakerlisten!" - -#: ukbot/contest.py:183 -#, python-format -msgid "" -"There are no point rules defined for this contest. Point rules are defined " -"by {{tl|%(template)s}}." -msgstr "" -"Denne konkurransen har ingen poengregler. Poengregler defineres med {{tl|" -"%(template)s}}." - -#: ukbot/contest.py:228 -#, fuzzy, python-format -msgid "Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s" -msgstr "Klarte ikke å tolke {{tl|%(template)s}}-malen." - -#: ukbot/contest.py:258 -#, python-format -msgid "Unkown argument given to {{tl|%(template)s}}: %(argument)s" -msgstr "Ukjent argument gitt til {{ml|%(template)s}}: %(argument)s" - -#: ukbot/contest.py:289 -#, python-format -msgid "Couldn't parse the date given to the {{tl|%(template)s}} template." -msgstr "Klarte ikke å tolke datoen gitt til {{ml|%(template)s}}-malen." - -#: ukbot/contest.py:322 -#, python-format -msgid "" -"Could not find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "Fant ikke brukeren %(user)s gitt til {{ml|%(template)s}}-malen." - -#: ukbot/contest.py:335 ukbot/contest.py:375 -#, python-format -msgid "" -"Failed to parse the %(template)s template: Did not find a site matching the " -"site prefix %(prefix)s" -msgstr "" -"Kunne ikke tolke malen %(template)s: Fant ikke wiki som matcher prefikset " -"%(prefix)s" - -#: ukbot/contest.py:354 ukbot/contest.py:394 -#, python-format -msgid "" -"Couldn't find the user %(user)s given to the {{tl|%(template)s}} template." -msgstr "Fant ikke brukeren %(user)s gitt til {{ml|%(template)s}}-malen." - -#: ukbot/contest.py:529 -msgid "Day" -msgstr "Dag" - -#: ukbot/contest.py:530 -msgid "Points" -msgstr "Poeng" - -#: ukbot/contest.py:533 ukbot/contest.py:748 ukbot/contest.py:935 -#: ukbot/contest.py:936 ukbot/contest.py:937 -msgid "%e. %B %Y, %H:%M" -msgstr "%e. %B %Y, %H:%M" - -#: ukbot/contest.py:534 -#, python-format -msgid "Updated %(date)s" -msgstr "Oppdatert %(date)s" - -#: ukbot/contest.py:569 -#, python-format -msgid "Weekly contest for week %(week)d" -msgstr "Ukens konkurranse uke %(week)d" - -#: ukbot/contest.py:571 -#, python-format -msgid "Weekly contest for week %(startweek)d–%(endweek)d" -msgstr "Ukens konkurranse uke %(startweek)d–%(endweek)d" - -#: ukbot/contest.py:649 -msgid "Regards" -msgstr "Hilsen" - -#: ukbot/contest.py:649 -msgid "and" -msgstr "og" - -#: ukbot/contest.py:679 -#, python-format -msgid "" -"Now you must check if the results look ok. If there are error messages at " -"the bottom of the [[%(page)s|contest page]], you should check that the " -"related contributions have been awarded the correct number of points. Also " -"check if there are comments or complaints on the discussion page. If " -"everything looks fine, [%(link)s click here] (and save) to indicate that I " -"can send out the awards at first occasion." -msgstr "" -"Du må nå sjekke resultatene. Hvis det er feilmeldinger nederst på [[%(page)s|" -"konkurransesiden]] må du sjekke om de relaterte bidragene har fått poengene " -"de skal ha. Se også etter om det er kommentarer eller klager på " -"diskusjonssiden. Hvis alt ser greit ut kan du trykke [%(link)s her] (og " -"lagre), så sender jeg ut rosetter ved første anledning." - -#: ukbot/contest.py:680 -msgid "Thanks, ~~~~" -msgstr "Hilsen ~~~~" - -#: ukbot/contest.py:691 -#, python-format -msgid "Awards have been [%(link)s sent out]." -msgstr "Rosetter er nå [%(link)s sendt ut]." - -#: ukbot/contest.py:880 ukbot/ukbot.py:148 ukbot/ukbot.py:151 -msgid "UKBot encountered a problem" -msgstr "UKBot støtte på et problem" - -#: ukbot/contest.py:930 -msgid "" -"This contest is closed – thanks to everyone who participated! Awards will be " -"sent out as soon as the contest organizer has checked the results." -msgstr "" -"Konkurransen er avsluttet – takk til alle som deltok! Rosetter vil sendes ut " -"så snart konkurransearrangøren har sjekket resultatene." - -#: ukbot/contest.py:932 -msgid "This contest is closed – thanks to everyone who participated!" -msgstr "Denne konkurransen er avsluttet – takk til alle som deltok!" - -#: ukbot/contest.py:939 -#, python-format -msgid "" -"Last updated %(lastupdate)s. The contest is open from %(startdate)s to " -"%(enddate)s." -msgstr "" -"Sist oppdatert %(lastupdate)s. Konkurransen er åpen fra %(startdate)s til " -"%(enddate)s." - -#: ukbot/contest.py:960 -#, python-format -msgid "UKBot encountered the following problems with the page [[%s]]" -msgstr "UKBot støtte på problemer med siden [[:%s]]" - -#: ukbot/contest.py:994 -#, python-format -msgid "Results markers %(start_marker)s and %(end_marker)s not found" -msgstr "Resultatmarkørene %(start_marker)s og %(end_marker)s ble ikke funnet" - -#: ukbot/contest.py:1005 -#, python-format -msgid "No \"%(section_name)s\" section found." -msgstr "Ingen seksjon med navn «%(section_name)s» funnet." - -#: ukbot/contest.py:1015 -msgid "Updating with final results, the contest is now closed." -msgstr "" -"Oppdaterer med endelige resultater og merker konkurransen som avsluttet." - -#: ukbot/contest.py:1017 -msgid "Checking results and handing out awards" -msgstr "Sjekker resultater og deler ut rosetter" - -#: ukbot/contest.py:1019 -msgid "Updating" -msgstr "Oppdaterer" - -#: ukbot/contest.py:1149 -#, python-format -msgid "The weekly contest is: %(link)s" -msgstr "Ukens konkurranse er: %(link)s" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "suspended since" -msgstr "suspendert siden" - -#: ukbot/contributions.py:164 ukbot/user.py:674 -msgid "%A, %H:%M" -msgstr "%A klokka %H.%M" - -#: ukbot/contributions.py:178 ukbot/user.py:679 -msgid "No qualifying contributions registered yet" -msgstr "Ingen kvalifiserte bidrag har blitt registrert enda" - -#: ukbot/contributions.py:181 -#, fuzzy, python-format -msgid "%d article" -msgid_plural "%d articles" -msgstr[0] "" -"%(articlecount)d {{subst:PLURAL:%(articlecount)d|artikkel|artikler}}" -msgstr[1] "" -"%(articlecount)d {{subst:PLURAL:%(articlecount)d|artikkel|artikler}}" - -#: ukbot/contributions.py:187 -msgid "{{Kolonner}}" -msgstr "{{Kolonner}}" - -#: ukbot/contributions.py:221 -msgid "%d.%m, %H:%M" -msgstr "%e. %B %Y, %H:%M" - -#: ukbot/contributions.py:229 -msgid "capped at max" -msgstr "avgrenset til maks" - -#: ukbot/contributions.py:265 -msgid "Category hit" -msgstr "Kategoritreff" - -#: ukbot/contributions.py:278 -#, fuzzy, python-format -msgid "Total: %(bytecount)d bytes, %(wordcount)d words" -msgstr "" -"Totalt: {{formatnum:%(bytecount)d}} {{subst:PLURAL:%(bytecount)d|byte}}, " -"%(wordcount)d {{subst:PLURAL:%(wordcount)d|ord}}" - -#: ukbot/contributions.py:293 -msgid "" -"Note: The contributions to this article are currently " -"disqualified." -msgstr "" -"Merk: Bidragene til denne artikkelen er for tiden " -"diskvalifisert." - -#: ukbot/contributions.py:302 -msgid "N" -msgstr "N" - -#: ukbot/contributions.py:305 -#, fuzzy -msgid "W" -msgstr "N" - -#: ukbot/filters.py:150 -msgid "Too few arguments given to this template." -msgstr "For få argumenter sendt til denne malen." - -#: ukbot/filters.py:198 -#, python-format -msgid "" -"Could not analyze page %(article)s because the revision %(rev)d could not be " -"parsed: %(error)s" -msgstr "" -"Kunne ikke analysere siden %(article)s fordi sideversjon %(rev)d ikke kunne " -"tolkes: %(error)s" - -#: ukbot/filters.py:233 -msgid "Could not parse the catignore page" -msgstr "Klarte ikke å tolke catignore-siden" - -#: ukbot/filters.py:238 -msgid "No category values given!" -msgstr "Ingen kategoriverdier gitt!" - -#: ukbot/filters.py:444 -msgid "Encountered an infinite category loop: " -msgstr "Havnet i en endeløs kategoriløkke: " - -#: ukbot/filters.py:483 -msgid "No byte limit (second argument) given" -msgstr "Ingen bytegrense (argument nr. 2) gitt" - -#: ukbot/filters.py:720 -#, python-format -msgid "No \"%s\" parameter given" -msgstr "Ingen parameter med navn «%s» gitt" - -#: ukbot/revision.py:132 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because no words were found in the " -"parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed " -"tags or templates in that revision." -msgstr "" -"Sideversjon [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: " -"Ingen ord ble funnet i foreldrerevisjonen (%(parentid)s) med størrelse " -"%(size)d. Dette kan skyldes uavsluttede tagger eller maler, som vil medføre " -"at ordtellingen blir feil, men det kan også skyldes lagring av et " -"arbeidsutkast." - -#: ukbot/revision.py:142 -#, python-format -msgid "" -"Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The " -"word count difference might be wrong, because the word count increase " -"(%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts " -"can occur for invalid wiki text." -msgstr "" -"Sideversjon [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: " -"Økningen i antall ord (%(words)d) er større enn økningen i antall byte " -"(%(bytes)d). Det bør sjekkes om ordtellingen er riktig." - -#: ukbot/sites.py:63 -#, python-format -msgid "Page does not exist: [[%(pagename)s]]" -msgstr "Siden finnes ikke: [[%(pagename)s]]" - -#: ukbot/sites.py:80 -#, python-format -msgid "Could not find a site matching the prefix \"%(key)s\"" -msgstr "Kunne ikke finne en wiki som matcher prefikset «%(key)s»" - -#: ukbot/ukbot.py:169 -#, python-format -msgid "#REDIRECT [[%s]]" -msgstr "#OMDIRIGERING [[%s]]" - -#: ukbot/ukbot.py:171 -#, python-format -msgid "Redirecting to %s" -msgstr "Omdirigerer til %s" - -#: ukbot/user.py:681 -msgid "articles" -msgstr "%(articlecount)d {{subst:PLURAL:%(articlecount)d|artikkel|artikler}}" - -#: ukbot/user.py:683 -msgid "{{Kolonner}}\n" -msgstr "{{Kolonner}}\n" - -#: ukbot/rules/byte.py:20 -#, python-format -msgid "%(bytes).f bytes" -msgstr "%(bytes).f {{subst:PLURAL:%(bytes).f|byte}}" - -#: ukbot/rules/contrib.py:16 -msgid "contribution" -msgstr "bidrag" - -#: ukbot/rules/external_link.py:30 -msgid "links" -msgstr "%(links).f {{subst:PLURAL:%(links).f|lenke|lenker}}" - -#: ukbot/rules/image.py:142 -msgid "images" -msgstr "%(images).f {{subst:PLURAL:%(images).f|bilde|bilder}}" - -#: ukbot/rules/new.py:16 -msgid "new page" -msgstr "ny side" - -#: ukbot/rules/qualified.py:22 -msgid "qualified" -msgstr "kvalifisert" - -#: ukbot/rules/redirect.py:16 -msgid "redirect" -msgstr "omdirigering" - -#: ukbot/rules/ref.py:81 -msgid "references" -msgstr "{{subst:PLURAL:%(num)d|én kilde|%(num)d kilder}}" - -#: ukbot/rules/ref.py:85 -msgid "reference pointers" -msgstr "" -"{{subst:PLURAL:%(num)d|én henvisning til navngitt kilde|%(num)d henvisninger " -"til navngitte kilder}}" - -#: ukbot/rules/regexp.py:19 -msgid "regexp" -msgstr "regulært uttrykk" - -#: ukbot/rules/regexp.py:44 -msgid "section" -msgstr "seksjon" - -#: ukbot/rules/rule.py:76 -#, python-format -msgid "bonus %(words)d words" -msgstr "bonus %(words)d {{subst:PLURAL:%(words)d|ord}}" - -#: ukbot/rules/templateremoval.py:88 -#, python-format -msgid "removal of {{tl|%(template)s}}" -msgstr "fjerning av {{ml|%(template)s}}" - -#: ukbot/rules/wikidata.py:47 -#, python-format -msgid "label (%(lang)s)" -msgstr "etikett (%(lang)s)" - -#: ukbot/rules/wikidata.py:53 -#, python-format -msgid "description (%(lang)s)" -msgstr "beskrivelse (%(lang)s)" - -#: ukbot/rules/wikidata.py:59 -#, python-format -msgid "alias (%(lang)s)" -msgstr "alias (%(lang)s)" - -#: ukbot/rules/wikidata.py:72 -#, python-format -msgid "%(property)s statement" -msgstr "%(property)s-påstand" - -#: ukbot/rules/wikidata.py:73 -#, python-format -msgid "%(count)d %(property)s statements" -msgstr "%(count)d %(property)-{{subst:PLURAL:%(count)d|påstand|påstander}}" - -#: ukbot/rules/word.py:20 -#, python-format -msgid "%(words).f words" -msgstr "%(words).f {{subst:PLURAL:%(words).f|ord}}" - -#~ msgid "" -#~ "No template (second argument) given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "" -#~ "Ingen mal (andre argument) ble gitt til {{mlp|%(template)s|%(firstarg)s}}" - -#, fuzzy -#~| msgid "" -#~| "No template (second argument) given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgid "" -#~ "No byte limit (second argument) given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "" -#~ "Ingen mal (andre argument) ble gitt til {{mlp|%(template)s|%(firstarg)s}}" - -#~ msgid "No categories given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Ingen kategorier gitt til {{mlp|%(template)s|%(firstarg)s}}" - -#, fuzzy -#~ msgid "" -#~ "No \"%(query)s\" parameter given to {{tlx|%(template)s|%(firstarg)s}}" -#~ msgstr "Ingen kategorier gitt til {{mlp|%(template)s|%(firstarg)s}}" - -#~ msgid "Unknown argument given to {{tl|%(template)s}}: %(argument)s" -#~ msgstr "Ukjent argument gitt til {{tl|%(template)s}}: %(argument)s" - -#~ msgid "This contest is missing a {{tl|%(template)s}} template." -#~ msgstr "Denne konkurransen mangler en {{tl|%(template)s}}-mal." - -#~ msgid "" -#~ "Did not find %(week)s+%(year)s or %(start)s+%(end)s in {{tl|" -#~ "%(templates)s}}." -#~ msgstr "" -#~ "Fant ikke %(week)s+%(year)s eller %(start)s+%(end)s i {{tl|" -#~ "%(templates)s}}." - -#~ msgid "" -#~ "Note that the contest this week is [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Join in!" -#~ msgstr "" -#~ "Husk at denne ukens konkurranse er [[%(url)s|{{%(template)s|" -#~ "%(weekarg)s=%(week)s}}]]. Lykke til!" - -#~ msgid "max" -#~ msgstr "maks" - -#~ msgid "added reference section" -#~ msgstr "la til referanseavsnitt" - -#~ msgid "bonus %(bytes).f bytes" -#~ msgstr "bonus %(bytes).f {{subst:PLURAL:%(bytes).f|byte}}" - -#~ msgid "Found no \"%(section)s\" sections in the page \"%(page)s\"" -#~ msgstr "Fant ingen \"%(section)s\"-seksjoner på siden \"%(page)s\"" diff --git a/ukbot/article.py b/ukbot/article.py index 2ad606a..ac79dfb 100644 --- a/ukbot/article.py +++ b/ukbot/article.py @@ -55,8 +55,6 @@ def created_at(self): ts = next(res)['timestamp'] self._created_at = pytz.utc.localize(datetime.fromtimestamp(time.mktime(ts))) - # self._created = time.strftime('%Y-%m-%d %H:%M:%S', ts) - # datetime.fromtimestamp(rev.timestamp).strftime('%F %T') cur.execute( 'INSERT INTO articles (site, name, created_at) VALUES (%s, %s, %s)', [self.site().key, self.key, self._created_at.strftime('%Y-%m-%d %H:%M:%S')] diff --git a/ukbot/common.py b/ukbot/common.py index c77ab63..dd79a88 100644 --- a/ukbot/common.py +++ b/ukbot/common.py @@ -1,9 +1,9 @@ # encoding=utf-8 from __future__ import unicode_literals import sys -import locale -import gettext import yaml +import json +import re import os import psutil import pkg_resources @@ -11,76 +11,71 @@ logger = logging.getLogger(__name__) -# LOCALE_PATH = pkg_resources.resource_filename('ukbot', 'locale/') -LOCALE_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "locale") - -logger.info('Locale path: %s', LOCALE_PATH) - STATE_NORMAL = 'normal' STATE_ENDING = 'ending' STATE_CLOSING = 'closing' - -# Singleton class Localization: class __Localization: def __init__(self): - self.t = lambda x: x - self._ = lambda x: x - - def init(self, cl): - '''prepare i18n''' - if not isinstance(cl, list): - cl = [cl] - #['nb_NO.UTF-8', 'nb_NO.utf8', 'no_NO']: - for loc in cl: - try: - # print "Trying (", loc.encode('utf-8'), 'utf-8',")" - locale.setlocale(locale.LC_ALL, (loc, 'utf-8')) - logger.info('Using locale %s', loc) - #logger.info('Locale set to %s' % loc) - break - except locale.Error: - try: - locstr = loc + '.UTF-8' - # print "Trying",locstr - locale.setlocale(locale.LC_ALL, locstr ) - logger.info('Using locale %s', loc) - break - except locale.Error: - pass - - lang, charset = locale.getlocale() - if lang == None: - raise StandardError('Failed to set locale!') - - t = gettext.translation('messages', LOCALE_PATH, fallback=True, languages=[lang]) - - self.t = t - self._ = t.gettext + self.messages = lambda x: x + self.site = lambda x: x + + def init(self, homesite): + messages = homesite.api( + 'parse', + text='{{subst:#invoke:UKB|getAllI18n}}', + pst=1, + onlypst=1, + contentmodel='wikitext' + )['parse']['text']['*'] + messages = json.loads(messages) + + self.messages = messages + self.site = homesite instance = None def __init__(self): if not Localization.instance: Localization.instance = Localization.__Localization() - # else: - # Localization.instance.val = arg def __getattr__(self, name): return getattr(self.instance, name) - localization = Localization() -def ngettext(*args, **kwargs): - try: - return localization.t.ngettext(*args, **kwargs) - except AttributeError: - # During tests, Localization might not be initialized - return args[0] - -def _(*args, **kwargs): - return localization._(*args, **kwargs) +def i18n(*args): + """ + Returns a string from the i18n file saved in Commons. + + TODO: Make more resilient in case key is not present in the file (and other things?) + """ + logger.debug('Arguments to i18n(): %s' % '|'.join([str(x) for x in args])) + if len(args) == 0: + raise ValueError('At least one argument (message key) must be given') + message = '{{#invoke:UKB|getMessage|%s}}' % args[0] # Fallback if key doesn't exist + if args[0] not in localization.messages: + return message + message = localization.messages[args[0]] + for i in range(1, len(args)): + message = message.replace('$' + str(i), str(args[i])) + # Add subst: in front of some magic words, so they don't appear in wikitext + replacements = ['PLURAL', 'GENDER', 'GRAMMAR', '#time'] + message = re.sub(re.compile('\{\{(' + '|'.join(replacements) + r'):'), '{{subst:\\1:', message) + return message + +def fetch_parsed_i18n(*args): + """ + Fetch and return the contents of an i18n message. This should only used in + two cases: + - 1. The string will not be used in a MediaWiki environment + - 2. The string will be used in edit summaries + For all cases where text is output to wiki, the i18n() function should be used instead. + """ + logger.debug('Arguments to fetch_parsed_i18n(): %s', '|'.join([str(x) for x in args])) + if len(args) <= 1: + return i18n(*args) + return localization.site.api('parse', text=i18n(*args), pst=1, onlypst=1, contentmodel='wikitext')['parse']['text']['*'] logfile = sys.stdout def log(msg, newline = True): @@ -89,14 +84,12 @@ def log(msg, newline = True): logfile.write(msg.encode('utf-8')) logfile.flush() - process = psutil.Process(os.getpid()) def get_mem_usage(): """ Returns memory usage in MBs """ return process.memory_info().rss / 1024.**2 - class InvalidContestPage(Exception): """Raised when wikitext input is not on the expected form, so we don't find what we're looking for""" diff --git a/ukbot/contest.py b/ukbot/contest.py index 1297b3f..9997791 100644 --- a/ukbot/contest.py +++ b/ukbot/contest.py @@ -17,7 +17,7 @@ from mwtemplates import TemplateEditor from .rules import NewPageRule, ByteRule, WordRule, RefRule, ImageRule, TemplateRemovalRule, SectionRule -from .common import _, STATE_ENDING, STATE_CLOSING, InvalidContestPage +from .common import STATE_ENDING, STATE_CLOSING, InvalidContestPage, i18n, fetch_parsed_i18n from .rules import rule_classes from .filters import CatFilter, TemplateFilter, NewPageFilter, ExistingPageFilter, ByteFilter, SparqlFilter, \ BackLinkFilter, ForwardLinkFilter, NamespaceFilter, PageFilter @@ -62,7 +62,7 @@ def get_type(value): for k, v in translations['params'].items(): if v.get('name') == value: return k - raise InvalidContestPage(_('The filter name "%s" was not understood') % value) + raise InvalidContestPage(i18n('bot-filter-misunderstood', value)) self.type = get_type(self.anon_params[1].lower()) @@ -152,11 +152,11 @@ def extract_userlist(self, txt): lst = [] m = re.search(r'==\s*%s\s*==' % self.config['contestPages']['participantsSection'], txt) if not m: - raise InvalidContestPage(_("Couldn't find the list of participants!")) + raise InvalidContestPage(i18n('bot-no-participant-list')) deltakerliste = txt[m.end():] m = re.search('==[^=]+==', deltakerliste) if not m: - raise InvalidContestPage('Fant ingen overskrift etter deltakerlisten!') + raise InvalidContestPage('Couldn\'t find any header following the list of participants!') deltakerliste = deltakerliste[:m.start()] for d in deltakerliste.split('\n'): q = re.search(r'\[\[(?:[^|\]]+):([^|\]]+)', d) @@ -180,11 +180,7 @@ def extract_rules(self, txt, catignore_page=''): dp = TemplateEditor(txt) if config['templates']['rule']['name'] not in dp.templates: - raise InvalidContestPage(_('There are no point rules defined for this contest. Point rules are defined by {{tl|%(template)s}}.') % {'template': config['templates']['rule']['name']}) - - #if not 'ukens konkurranse kriterium' in dp.templates.keys(): - # raise InvalidContestPage('Denne konkurransen har ingen bidragskriterier. Kriterier defineres med {{tl|ukens konkurranse kriterium}}.') - + raise InvalidContestPage(i18n('bot-no-rules', '{{subst:ns:}}:' + config['templates']['rule']['name'])) ######################## Read infobox ######################## @@ -192,9 +188,6 @@ def extract_rules(self, txt, catignore_page=''): self.start = infobox['start_time'] self.end = infobox['end_time'] - # args = {'week': commonargs['week'], 'year': commonargs['year'], 'start': ibcfg['start'], 'end': ibcfg['end'], 'template': ibcfg['name']} - # raise InvalidContestPage(_('Did not find %(week)s+%(year)s or %(start)s+%(end)s in {{tl|%(templates)s}}.') % args) - self.year = self.start.isocalendar()[0] self.startweek = self.start.isocalendar()[1] self.endweek = self.end.isocalendar()[1] @@ -210,7 +203,6 @@ def extract_rules(self, txt, catignore_page=''): ######################## Read filters ######################## nfilters = 0 - # print dp.templates.keys() filter_template_config = config['templates']['filters'] if filter_template_config['name'] in dp.templates: for template in dp.templates[filter_template_config['name']]: @@ -235,17 +227,17 @@ def extract_rules(self, txt, catignore_page=''): msg = str(exp) if any(fe in msg for fe in fatal_errors): raise InvalidContestPage( - _('Could not parse {{tlx|%(template)s|%(firstarg)s}} template: %(err)s') - % { - 'template': filter_template_config['name'], - 'firstarg': filter_tpl.anon_params[1], - 'err': msg - } - ) + i18n( + 'bot-no-parse', + '{{subst:ns:10}}:' + filter_template_config['name'], + filter_tpl.anon_params[1], + msg + ) + ) # Otherwise, treat as warning and continue logger.warning('Non-fatal filter error: %s', msg) try: - self.sites.homesite.errors.append(_('Warning: %(msg)s') % {'msg': msg}) + self.sites.homesite.errors.append(i18n('bot-warning', msg)) except Exception as e: logger.warning('Could not attach warning to homesite: %s', e) continue @@ -271,10 +263,7 @@ def extract_rules(self, txt, catignore_page=''): try: rule_cls = rule_classes_map[rule_name] except: - raise InvalidContestPage( - _('Unkown argument given to {{tl|%(template)s}}: %(argument)s') - % {'template': rulecfg['name'], 'argument': rule_name} - ) + raise InvalidContestPage(i18n('bot-unknown-argument', '{{subst:ns:10}}:' + rulecfg['name'], rule_name)) rule = rule_cls(self.sites, rule_template.parameters, rulecfg) rules.append(rule) @@ -303,9 +292,8 @@ def extract_rules(self, txt, catignore_page=''): try: sdate = self.wiki_tz.localize(datetime.strptime(cleanup_input(template.parameters[2].value), '%Y-%m-%d %H:%M')) except ValueError: - raise InvalidContestPage(_("Couldn't parse the date given to the {{tl|%(template)s}} template.") % sucfg['name']) + raise InvalidContestPage(i18n('bot-unknown-date', '{{subst:ns:10}}:' + sucfg['name'])) - #print 'Suspendert bruker:',uname,sdate ufound = False for u in self.users: if u.name == uname: @@ -315,7 +303,6 @@ def extract_rules(self, txt, catignore_page=''): if not ufound: pass # TODO: logging.warning - #raise InvalidContestPage('Fant ikke brukeren %s gitt til {{tl|UK bruker suspendert}}-malen.' % uname) dicfg = self.config['templates']['disqualified'] if dicfg['name'] in dp.templates: @@ -336,7 +323,7 @@ def extract_rules(self, txt, catignore_page=''): u.disqualified_articles.append(article_key) ufound = True if not ufound: - raise InvalidContestPage(_('Could not find the user %(user)s given to the {{tl|%(template)s}} template.') % {'user': uname, 'template': dicfg['name']}) + raise InvalidContestPage(i18n('bot-unknown-user', uname, '{{subst:ns:10}}:' + dicfg['name'])) pocfg = self.config['templates']['penalty'] if pocfg['name'] in dp.templates: @@ -349,10 +336,7 @@ def extract_rules(self, txt, catignore_page=''): site = self.sites.from_prefix(site_key) if site is None: - raise InvalidContestPage(_('Failed to parse the %(template)s template: Did not find a site matching the site prefix %(prefix)s') % { - 'template': pocfg['name'], - 'prefix': site_key, - }) + raise InvalidContestPage(i18n('bot-parse-no-site', '{{subst:ns:10}}:' + pocfg['name'], site_key)) points = float(cleanup_input(templ.parameters[3].value).replace(',', '.')) reason = cleanup_input(templ.parameters[4].value) @@ -368,10 +352,7 @@ def extract_rules(self, txt, catignore_page=''): }) ufound = True if not ufound: - raise InvalidContestPage(_("Couldn't find the user %(user)s given to the {{tl|%(template)s}} template.") % { - 'user': uname, - 'template': pocfg['name'], - }) + raise InvalidContestPage(i18n('bot-unknown-user', uname, '{{subst:ns:10}}:' + pocfg['name'])) pocfg = self.config['templates']['bonus'] if pocfg['name'] in dp.templates: @@ -389,10 +370,7 @@ def extract_rules(self, txt, catignore_page=''): break if site is None: - raise InvalidContestPage(_('Failed to parse the %(template)s template: Did not find a site matching the site prefix %(prefix)s') % { - 'template': pocfg['name'], - 'prefix': site_key, - }) + raise InvalidContestPage(i18n('bot-parse-no-site', '{{subst:ns:10}}:' + pocfg['name'], site_key)) points = float(cleanup_input(templ.parameters[3].value).replace(',', '.')) reason = cleanup_input(templ.parameters[4].value) @@ -408,10 +386,7 @@ def extract_rules(self, txt, catignore_page=''): }) ufound = True if not ufound: - raise InvalidContestPage(_("Couldn't find the user %(user)s given to the {{tl|%(template)s}} template.") % { - 'user': uname, - 'template': pocfg['name'], - }) + raise InvalidContestPage(i18n('bot-unknown-user', uname, '{{subst:ns:10}}:' + pocfg['name'])) return rules, filters @@ -444,7 +419,6 @@ def plot(self, plotdata): fig = plt.figure(figsize=(w, h)) ax = fig.add_subplot(1, 1, 1, frame_on=True) - # ax.grid(True, which='major', color='gray', alpha=0.5) fig.subplots_adjust(left=0.10, bottom=0.09, right=0.65, top=0.94) t0 = float(unix_time(self.start)) @@ -477,7 +451,6 @@ def plot(self, plotdata): y.append(y[-1]) l = ax.plot(x, y, linewidth=1.2, label=result['name']) # markerfacecolor='#FF8C00', markeredgecolor='#888888', label = u['name']) c = l[0].get_color() - #ax.plot(x[1:-1], y[1:-1], marker='.', markersize=4, markerfacecolor=c, markeredgecolor=c, linewidth=0., alpha=0.5) # markerfacecolor='#FF8C00', markeredgecolor='#888888', label = u['name']) if cnt >= 15: break @@ -527,12 +500,6 @@ def plot(self, plotdata): ax.set_xticks(x_ticks_minor, minor=True) x_ticks_minor_size = 3 - # ax.set_xticklabels(['1', '', '', '', '5', '', '', '', '', '10', '', '', '', '', '15', '', '', '', '', '20', '', '', '', '', '25', '', '', '', '', '30'], minor=True) - # elif ndays == 31: - # ax.set_xticklabels(['1', '', '', '', '5', '', '', '', '', '10', '', '', '', '', '15', '', '', '', '', '20', '', '', '', '', '25', '', '', '', '', '', '31'], minor=True) - - - for i in range(1, ndays, 2): ax.axvspan(xt[i], xt[i + 1], facecolor='#000099', linewidth=0., alpha=0.03) @@ -552,22 +519,18 @@ def plot(self, plotdata): ax.set_xlim(t0, xt[-1]) ax.set_ylim(0, 1.05 * np.max(yall)) - ax.set_xlabel(_('Day')) - ax.set_ylabel(_('Points')) + ax.set_xlabel(fetch_parsed_i18n('bot-day')) + ax.set_ylabel(fetch_parsed_i18n('bot-points')) now = self.server_tz.localize(datetime.now()) - now2 = now.astimezone(self.wiki_tz).strftime(_('%e. %B %Y, %H:%M')) - ax_title = _('Updated %(date)s') - - #print ax_title.encode('utf-8') - #print now2.encode('utf-8') - ax_title = ax_title % {'date': now2} + now2 = now.astimezone(self.wiki_tz).strftime('%Y-%m-%dT%H:%M:%S') + wikiformat_datetime = fetch_parsed_i18n('bot-date-time-format', now2) + ax_title = fetch_parsed_i18n('bot-updated-time', wikiformat_datetime) ax.set_title(ax_title) plt.legend() ax = plt.gca() ax.legend( - # ncol = 4, loc = 3, bbox_to_anchor = (0., 1.02, 1., .102), mode = "expand", borderaxespad = 0. loc=2, bbox_to_anchor=(1.0, 1.0), borderaxespad=0., frameon=0. ) figname = os.path.join(self.project_dir, self.config['plot']['figname'] % {'year': self.year, 'week': self.startweek, 'month': self.month}) @@ -592,9 +555,9 @@ def format_msg(self, template_name, awards): def format_heading(self): if self.config.get('contest_type') == 'weekly': if self.startweek == self.endweek: - return _('Weekly contest for week %(week)d') % {'week': self.startweek} + return i18n('bot-weekly-contest-single', self.startweek) else: - return _('Weekly contest for week %(startweek)d–%(endweek)d') % {'startweek': self.startweek, 'endweek': self.endweek} + return i18n('bot-weekly-contest-multiple', self.startweek, self.endweek) else: return self.config.get('name') % {'month': self.month, 'year': self.year} @@ -604,6 +567,7 @@ def deliver_message(self, username, topic, body, sig='~~~~'): prefix = self.sites.homesite.namespaces[3] prefixed = prefix + ':' + username + # FIXME: Remove Flow specific code when Flow is completely removed from Wikimedia wikis res = self.sites.homesite.api(action='query', prop='flowinfo', titles=prefixed) pageinfo = list(res['query']['pages'].values())[0] flow_enabled = 'missing' not in pageinfo and 'enabled' in pageinfo['flowinfo']['flow'] @@ -634,9 +598,6 @@ def deliver_prices(self, results, simulate=False): logger.info('Delivering prices for contest %d' % (contest_id,)) - # self.sql.commit() - # cur.close() - for i, result in enumerate(results): prices = [] @@ -672,7 +633,7 @@ def deliver_prices(self, results, simulate=False): 'url': self.config['pages']['default'] % dateargs, **dateargs, } - sig = _('Regards') + ' ' + ', '.join(['[[%s:%s|%s]]' % (userprefix, s, s) for s in self.ledere]) + ' ' + _('and') + ' ~~~~' + sig = i18n('bot-greeting', ', '.join(['[[%s:%s|%s]]' % (userprefix, s, s) for s in self.ledere]), '~~~~') if not simulate: cur.execute('SELECT prize_id FROM prizes WHERE contest_id=%s AND site=%s AND user=%s', [contest_id, self.sites.homesite.key, result['name']]) @@ -702,8 +663,8 @@ def deliver_ended_contest_notification(self): raise Exception('No organizer award found in config') for u in self.ledere: mld = self.format_msg('organizer_template', awards) - mld += _('Now you must check if the results look ok. If there are error messages at the bottom of the [[%(page)s|contest page]], you should check that the related contributions have been awarded the correct number of points. Also check if there are comments or complaints on the discussion page. If everything looks fine, [%(link)s click here] (and save) to indicate that I can send out the awards at first occasion.') % {'page': self.name, 'link': link} - sig = _('Thanks, ~~~~') + mld += i18n('bot-note-to-organizer', self.name, link) + sig = i18n('bot-thanks', '~~~~') logger.info('Delivering notification about ended contenst to the contest organizers') self.deliver_message(u, heading, mld, sig) @@ -714,10 +675,10 @@ def deliver_receipt_to_leaders(self): args = {'prefix': self.sites.homesite.site['server'] + self.sites.homesite.site['script'], 'page': 'Special:Contributions'} link = '%(prefix)s?title=%(page)s&contribs=user&target=UKBot&namespace=3' % args - mld = '\n:' + _('Awards have been [%(link)s sent out].') % {'link': link} + mld = '\n:' + i18n('bot-awards-sent', link ) for u in self.ledere: page = self.sites.homesite.pages['%s:%s' % (usertalkprefix, u)] - logger.info('Leverer kvittering til %s', page.name) + logger.info('Sending leader delivery receipt to %s', page.name) # Find section number txt = page.text() @@ -725,7 +686,7 @@ def deliver_receipt_to_leaders(self): try: csection = sections.index(heading) + 1 except ValueError: - logger.error('Fant ikke "%s" i "%s', heading, page.name) + logger.error('Couldn\'t find "%s" in "%s"', heading, page.name) return # Append text to section @@ -765,13 +726,14 @@ def deliver_warnings(self, simulate=False): """ usertalkprefix = self.sites.homesite.namespaces[3] cur = self.sql.cursor() + # FIXME: Fix hard-coded Norwegian messages (or remove this functionality completely?) for u in self.users: msgs = [] if u.suspended_since is not None: d = [self.sites.homesite.key, self.name, u.name, 'suspension', ''] cur.execute('SELECT id FROM notifications WHERE site=%s AND contest=%s AND user=%s AND class=%s AND args=%s', d) if len(cur.fetchall()) == 0: - msgs.append('Du er inntil videre suspendert fra konkurransen med virkning fra %s. Dette innebærer at dine bidrag gjort etter dette tidspunkt ikke teller i konkurransen, men alle bidrag blir registrert og skulle suspenderingen oppheves i løpet av konkurranseperioden vil også bidrag gjort i suspenderingsperioden telle med. Vi oppfordrer deg derfor til å arbeide med problemene som førte til suspenderingen slik at den kan oppheves.' % u.suspended_since.strftime(_('%e. %B %Y, %H:%M'))) + msgs.append('Du er inntil videre suspendert fra konkurransen med virkning fra %s. Dette innebærer at dine bidrag gjort etter dette tidspunkt ikke teller i konkurransen, men alle bidrag blir registrert og skulle suspenderingen oppheves i løpet av konkurranseperioden vil også bidrag gjort i suspenderingsperioden telle med. Vi oppfordrer deg derfor til å arbeide med problemene som førte til suspenderingen slik at den kan oppheves.' % u.suspended_since.strftime('%e. %B %Y, %H:%M')) if not simulate: cur.execute('INSERT INTO notifications (site, contest, user, class, args) VALUES (%s,%s,%s,%s,%s)', d) discs = [] @@ -795,16 +757,10 @@ def deliver_warnings(self, simulate=False): heading = '== Viktig informasjon angående Ukens konkurranse uke %d ==' % self.startweek else: heading = '== Viktig informasjon angående Ukens konkurranse uke %d–%d ==' % (self.startweek, self.endweek) - #msg = 'Arrangøren av denne [[%(pagename)s|ukens konkurranse]] har registrert problemer ved noen av dine bidrag: - #så langt. Det er dessverre registrert problemer med enkelte av dine bidrag som medfører at vi er nødt til å informere deg om følgende:\n' % { 'pagename': self.name } msg = ''.join(['* %s\n' % m for m in msgs]) msg += 'Denne meldingen er generert fra anmerkninger gjort av konkurransearrangør på [[%(pagename)s|konkurransesiden]]. Du finner mer informasjon på konkurransesiden og/eller tilhørende diskusjonsside. Så lenge konkurransen ikke er avsluttet, kan problemer løses i løpet av konkurransen. Om du ønsker det, kan du fjerne denne meldingen når du har lest den. ~~~~' % {'pagename': self.name} - #print '------------------------------',u.name - #print msg - #print '------------------------------' - page = self.sites.homesite.pages['%s:%s' % (usertalkprefix, u.name)] logger.info('Leverer advarsel til %s', page.name) if simulate: @@ -826,13 +782,7 @@ def run(self, simulate=False, output=''): stats = [] - # extraargs = {'namespace': 0} extraargs = {} - # host_filter = None - # for f in self.filters: - # if isinstance(f, NamespaceFilter): - # extraargs['namespace'] = '|'.join(f.namespaces) - # host_filter = f.site article_errors = {} results = [] @@ -903,7 +853,7 @@ def run(self, simulate=False, output=''): if simulate: logger.error(out) else: - self.page.save('dummy', summary=_('UKBot encountered a problem'), appendtext=out) + self.page.save('dummy', summary=fetch_parsed_i18n('bot-problem-encountered'), appendtext=out) raise del user @@ -917,7 +867,6 @@ def run(self, simulate=False, output=''): # Make outpage out = '' - #out += '[[File:Nowp Ukens konkurranse %s.svg|thumb|400px|Resultater (oppdateres normalt hver natt i halv ett-tiden, viser kun de ti med høyest poengsum)]]\n' % self.start.strftime('%Y-%W') summary_tpl = None if 'status' in config['templates']: @@ -952,17 +901,16 @@ def run(self, simulate=False, output=''): now = self.server_tz.localize(datetime.now()) if self.state == STATE_ENDING: - # Konkurransen er nå avsluttet – takk til alle som deltok! Rosetter vil bli delt ut så snart konkurransearrangøren(e) har sjekket resultatene. - out += "''" + _('This contest is closed – thanks to everyone who participated! Awards will be sent out as soon as the contest organizer has checked the results.') + "''\n\n" + out += "''" + i18n('bot-contest-limbo') + "''\n\n" elif self.state == STATE_CLOSING: - out += "''" + _('This contest is closed – thanks to everyone who participated!') + "''\n\n" + out += "''" + i18n('bot-contest-closed') + "''\n\n" else: oargs = { - 'lastupdate': now.astimezone(self.wiki_tz).strftime(_('%e. %B %Y, %H:%M')), - 'startdate': self.start.strftime(_('%e. %B %Y, %H:%M')), - 'enddate': self.end.strftime(_('%e. %B %Y, %H:%M')) + 'lastupdate': now.astimezone(self.wiki_tz).strftime('%Y-%m-%dT%H:%M:%S'), + 'startdate': self.start.strftime('%Y-%m-%dT%H:%M:%S'), + 'enddate': self.end.strftime('%Y-%m-%dT%H:%M:%S') } - out += "''" + _('Last updated %(lastupdate)s. The contest is open from %(startdate)s to %(enddate)s.') % oargs + "''\n\n" + out += "''" + i18n('bot-contest-last-updated', i18n('bot-date-time-format', oargs['lastupdate']), i18n('bot-date-format', oargs['startdate']), i18n('bot-date-format', oargs['enddate'])) + "''\n\n" for i, result in enumerate(results): awards = '' @@ -983,7 +931,7 @@ def run(self, simulate=False, output=''): if len(err) > 8: err = err[:8] err.append('(...)') - errors.append('\n* ' + _('UKBot encountered the following problems with the page [[%s]]') % art + ''.join(['\n** %s' % e for e in err])) + errors.append('\n* ' + i18n('bot-page-problem', art ) + ''.join(['\n** %s' % e for e in err])) for site in self.sites.sites.values(): for error in site.errors: @@ -1017,10 +965,7 @@ def run(self, simulate=False, output=''): except StopIteration: if 'resultsSection' not in config['contestPages']: - raise InvalidContestPage(_('Results markers %(start_marker)s and %(end_marker)s not found') % { - 'start_marker': '', - 'end_marker': '', - }) + raise InvalidContestPage(i18n('bot-result-markers-not-found', '<!-- Begin:ResultsSection -->', '<!-- End:ResultsSection -->' )) for s in re.finditer(r'^[\s]*==([^=]+)==[\s]*\n', txt, flags=re.M): if s.group(1).strip() == config['contestPages']['resultsSection']: secstart = s.end() @@ -1028,9 +973,7 @@ def run(self, simulate=False, output=''): secend = s.start() break if secstart == -1: - raise InvalidContestPage(_('No "%(section_name)s" section found.') % { - 'section_name': config['contestPages']['resultsSection'], - }) + raise InvalidContestPage(i18n('bot-no-named-section', config['contestPages']['resultsSection'])) if secend == -1: txt = txt[:secstart] + out else: @@ -1038,11 +981,11 @@ def run(self, simulate=False, output=''): logger.info('Updating wiki') if self.state == STATE_ENDING: - self.page.save(txt, summary=_('Updating with final results, the contest is now closed.')) + self.page.save(txt, summary=fetch_parsed_i18n('bot-updating-results')) elif self.state == STATE_CLOSING: - self.page.save(txt, summary=_('Checking results and handing out awards')) + self.page.save(txt, summary=fetch_parsed_i18n('bot-checking-results')) else: - self.page.save(txt, summary=_('Updating')) + self.page.save(txt, summary=fetch_parsed_i18n('bot-updating')) if output != '': logger.info("Writing output to file") @@ -1130,20 +1073,13 @@ def run(self, simulate=False, output=''): page = self.sites.homesite.pages[aws['pagename']] page.save(text=aws['sent'], summary=aws['sent'], bot=True) - # if not simulate: - # - # Skip for now: not Flow compatible - # self.deliver_receipt_to_leaders() - logger.info('Cleaning database') if not simulate: self.delete_contribs_from_db() # Notify users about issues - # self.deliver_warnings(simulate=simulate) - - # Update Wikipedia:Portal/Oppslagstavle + # Update noticeboards if 'noticeboard' in config: boardname = config['noticeboard']['name'] @@ -1156,7 +1092,7 @@ def run(self, simulate=False, output=''): dp = TemplateEditor(txt) ntempl = len(dp.templates[tplname]) if ntempl != 1: - raise Exception('Feil: Fant %d %s-maler i %s' % (ntempl, tplname, boardname)) + raise Exception('Error: Found %d %s templates in %s' % (ntempl, tplname, boardname)) tpl = dp.templates[tplname][0] now2 = now.astimezone(self.wiki_tz) @@ -1164,7 +1100,7 @@ def run(self, simulate=False, output=''): logger.info('Updating noticeboard: %s', boardname) tpllist = config['templates']['contestlist'] commonargs = config['templates']['commonargs'] - tema = self.sites.homesite.api('parse', text='{{subst:%s|%s=%s}}' % (tpllist['name'], commonargs['week'], now2.strftime('%Y-%V')), pst=1, onlypst=1)['parse']['text']['*'] + tema = self.sites.homesite.api('parse', text='{{subst:%s|%s=%s}}' % (tpllist['name'], commonargs['week'], now2.strftime('%Y-%V')), pst=1, onlypst=1, contentmodel='wikitext')['parse']['text']['*'] tpl.parameters[1] = tema tpl.parameters[boardtpl['date']] = now2.strftime('%e. %h') tpl.parameters[commonargs['year']] = now2.isocalendar()[0] @@ -1172,7 +1108,7 @@ def run(self, simulate=False, output=''): txt2 = dp.wikitext() if txt != txt2: if not simulate: - oppslagstavle.save(txt2, summary=_('The weekly contest is: %(link)s') % {'link': tema}) + oppslagstavle.save(txt2, summary=i18n('bot-weekly-contest-is', tema)) # Make a nice plot diff --git a/ukbot/contests.py b/ukbot/contests.py index a478dd7..edc65f3 100644 --- a/ukbot/contests.py +++ b/ukbot/contests.py @@ -13,7 +13,7 @@ def award_delivery_confirmed(site, config, page_title): confirmation_message = config['send'] if status_page.exists: - lastrev = next(status_page.revisions(prop='user|comment|content', slots='main')) + lastrev = status_page.revisions(prop='user|comment|content', slots='main').next() if lastrev['comment'].find('/* %s */' % confirmation_message) == -1 and lastrev['slots']['main']['*'].find(confirmation_message) == -1: logger.info('Contest [[%s]] is to be closed, but award delivery has not been confirmed yet', page_title) else: diff --git a/ukbot/contributions.py b/ukbot/contributions.py index 45a4e20..1806c72 100644 --- a/ukbot/contributions.py +++ b/ukbot/contributions.py @@ -2,7 +2,7 @@ # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai import logging import weakref -from .common import _, ngettext +from .common import i18n logger = logging.getLogger(__name__) @@ -18,6 +18,7 @@ def __init__(self, user, config): self.user = weakref.ref(user) self.contributions = [] self.labels = {} + self.config = config self.wikidata_languages = config['wikidata_languages'] def add(self, contribution): @@ -93,17 +94,6 @@ def calculate_contribution_points(self, contribution): return contribution.raw_points - # rev.points.append([pts, ptype, txt + ' > ' + _('max'), points]) - - # elif not self.iszero(revpoints): - # else: - # if self.iszero(points) and not include_zero: - # return False - # pts = points - # rev.points.append([points, ptype, txt, points]) - # if pts > 0.0: - # return True - def get_article_points(self, article, ignore_max=False, ignore_suspension_period=False, ignore_disqualification=False, ignore_point_deductions=False): @@ -136,14 +126,6 @@ def get_article_points(self, article, ignore_max=False, ignore_suspension_period return points - # p = 0. - # for revid, rev in self.revisions.items(): - # dt = pytz.utc.localize(datetime.fromtimestamp(rev.timestamp)) - # if ignore_suspension_period is True or self.user().suspended_since is None or dt < self.user().suspended_since: - # p += rev.get_points(ptype, ignore_max, ignore_point_deductions) - # else: - # logger.debug('!! Skipping revision %d in suspension period', revid) - def get_articles(self): return sorted( list(set([contrib.article for contrib in self.contributions])), @@ -161,30 +143,26 @@ def format(self, homesite): suspended = '' if self.user().suspended_since is not None: - suspended = ', ' + _('suspended since') + ' %s' % self.user().suspended_since.strftime(_('%A, %H:%M')) + suspended = ', ' + i18n('bot-suspended-since', i18n('bot-format-date-time', self.user().suspended_since.strftime('%Y-%m-%dT%H:%M:%S'))) - user_prefix = homesite.namespaces[2] - - out = '=== %s [[%s:%s|%s]] (%.f p%s) ===\n' % ( - award_icon, - user_prefix, - self.user().name, - self.user().name, - self.sum(), - suspended - ) + out = '=== %s %s ===\n' % ( award_icon, i18n('bot-results-user-heading', '[[{{subst:ns:2}}:%s|%s]]' % (self.user().name, self.user().name), self.sum(), suspended)) if len(entries) == 0: - out += "''%s''" % _('No qualifying contributions registered yet') + out += "''%s''" % i18n('bot-no-contributions-yet') else: sum_bytes = sum([item['value'] for item in self.user().count_bytes_per_site()]) - out += ngettext('%d article', '%d articles', len(entries)) % len(entries) + out += i18n('bot-article-number', len(entries)) out += ', ' out += '{{formatnum:%.2f}} kB' % (sum_bytes / 1000.) out += '\n' + if 'columns' in self.config['templates']: + column_template = '{{%s}}' % self.config['templates']['columns'] + else: + column_template = '
' + if len(entries) > 10: - out += _('{{Kolonner}}') + '\n' + out += column_template + '\n' out += '\n'.join(entries) out += '\n\n' @@ -218,7 +196,7 @@ def summarize_revision(self, revision, homesite): if len(revision_contribs) == 0: return None - formatted = '[[%s|%s]]: ' % (revision.get_link(homesite), revision.wiki_tz.strftime(_('%d.%m, %H:%M'))) + formatted = '[[%s|%s]]: ' % (revision.get_link(homesite), i18n('bot-date-time-format-short', revision.wiki_tz.strftime('%Y-%m-%dT%H:%M:%S'))) # Make a formatted string on this form: # 10.0 p (ny side) + 9.7 p (967 byte) + 5.4 p (54 ord) + 10.0 p (2 kilder) @@ -226,16 +204,16 @@ def summarize_revision(self, revision, homesite): for contribution in revision_contribs: desc = contribution.description if contribution.capped: - desc += ', ' + _('capped at max') - contrib_points.append('%.1f p (%s)' % (contribution.points, desc)) + desc += ', ' + i18n('bot-capped-at-max') + contrib_points.append(i18n('bot-points-short', '%.1f' % contribution.points, desc)) formatted += ' + '.join(contrib_points) # Add deductions, if any for deduction in revision.point_deductions: if deduction[0] > 0: - formatted += ' − %.1f p (%s)' % (deduction[0], deduction[1]) + formatted += ' − %s' % i18n('bot-points-short', '%.1f' % deduction[0], deduction[1]) else: - formatted += ' + %.1f p (%s)' % (- deduction[0], deduction[1]) + formatted += ' + %s' % i18n('bot-points-short', '%.1f' % deduction[0], deduction[1]) # Strikeout if revision was in suspended period if self.user().suspended_since is not None and revision.utc > self.user().suspended_since: @@ -253,32 +231,17 @@ def summarize_article(self, article, revisions_formatted): ignore_disqualification=True) netto = self.get_article_points(article) - # if brutto == 0.0: - # logger.debug(' %s: skipped (0 points)', article.key) - # continue - - # for contrib in contribs: - tooltip_text = '' try: cat_path = [x.split(':')[-1] for x in article.cat_path] - tooltip_text = "''" + _('Category hit') + "'': " + ' > '.join(cat_path) + '
' + tooltip_text = "''" + i18n('bot-category-hit') + "'': " + ' > '.join(cat_path) + '
' except AttributeError: pass tooltip_text += '
'.join(revisions_formatted) - # if len(article.point_deductions) > 0: - # pds = [] - # for points, reason in article.point_deductions: - # pds.append('%.f p: %s' % (-points, reason)) - # titletxt += '
\'\'' + _('Notes') + ':\'\'
%s
' % '
'.join(pds) - if article.words > 0: - tooltip_text += '
%s.
' % ( - _('Total: %(bytecount)d bytes, %(wordcount)d words') % { - 'bytecount': article.bytes, - 'wordcount': article.words - } + tooltip_text += '
%s.
' % ( # FIXME inline styling + i18n('bot-byte-word-count', article.bytes, article.words) ) if article.name in self.labels: @@ -288,27 +251,24 @@ def summarize_article(self, article, revisions_formatted): else: formatted = '[[%s|%s]]' % (article.link(), article.name) if article.key in self.user().disqualified_articles: - formatted = '[[File:Qsicon Achtung.png|14px]] ' + formatted + '' - tooltip_text += '
%s
' % ( - _('Note: The contributions to this article are currently disqualified.') + formatted = '[[File:Qsicon Achtung.png|14px]] ' + formatted + '' # FIXME inline image + tooltip_text += '
%s
' % ( # FIXME inline styling + i18n('bot-disqualified-note') ) elif brutto != netto: - formatted = '[[File:Qsicon Achtung.png|14px]] ' + formatted - # titletxt += '
Merk: - # En eller flere revisjoner er ikke talt med fordi de ble gjort mens brukeren var suspendert. - # Hvis suspenderingen oppheves vil bidragene telle med.
' + formatted = '[[File:Qsicon Achtung.png|14px]] ' + formatted # FIXME inline image if article.new: - formatted += ' ' + _('N') + formatted += ' ' + i18n('bot-new-page-abbr') if article.site().host == 'www.wikidata.org': - formatted += ' ' + _('W') + formatted += ' ' + i18n('bot-wikidata-abbr') - points = '%.1f p' % brutto + points = i18n('bot-points-sum', '%.1f' % brutto) if brutto != netto: points = '' + points + ' ' if netto != 0.: - points += '%.1f p' % netto + points += i18n('bot-points-sum', '%.1f' % netto) formatted += ' (%s)' % points formatted = '# ' + formatted @@ -364,18 +324,3 @@ def site(self): @property def user(self): return self.rev.article().user() - - # def get_points(self, ptype='', ignore_max=False, ignore_point_deductions=False): - # p = 0.0 - # for pnt in self.points: - # if ptype == '' or pnt[1] == ptype: - # if ignore_max and len(pnt) > 3: - # p += pnt[3] - # else: - # p += pnt[0] - - # if not ignore_point_deductions and (ptype == '' or ptype == 'trekk'): - # for points, reason in self.point_deductions: - # p -= points - - # return p diff --git a/ukbot/filters.py b/ukbot/filters.py index 3ef41be..7731534 100644 --- a/ukbot/filters.py +++ b/ukbot/filters.py @@ -13,7 +13,7 @@ from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from mwtemplates.templateeditor2 import TemplateParseError -from .common import _, InvalidContestPage +from .common import InvalidContestPage, i18n from .site import WildcardPage from typing import List, Union, Optional @@ -87,67 +87,13 @@ def filter(self, articles: 'Articles'): type(self).__name__, len(articles), len(out)) return out -#class StubFilter(Filter): -# """ Filters articles that was stubs, but is no more """ - -# def __init__(self): -# Filter.__init__(self) - -# def is_stub(self, text): -# """ Checks if a given text is a stub """ - -# m = re.search(r'{{[^}]*(?:stubb|spire)[^}]*}}', text, re.IGNORECASE) -# if m: -# if self.verbose: -# log(" >> %s " % m.group(0), newline = False) -# return True -# return False - - #def filter(self, articles): - - # out = OrderedDict() - # for article_key, article in articles.items(): - - # firstrevid = article.revisions.firstkey() - # lastrevid = article.revisions.lastkey() - - # firstrev = article.revisions[firstrevid] - # lastrev = article.revisions[lastrevid] - - # try: - - # # skip pages that are definitely not stubs to avoid timeconsuming parsing - # if article.new is False and article.redirect is False and len(firstrev.parenttext) < 20000: - - # # Check if first revision is a stub - # if self.is_stub(firstrev.parenttext): - - # # Check if last revision is a stub - # if not self.is_stub(lastrev.text): - - # out[article_key] = article - - # if self.verbose: - # log('') - - #except DanmicholoParseError as e: - # log(" >> DanmicholoParser failed to parse " + article_key) - # parentid = firstrev.parentid - # args = { 'article': article_key, 'prevrev': firstrev.parentid, 'rev': lastrev.revid, 'error': e.msg } - # article.site().errors.append(_('Could not analyze the article %(article)s because one of the revisions %(prevrev)d or %(rev)d could not be parsed: %(error)s') % args) - - # log(" [+] Applying stub filter: %d -> %d" % (len(articles), len(out))) - - # return out - - class TemplateFilter(Filter): """ Filters articles that had any of a given set of templates (or their aliases) at a point""" @classmethod def make(cls, tpl, **kwargs): if len(tpl.anon_params) < 3: - raise RuntimeError(_('Too few arguments given to this template.')) + raise RuntimeError(i18n('bot-too-few-arguments')) params = { 'sites': tpl.sites, @@ -195,11 +141,7 @@ def test_page(self, page): except TemplateParseError as e: logger.warning('TemplateParser failed to parse %s', page.key) page.site().errors.append( - _('Could not analyze page %(article)s because the revision %(rev)d could not be parsed: %(error)s') % { - 'article': page.key, - 'rev': rev.parentid, - 'error': str(e), - } + i18n('bot-unable-to-analyze', page.key, rev.parentid, str(e)) ) if template_name is None: @@ -230,12 +172,39 @@ def get_ignore_list(tpl: 'FilterTemplate', page_name: str): m = re.search(r'
(.*?)
', catignore_txt, flags=re.DOTALL) return m.group(1).strip().splitlines() except (IndexError, KeyError): - raise RuntimeError(_('Could not parse the catignore page')) + raise RuntimeError(i18n('bot-catignore-parse-error')) @classmethod def make(cls, tpl: 'FilterTemplate', **kwargs): if len(tpl.anon_params) < 3: - raise RuntimeError(_('No category values given!')) + raise RuntimeError(i18n('bot-no-category-values')) + + # Build category list, catching missing categories as warnings + categories = [] + for cat_name in tpl.anon_params[2:]: + if cat_name.strip() == '': + continue + # Check for interwiki prefix + prefix = cat_name.split(':', 1)[0] if ':' in cat_name else None + # Use from_prefix to check if prefix is recognized + if prefix and tpl.sites.from_prefix(prefix) is None: + logger.warning('Site "%s" is not included in the contest configuration, so category "%s" was ignored.', prefix, cat_name) + try: + tpl.sites.homesite.errors.append(i18n('bot-warning-site-not-configured', prefix, cat_name)) + except Exception as ex: + logger.warning('Could not attach warning to homesite: %s', ex) + continue + try: + cat_page = tpl.sites.resolve_page(cat_name, 14, True) + categories.append(cat_page) + except InvalidContestPage as e: + logger.warning('Category does not exist: %s', cat_name) + try: + self_site = tpl.sites.homesite + self_site.errors.append(i18n('bot-warning-nonexistant-category', cat_name)) + except Exception as ex: + logger.warning('Could not attach warning to homesite: %s', ex) + # Do not abort, just skip this category # Build category list, catching missing categories as warnings categories = [] @@ -455,7 +424,7 @@ def filter(self, articles: 'Articles') -> 'Articles': ) except CategoryLoopError as err: loop = ' → '.join(['[[:%s|]]' % c.replace('.wikipedia.org', '') for c in err.catpath]) - article.errors.append(_('Encountered an infinite category loop: ') + loop) + article.errors.append(i18n('bot-category-loop', loop)) dt = time.time() - t0 logger.debug('CatFilter: Checked categories for %d articles in %.1f secs', len(articles), dt) @@ -494,7 +463,7 @@ class ByteFilter(Filter): @classmethod def make(cls, tpl, sites, **kwargs): if len(tpl.anon_params) < 3: - raise RuntimeError(_('No byte limit (second argument) given')) + raise RuntimeError(i18n('bot-no-byte-limit')) params = { 'sites': tpl.sites, 'bytelimit': int(tpl.anon_params[2]), @@ -619,7 +588,6 @@ def __init__(self, sites, pages, include_langlinks=False): for page in pages: for linked_page in page.links(redirects=True): link = '%s:%s' % (linked_page.site.key, linked_page.name.replace('_', ' ')) - # logger.debug(' - Include: %s', link) self.page_keys.add(link) # Include langlinks as well @@ -731,7 +699,7 @@ class SparqlFilter(Filter): @classmethod def make(cls, tpl, cfg, **kwargs): if not tpl.has_param('query'): - raise RuntimeError(_('No "%s" parameter given') % cfg['params']['query']) + raise RuntimeError(i18n('bot-no-parameter', cfg['params']['query'])) params = { 'query': tpl.get_raw_param('query'), 'sites': tpl.sites, diff --git a/ukbot/revision.py b/ukbot/revision.py index 97008de..43b4342 100644 --- a/ukbot/revision.py +++ b/ukbot/revision.py @@ -9,7 +9,7 @@ import pytz from mwtemplates import TemplateEditor from mwtextextractor import get_body_text -from .common import _ +from .common import i18n logger = logging.getLogger(__name__) @@ -129,33 +129,18 @@ def words(self): self.revid, self.article().site().key, self.bytes, charcount, self._wordcount) if not self.new and words0 == 0 and self._wordcount > 1: - w = _('Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The word count difference might be wrong, because no words were found in the parent revision (%(parentid)s) of size %(size)d, possibly due to unclosed tags or templates in that revision.') % { - 'host': self.article().site().host, - 'revid': self.revid, - 'parentid': self.parentid, - 'size': len(self.parenttext) - } + w = i18n('bot-count-no-words', '[//%s/w/index.php?diff=prev&oldid=%s %s]' % (self.article().site().host, self.revid, self.revid), self.parentid, len(self.parenttext)) logger.warning(w) self.errors.append(w) elif self._wordcount > 10 and self._wordcount > self.bytes: - w = _('Revision [//%(host)s/w/index.php?diff=prev&oldid=%(revid)s %(revid)s]: The word count difference might be wrong, because the word count increase (%(words)d) is larger than the byte increase (%(bytes)d). Wrong word counts can occur for invalid wiki text.') % { - 'host': self.article().site().host, - 'revid': self.revid, - 'words': self._wordcount, - 'bytes': self.bytes - } + w = i18n('bot-word-count-incorrect', '[//%s/w/index.php?diff=prev&oldid=%s %s]' % (self.article().site().host, self.revid, self.revid), self._wordcount, self.bytes) logger.warning(w) self.errors.append(w) - #s = _('A problem encountered with revision %(revid)d may have influenced the word count for this revision: %(problems)s ') - #s = _('Et problem med revisjon %d kan ha påvirket ordtellingen for denne: %s ') del mt1 del mt0 - # except DanmicholoParseError as e: - # log("!!!>> FAIL: %s @ %d" % (self.article().name, self.revid)) - # self._wordcount = 0 - # #raise + return self._wordcount @property diff --git a/ukbot/rules/byte.py b/ukbot/rules/byte.py index 20aa24d..0fe3a10 100644 --- a/ukbot/rules/byte.py +++ b/ukbot/rules/byte.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -17,4 +17,4 @@ def test(self, rev): if bytes_added > 0.: points = bytes_added * self.points yield UserContribution(rev=rev, points=points, rule=self, - description=_('%(bytes).f bytes') % {'bytes': bytes_added}) + description=i18n('bot-rule-bytes', bytes_added)) diff --git a/ukbot/rules/contrib.py b/ukbot/rules/contrib.py index 44adb0c..ea962cf 100644 --- a/ukbot/rules/contrib.py +++ b/ukbot/rules/contrib.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -13,4 +13,4 @@ class ContribRule(Rule): @family('wikipedia.org', 'wikibooks.org') def test(self, rev): yield UserContribution(rev=rev, points=self.points, rule=self.rule, - description=_('contribution')) + description=i18n('bot-rule-contribution')) diff --git a/ukbot/rules/external_link.py b/ukbot/rules/external_link.py index d64d4d3..3bfd4cf 100644 --- a/ukbot/rules/external_link.py +++ b/ukbot/rules/external_link.py @@ -2,7 +2,7 @@ # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai import re -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -27,4 +27,4 @@ def test(self, rev): if links_added > 0: points = links_added * self.points yield UserContribution(rev=rev, points=points, rule=self, - description=_('links') % {'links': links_added}) + description=i18n('bot-rule-links', links_added)) diff --git a/ukbot/rules/image.py b/ukbot/rules/image.py index 75836d7..9307ba3 100644 --- a/ukbot/rules/image.py +++ b/ukbot/rules/image.py @@ -4,7 +4,7 @@ from mwclient.errors import InvalidPageTitle import urllib import logging -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -139,4 +139,4 @@ def test(self, rev): points += self.points yield UserContribution(rev=rev, rule=self, points=points, - description=_('images') % {'images': len(added)}) + description=i18n('bot-rule-images', len(added))) diff --git a/ukbot/rules/new.py b/ukbot/rules/new.py index 58bdc9e..3972838 100644 --- a/ukbot/rules/new.py +++ b/ukbot/rules/new.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -13,4 +13,4 @@ class NewPageRule(Rule): @family('wikipedia.org', 'wikibooks.org') def test(self, rev): if rev.new and not rev.redirect: - yield UserContribution(rev=rev, points=self.points, rule=self, description=_('new page')) + yield UserContribution(rev=rev, points=self.points, rule=self, description=i18n('bot-rule-new-page')) diff --git a/ukbot/rules/qualified.py b/ukbot/rules/qualified.py index 5fa9346..47a602e 100644 --- a/ukbot/rules/qualified.py +++ b/ukbot/rules/qualified.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -19,4 +19,4 @@ def test(self, rev): if rev.article().key not in self.articles_seen: self.articles_seen.add(rev.article().key) yield UserContribution(rev=rev, points=self.points, rule=self, - description=_('qualified')) + description=i18n('bot-rule-eligible')) diff --git a/ukbot/rules/redirect.py b/ukbot/rules/redirect.py index 9f4a70c..4ce57ba 100644 --- a/ukbot/rules/redirect.py +++ b/ukbot/rules/redirect.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -13,4 +13,4 @@ class RedirectRule(Rule): @family('wikipedia.org', 'wikibooks.org') def test(self, rev): if rev.new and rev.redirect: - yield UserContribution(rev=rev, points=self.points, rule=self, description=_('redirect')) + yield UserContribution(rev=rev, points=self.points, rule=self, description=i18n('bot-rule-redirect')) diff --git a/ukbot/rules/ref.py b/ukbot/rules/ref.py index 8cfc793..8ed47e7 100644 --- a/ukbot/rules/ref.py +++ b/ukbot/rules/ref.py @@ -5,7 +5,7 @@ import lxml from mwtextextractor import condition_for_lxml -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -28,8 +28,8 @@ def __init__(self, sites, template, trans=None): @staticmethod def count_sources(txt): - s1 = 0 # kilder - r1 = 0 # kildehenvisninger + s1 = 0 # references + r1 = 0 # reference pointers (re-uses) # Count all tags try: @@ -47,18 +47,6 @@ def count_sources(txt): s1 = 0 r1 = 0 - # Count list item under section heading "Kilder" or "Kjelder" - refsection = False - for line in txt.split('\n'): - if refsection: - if re.match(r'==', line): - refsection = False - continue - if re.match(r'\*', line): - s1 += 1 - elif re.match(r'==[\s]*(Kilder|Kjelder|Gáldut)[\s]*==', line): - refsection = True - return s1, r1 @family('wikipedia.org', 'wikibooks.org') @@ -78,11 +66,11 @@ def test(self, rev): if sources_added > 0: points += sources_added * self.sourcepoints - description.append(_('references') % {'num': sources_added}) + description.append(i18n('bot-rule-references', sources_added)) if refs_added > 0: points += refs_added * self.refpoints - description.append(_('reference pointers') % {'num': refs_added}) + description.append(i18n('bot-rule-reference-reuse', refs_added)) yield UserContribution(rev=rev, points=points, rule=self, description=', '.join(description)) diff --git a/ukbot/rules/regexp.py b/ukbot/rules/regexp.py index 89cb9ac..cc6a3b1 100644 --- a/ukbot/rules/regexp.py +++ b/ukbot/rules/regexp.py @@ -2,7 +2,7 @@ # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai import re import logging -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule @@ -16,7 +16,7 @@ class RegexpRule(Rule): def __init__(self, sites, template, trans=None): Rule.__init__(self, sites, template, trans) self.total = 0 - self.description = self.get_param('description', datatype=str, default=_('regexp')) + self.description = self.get_param('description', datatype=str, default=i18n('bot-rule-regexp')) self.patterns = [re.compile(str(pattern).strip()) for pattern in self.get_anon_params()] def has_pattern(self, txt): @@ -41,5 +41,5 @@ class SectionRule(RegexpRule): def __init__(self, sites, template, trans=None): RegexpRule.__init__(self, sites, template, trans) - self.description = self.get_param('description', datatype=str, default=_('section')) + self.description = self.get_param('description', datatype=str, default=i18n('bot-rule-section')) self.patterns = [re.compile(r'\n===?\s*(?:%s)\s*===?\s*\n' % pattern.pattern) for pattern in self.patterns] diff --git a/ukbot/rules/rule.py b/ukbot/rules/rule.py index b5c8162..c4fbdd9 100644 --- a/ukbot/rules/rule.py +++ b/ukbot/rules/rule.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .decorators import family @@ -73,5 +73,5 @@ def test(self, current_rev): if total >= self.limit and this_rev is True: yield UserContribution(rev=current_rev, points=self.points, rule=self, - description=_('bonus %(words)d words') % {'words': self.limit}) + description=i18n('bot-rule-bonus-words', self.limit)) diff --git a/ukbot/rules/templateremoval.py b/ukbot/rules/templateremoval.py index c729eda..c41e442 100644 --- a/ukbot/rules/templateremoval.py +++ b/ukbot/rules/templateremoval.py @@ -2,7 +2,7 @@ # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai import logging -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -85,5 +85,5 @@ def test(self, rev): if removed > 0: template['total'] += removed yield UserContribution(rev=rev, rule=self, points=removed * self.points, - description=_('removal of {{tl|%(template)s}}') % {'template': template['name']}) + description=i18n('bot-rule-template-removal', '{{subst:ns:10}}:' + template['name'])) diff --git a/ukbot/rules/wikidata.py b/ukbot/rules/wikidata.py index 0522cbf..54e367f 100644 --- a/ukbot/rules/wikidata.py +++ b/ukbot/rules/wikidata.py @@ -4,7 +4,7 @@ import json import logging from jsonpath_rw import parse -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -44,19 +44,19 @@ def __init__(self, sites, params, trans=None): for lang in self.labels: self.matchers['label:%s' % lang] = { 'rules': [parse('labels.%s' % lang)], - 'msg': _('label (%(lang)s)'), + 'msg': i18n('bot-rule-label-lang', lang), 'opts': {'lang': lang}, } for lang in self.descriptions: self.matchers['description:%s' % lang] = { 'rule': [parse('descriptions.%s' % lang)], - 'msg': _('description (%(lang)s)'), + 'msg': i18n('bot-rule-description-lang', lang), 'opts': {'lang': lang}, } for lang in self.aliases: self.matchers['alias:%s' % lang] = { 'rule': [parse('aliases.%s' % lang)], - 'msg': _('alias (%(lang)s)'), + 'msg': i18n('bot-rule-alias-lang', lang), 'opts': {'lang': lang}, } for prop in self.properties: @@ -69,8 +69,7 @@ def __init__(self, sites, params, trans=None): ] self.matchers['prop:%s' % prop] = { 'rules': rules, - 'msg': _('%(property)s statement'), - 'msg_plural': _('%(count)d %(property)s statements'), + 'msg': i18n('bot-rule-properties', '%(count)s', prop), 'opts': {'property': prop}, } diff --git a/ukbot/rules/word.py b/ukbot/rules/word.py index cf61947..787d77d 100644 --- a/ukbot/rules/word.py +++ b/ukbot/rules/word.py @@ -1,6 +1,6 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai -from ..common import _ +from ..common import i18n from ..contributions import UserContribution from .rule import Rule from .decorators import family @@ -17,4 +17,4 @@ def test(self, rev): if words_added > 0.: points = words_added * self.points yield UserContribution(rev=rev, points=points, rule=self, - description=_('%(words).f words') % {'words': words_added}) + description=i18n('bot-rule-words', words_added)) diff --git a/ukbot/server.py b/ukbot/server.py index e1ed41e..80b8ea0 100755 --- a/ukbot/server.py +++ b/ukbot/server.py @@ -14,5 +14,3 @@ fh.setFormatter(formatter) app.logger.addHandler(fh) -# app.debug = True # reload on each code change - diff --git a/ukbot/site.py b/ukbot/site.py index 4890d32..c6ed224 100644 --- a/ukbot/site.py +++ b/ukbot/site.py @@ -27,7 +27,7 @@ def __init__(self, host, prefixes, **kwargs): access_token = os.getenv('MW_ACCESS_TOKEN') access_secret = os.getenv('MW_ACCESS_SECRET') session.auth = OAuth1(consumer_token, consumer_secret, access_token, access_secret) - session.headers['User-Agent'] = 'UKBot (http://tools.wmflabs.org/ukbot/; danmichaelo+wikipedia@gmail.com)' + session.headers['User-Agent'] = 'UKBot (https://ukbot.toolforge.org/; ukbot@wikimedia.no)' self.errors = [] self.name = host diff --git a/ukbot/sites.py b/ukbot/sites.py index f68aa07..2e7c297 100644 --- a/ukbot/sites.py +++ b/ukbot/sites.py @@ -1,7 +1,7 @@ # encoding=utf-8 # vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai import logging -from .common import _, InvalidContestPage +from .common import InvalidContestPage, i18n from .db import db_conn from .site import WildcardPage, Site @@ -60,9 +60,7 @@ def resolve_page(self, value, default_ns=0, force_ns=False): else: page = site.pages[value] if not page.exists: - raise InvalidContestPage(_('Page does not exist: [[%(pagename)s]]') % { - 'pagename': site.link_to(page) - }) + raise InvalidContestPage(i18n('bot-page-doesnt-exist', ':' + site.link_to(page))) return page def from_prefix(self, key, raise_on_error=False): @@ -77,9 +75,7 @@ def from_prefix(self, key, raise_on_error=False): if site.match_prefix(key): return site if raise_on_error: - raise InvalidContestPage(_('Could not find a site matching the prefix "%(key)s"') % { - 'key': key - }) + raise InvalidContestPage(i18n('bot-site-not-found', key)) def only(self, sites): return SiteManager(sites, self.homesite) diff --git a/ukbot/ukbot.py b/ukbot/ukbot.py index 3539826..14f2014 100644 --- a/ukbot/ukbot.py +++ b/ukbot/ukbot.py @@ -19,7 +19,7 @@ from dotenv import load_dotenv from importlib.metadata import version -from .common import get_mem_usage, Localization, _, STATE_NORMAL, InvalidContestPage +from .common import get_mem_usage, STATE_NORMAL, InvalidContestPage, Localization, i18n, fetch_parsed_i18n from .util import load_config from .contest import Contest from .contests import discover_contest_pages @@ -77,9 +77,11 @@ def process_contest(contest_page, contest_state, sites, sql, config, working_dir contest.uploadplot(args.simulate, args.output) elif args.action == 'plot': - filename = os.path.join(working_dir, config['plot']['datafile'] % {'year': contest.year, - 'week': contest.startweek, - 'month': contest.month}) + filename = os.path.join(working_dir, config['plot']['datafile'] % { + 'year': contest.year, + 'week': contest.startweek, + 'month': contest.month + }) with open(filename, 'r') as fp: plotdata = json.load(fp) contest.plot(plotdata) @@ -112,8 +114,6 @@ def main(): working_dir = os.path.realpath(os.getcwd()) logger.info('Working dir: %s', working_dir) - Localization().init(config['locale']) - mainstart = config['server_timezone'].localize(datetime.now()) mainstart_s = time.time() @@ -130,6 +130,8 @@ def main(): sites, sql = init_sites(config) + Localization().init(sites.homesite) + active_contests = list(discover_contest_pages(sql, sites.homesite, config, args.page)) logger.info('Number of active contests: %d', len(active_contests)) @@ -148,10 +150,10 @@ def main(): if status_template in te.templates: te.templates[status_template][0].parameters[1] = 'error' te.templates[status_template][0].parameters[2] = error_msg - contest_page.save(te.wikitext(), summary=_('UKBot encountered a problem')) + contest_page.save(te.wikitext(), summary=fetch_parsed_i18n('bot-problem-encountered')) else: out = '\n{{%s | error | %s }}' % (config['templates']['botinfo'], error_msg) - contest_page.save('dummy', summary=_('UKBot encountered a problem'), appendtext=out) + contest_page.save('dummy', summary=fetch_parsed_i18n('bot-problem-encountered'), appendtext=out) raise # Update redirect page @@ -165,13 +167,16 @@ def main(): if len(normal_contests) == 1: contest_name = normal_contests[0] pages = config['pages']['redirect'] + magic_words = sites.homesite.api('query', meta='siteinfo', siprop='magicwords')['query']['magicwords'] + redirect_localized = next((word for word in magic_words if word['name'] == 'redirect'), None)['aliases'][0] + logger.debug('Magic words for redirects is %s' % redirect_localized) if not isinstance(pages, list): pages = [pages] for pagename in pages: page = sites.homesite.pages[pagename] - txt = _('#REDIRECT [[%s]]') % contest_name + txt = '%s [[%s]]' % (redirect_localized, contest_name) if page.text() != txt and not args.simulate: - page.save(txt, summary=_('Redirecting to %s') % contest_name) + page.save(txt, summary=fetch_parsed_i18n('bot-redirecting', contest_name)) runend = config['server_timezone'].localize(datetime.now()) runend_s = time.time() diff --git a/ukbot/user.py b/ukbot/user.py index 27fd70a..e199110 100644 --- a/ukbot/user.py +++ b/ukbot/user.py @@ -15,7 +15,7 @@ from more_itertools import first from .contributions import UserContributions -from .common import _ +from .common import i18n from .db import result_iterator from .util import unix_time from .article import Article @@ -70,8 +70,6 @@ def add_contribs_from_wiki(self, site, start, end, fulltext=False, **kwargs): fulltext : get revision fulltexts """ - # logger.info('Reading contributions from %s', site.host) - apilim = 50 if 'bot' in site.rights: apilim = site.api_limit # API limit, should be 500 @@ -91,7 +89,6 @@ def add_contribs_from_wiki(self, site, start, end, fulltext=False, **kwargs): ignore_tags = set(self.contest().config['ignoreTags']) logger.debug('Edit tags that should be ignored: %s', ', '.join(sorted(ignore_tags))) new_revisions = [] - # stored_revisions = set(copy(self.revisions.keys())) stored_revisions = set([rev.revid for rev in self.revisions.values() if rev.article().site() == site]) current_revisions = set() t0 = time.time() @@ -114,6 +111,7 @@ def add_contribs_from_wiki(self, site, start, end, fulltext=False, **kwargs): if ignored_tags_present: logger.info('Ignoring revision %d of %s:%s because it has the following edit tags: %s', c['revid'], site_key, c['title'], ', '.join(ignored_tags_present)) + break else: rev_id = c['revid'] article_title = c['title'] @@ -295,22 +293,6 @@ def backfill_article_creation_dates(self, sql): article = articles_by_site[site][row[0]] article._created_at = pytz.utc.localize(row[1]) - # n = 0 - # for article_key, article in articles.items(): - # if article.created_at is None: - # res = site.pages[article.name].revisions(prop='timestamp', limit=1, dir='newer') - # ts = article.created_at = next(res)['timestamp'] - # ts = time.strftime('%Y-%m-%d %H:%M:%S', ts) - # # datetime.fromtimestamp(rev.timestamp).strftime('%F %T') - # cur.execute( - # 'INSERT INTO articles (site, name, created_at) VALUES (%s, %s, %s)', - # [site.name, article_key, ts] - # ) - # n += 1 - # sql.commit() - # if n > 0: - # logger.debug('Backfilled %d article creation dates from %s', n, site.name) - cur.close() def save_contribs_to_db(self, sql): @@ -341,7 +323,6 @@ def save_contribs_to_db(self, sql): chunk_size = 1000 for n in range(0, len(contribs_query_params), chunk_size): data = contribs_query_params[n:n+chunk_size] - # logger.info('Adding %d contributions to database', len(data)) t0 = time.time() cur.executemany(""" @@ -355,7 +336,6 @@ def save_contribs_to_db(self, sql): chunk_size = 100 for n in range(0, len(fulltexts_query_params), chunk_size): data = fulltexts_query_params[n:n+chunk_size] - # logger.info('Adding %d fulltexts to database', len(data)) t0 = time.time() cur.executemany(""" @@ -563,12 +543,6 @@ def analyze(self, rules): # loop over articles for article in self.articles.values(): - # if self.contest().verbose: - # logger.info(article_key) - # else: - # logger.info('.', newline=False) - # log(article_key) - # loop over revisions for revid, rev in article.revisions.items(): @@ -585,14 +559,12 @@ def analyze(self, rules): points = sum([contribution.points for contribution in contributions]) if points > 0: - # logger.debug('%s: %d: %s', self.name, rev.revid, points) ts = float(unix_time(utc.localize(datetime.fromtimestamp(rev.timestamp)).astimezone( self.contest().wiki_tz ))) x.append(ts) y.append(float(points)) - # logger.debug(' %d : %d ', revid, points) logger.debug('[[%s]] Sum: %.1f points', article.name, self.contributions.get_article_points(article=article)) @@ -602,83 +574,30 @@ def analyze(self, rules): o = np.argsort(x) x = x[o] y = y[o] - #pl = np.array(pl, dtype=float) - #pl.sort(axis = 0) y2 = np.array([np.sum(y[:q + 1]) for q in range(len(y))]) self.plotdata = np.column_stack((x, y2)) - #np.savetxt('user-%s'%self.name, np.column_stack((x,y,y2))) def format_result(self): logger.debug('Formatting results for user %s', self.name) entries = [] - - ## WIP - - # <<<<<<< HEAD - # dt = utc.localize(datetime.fromtimestamp(rev.timestamp)) - # dt_str = dt.astimezone(self.contest().wiki_tz).strftime(_('%d.%m, %H:%M')) - # out = '[%s %s]: %s' % (rev.get_link(), dt_str, descr) - # if self.suspended_since is not None and dt > self.suspended_since: - # out = '' + out + '' - # if len(rev.errors) > 0: - # out = '[[File:Ambox warning yellow.svg|12px|%s]] ' % (', '.join(rev.errors)) + out - # revs.append(out) - - # titletxt = '' - # try: - # cat_path = [x.split(':')[-1] for x in article.cat_path] - # titletxt = ' : '.join(cat_path) + '
' - # except AttributeError: - # pass - # titletxt += '
'.join(revs) - # # if len(article.point_deductions) > 0: - # # pds = [] - # # for points, reason in article.point_deductions: - # # pds.append('%.f p: %s' % (-points, reason)) - # # titletxt += '
\'\'' + _('Notes') + ':\'\'
%s
' % '
'.join(pds) - - # titletxt += '
' + _('Total {{formatnum:%(bytecount)d}} bytes, %(wordcount)d words') % {'bytecount': article.bytes, 'wordcount': article.words} + '
' - - # p = '%.1f p' % brutto - # if brutto != netto: - # p = '' + p + ' ' - # if netto != 0.: - # p += '%.1f p' % netto - - # out = '[[%s|%s]]' % (article.link(), article.name) - # if article_key in self.disqualified_articles: - # out = '[[File:Qsicon Achtung.png|14px]] ' + out + '' - # titletxt += '
' + _('Note: The contributions to this article are currently disqualified.') + '
' - # elif brutto != netto: - # out = '[[File:Qsicon Achtung.png|14px]] ' + out - # #titletxt += '
Merk: En eller flere revisjoner er ikke talt med fordi de ble gjort mens brukeren var suspendert. Hvis suspenderingen oppheves vil bidragene telle med.
' - # if article.new: - # out += ' ' + _('N') - # out += ' (%s)' % p - - # out = '# ' + out - # out += '
' + titletxt + '
' - - # entries.append(out) - # logger.debug(' %s: %.f / %.f points', article_key, netto, brutto) - # ======= - # >>>>>>> WIP - ros = '{awards}' - suspended = '' + if 'columns' in self.contest().config['templates']: + column_template = '{{%s}}' % self.contest().config['templates']['columns'] + else: + column_template = '
' + + suspended = '{{subst:ns:0}}' if self.suspended_since is not None: - suspended = ', ' + _('suspended since') + ' %s' % self.suspended_since.strftime(_('%A, %H:%M')) - userprefix = self.contest().sites.homesite.namespaces[2] - out = '=== %s [[%s:%s|%s]] (%.f p%s) ===\n' % (ros, userprefix, self.name, self.name, - self.contributions.sum(), suspended) + suspended = ', ' + i18n('bot-suspended-since', i18n('bot-date-time-format', self.suspended_since.strftime('%Y-%m-%dT%H:%M:%S'))) + out = '=== %s %s ===\n' % (ros, i18n('bot-results-user-heading', '[[{{subst:ns:2}}:%s|%s]]'.format(self.name, self.name), self.contributinos.sum(), suspended)) if len(entries) == 0: - out += "''" + _('No qualifying contributions registered yet') + "''" + out += "''" + i18n('bot-no-contributions-yet') + "''" else: - out += '%s, {{formatnum:%.2f}} kB\n' % (_('articles') % {'articlecount': len(entries)}, self.bytes / 1000.) + out += i18n('bot-articles-kb', len(entries), '%0.2f' % self.bytes / 1000.) if len(entries) > 10: - out += _('{{Kolonner}}\n') + out += column_template + '\n' out += '\n'.join(entries) out += '\n\n' diff --git a/ukbot/util.py b/ukbot/util.py index 42477fb..8c5db06 100644 --- a/ukbot/util.py +++ b/ukbot/util.py @@ -148,12 +148,10 @@ def parse_infobox(page_text, userprefix, config): parsed['awards'].append([award_name, 'pointlimit', int(award_value)]) except ValueError: pass - # raise InvalidContestPage('Klarte ikke tolke verdien til parameteren %s gitt til {{tl|infoboks ukens konkurranse}}.' % col) winner_awards = [k for k, v in award_cfg.items() if v.get('winner') is True] if len(parsed['awards']) != 0 and 'winner' not in [award[1] for award in parsed['awards']]: winner_awards = ', '.join(['{{para|%s|%s}}' % (k, infobox_cfg['winner']) for k in winner_awards]) - # raise InvalidContestPage(_('Found no winner award in {{tl|%(template)s}}. Winner award is set by one of the following: %(awards)s.') % {'template': ibcfg['name'], 'awards': winner_awards}) logger.warning( 'Found no winner award in {{tl|%s}}. Winner award is set by one of the following: %s.', infobox_cfg['name'],