Deskana has uploaded a new change for review.

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

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, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/86/185786/1

diff --git a/scripts/missing-qq.py b/scripts/missing-qq.py
new file mode 100644
index 0000000..5b64148
--- /dev/null
+++ b/scripts/missing-qq.py
@@ -0,0 +1,21 @@
+import xml.etree.ElementTree as ET
+
+# Get ElementTree containing all message names in English
+entree = ET.parse("../wikipedia/res/values/strings.xml")
+enroot = entree.getroot()
+
+# Get ElementTree containing all documented messages
+qqtree = ET.parse("../wikipedia/res/values-qq/strings.xml")
+qqroot = qqtree.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: newchange
Gerrit-Change-Id: I33b51f314aea841dda9f11bbcaf22158ee73960b
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Deskana <[email protected]>

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

Reply via email to