jenkins-bot has submitted this change and it was merged.

Change subject: 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
---
A scripts/missing-qq.py
1 file changed, 24 insertions(+), 0 deletions(-)

Approvals:
  BearND: Looks good to me, approved
  Deskana: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/scripts/missing-qq.py b/scripts/missing-qq.py
new file mode 100644
index 0000000..94a7727
--- /dev/null
+++ b/scripts/missing-qq.py
@@ -0,0 +1,24 @@
+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!"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I33b51f314aea841dda9f11bbcaf22158ee73960b
Gerrit-PatchSet: 4
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Deskana <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Deskana <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to