Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/266073

Change subject: [L10N] use sitename to find the the corresponding site.
......................................................................

[L10N] use sitename to find the the corresponding site.

bug: T94681
Change-Id: I0eaca5b35435984be5e7516e7e5dc8ebba21cf5e
---
M scripts/misspelling.py
1 file changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/266073/1

diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index 52da484..a132897 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -57,18 +57,18 @@
     """Spelling bot."""
 
     misspellingTemplate = {
-        'de': ('Falschschreibung', 'Obsolete Schreibung'),
+        'wikipedia:de': ('Falschschreibung', 'Obsolete Schreibung'),
     }
 
     # Optional: if there is a category, one can use the -start
     # parameter.
     misspellingCategory = {
-        'da': u'Omdirigeringer af fejlstavninger',  # only contains date 
redirects at the moment
-        'de': ('Kategorie:Wikipedia:Falschschreibung',
+        'wikipedia:da': u'Omdirigeringer af fejlstavninger',  # only contains 
date redirects at the moment
+        'wikipedia:de': ('Kategorie:Wikipedia:Falschschreibung',
                'Kategorie:Wikipedia:Obsolete Schreibung'),
-        'en': u'Redirects from misspellings',
-        'hu': u'Átirányítások hibás névről',
-        'nl': u'Categorie:Wikipedia:Redirect voor spelfout',
+        'wikipedia:en': u'Redirects from misspellings',
+        'wikipedia:hu': u'Átirányítások hibás névről',
+        'wikipedia:nl': u'Categorie:Wikipedia:Redirect voor spelfout',
     }
 
     def __init__(self, always, firstPageTitle, main_only):
@@ -83,9 +83,9 @@
 
         @rtype: generator
         """
-        mylang = self.site.code
-        if mylang in self.misspellingCategory:
-            categories = self.misspellingCategory[mylang]
+        sitename = self.site.sitename
+        if sitename in self.misspellingCategory:
+            categories = self.misspellingCategory[sitename]
             if isinstance(categories, basestring):
                 categories = (categories, )
             generators = (
@@ -93,8 +93,8 @@
                     pywikibot.Category(self.site, misspellingCategoryTitle),
                     recurse=True, start=firstPageTitle)
                 for misspellingCategoryTitle in categories)
-        elif mylang in self.misspellingTemplate:
-            templates = self.misspellingTemplate[mylang]
+        elif sitename in self.misspellingTemplate:
+            templates = self.misspellingTemplate[sitename]
             if isinstance(templates, basestring):
                 templates = (templates, )
             generators = (
@@ -127,9 +127,9 @@
         if disambPage.isRedirectPage():
             self.alternatives.append(disambPage.getRedirectTarget().title())
             return True
-        if self.misspellingTemplate.get(disambPage.site.code) is not None:
+        if self.misspellingTemplate.get(disambPage.site.sitename) is not None:
             for template, params in disambPage.templatesWithParams():
-                templates = self.misspellingTemplate[disambPage.site.code]
+                templates = self.misspellingTemplate[disambPage.site.sitename]
                 if isinstance(templates, basestring):
                     templates = (templates, )
                 if template.title(withNamespace=False) in templates:

-- 
To view, visit https://gerrit.wikimedia.org/r/266073
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0eaca5b35435984be5e7516e7e5dc8ebba21cf5e
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to