Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jbzdarkid committed Jan 5, 2025
1 parent 0fa681e commit 5bd71d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lang_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def pagescraper(page, missing_english, invalid_langs, duplicate_langs, misordere
location = lang_template.pop(0)

# Error 1: Missing english string
if not(any((x[0] == 'en' for x in lang_template))):
if not any((x[0] == 'en' for x in lang_template)):
missing_english[page].append(location)

actual_order = []
Expand Down Expand Up @@ -55,7 +55,7 @@ def main(w):
Found '''<onlyinclude>{count}</onlyinclude>''' pages with {{{{tl|lang}}}} errors. Data as of {date}.
""".format(
count=sum((len(e) for e in errors)),
count=len(missing_english) + len(invalid_langs) + len(duplicate_langs) + len(misordered_langs),
date=time_and_date())

if len(missing_english) > 0:
Expand Down
3 changes: 1 addition & 2 deletions untranslated_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def get_indices(char, string):
lang_templates = []

for match in LANG_TEMPLATE_START.finditer(page_text):
english_text = None
lang_template = []
for match2 in LANG_TEMPLATE_ARGS.finditer(buffer[match.start() + 2]): # Skip the opening {{
language = match2.group(1).strip().lower()
Expand All @@ -99,7 +98,7 @@ def pagescraper(page, translations, usage_counts):
location = lang_template.pop(0)

missing_languages = set(LANGS)
for lang, text in lang_template:
for lang, _ in lang_template:
missing_languages.discard(lang)

for language in missing_languages:
Expand Down

0 comments on commit 5bd71d7

Please sign in to comment.