import os
import xml.etree.ElementTree as ET

RES_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), "../wikipedia/res"))
EN_STRINGS = os.path.join(RES_FOLDER, "values/strings.xml")
QQ_STRINGS = os.path.join(RES_FOLDER, "values-qq/strings.xml")

# Get ElementTree containing all message names in English
enroot = ET.parse(EN_STRINGS).getroot()

# Get ElementTree containing all documented messages
qqroot = ET.parse(QQ_STRINGS).getroot()

# Create a set to store all documented messages
qqmsgs = set()

# Add all documented messages to that set
for child in qqroot:
    qqmsgs.add(child.attrib['name'])

# Iterate through all messages and check that they're documented
for child in enroot:
    if child.attrib['name'] not in qqmsgs:
        print child.attrib['name'] + " is undocumented!"

Add script to find undocumented translations.
Add script to find undocumented translations.

To my knowledge there's no convenient way to find out if a string is missing a
translation into a particular language. For us this means that it's not easy
to check all of our strings and make sure they have documentation for our
translators. This patch adds a Python script that, when run, will tell you
what messages are undocumented.

Change-Id: I33b51f314aea841dda9f11bbcaf22158ee73960b
