diff --git a/data/po/extract_strings_from_XML.py b/data/po/extract_strings_from_XML.py index 49948ba0a..ce30ebb8a 100755 --- a/data/po/extract_strings_from_XML.py +++ b/data/po/extract_strings_from_XML.py @@ -16,7 +16,17 @@ def traverse(file, node, isChallenge, isGP, isKart, isTrack, level=0): comment = None if e.hasAttribute("I18N"): comment = e.getAttribute("I18N") - + + if e.localName == "subtitle" and e.hasAttribute("text") and len(e.getAttribute("text")) > 0: + #print "Label=", e.getAttribute("name"), " Comment=", comment + line = "" + if comment == None: + line += "//I18N: Cutscene subtitle from " + file + "\n_(\"" + e.getAttribute("text") + "\")\n\n" + else: + line += "//I18N: Cutscene subtitle from " + file + "\n//I18N: " + comment + "\n_(\"" + e.getAttribute("text") + "\");\n\n" + + f.write( line.encode( "utf-8" ) ) + if isChallenge or isGP or isKart or isTrack: if e.hasAttribute("name") and len(e.getAttribute("name")) > 0: #print "Label=", e.getAttribute("name"), " Comment=", comment diff --git a/data/po/update_pot.sh b/data/po/update_pot.sh index 139842fda..3366e02f8 100755 --- a/data/po/update_pot.sh +++ b/data/po/update_pot.sh @@ -3,7 +3,7 @@ # ./data/po/update_pot.sh CPP_FILE_LIST="`find ./src -name '*.cpp' -print` `find ./src -name '*.hpp' -print`" -XML_FILE_LIST="`find ./data -name 'track.xml' -print` `find ./data -name '*.challenge' -print` `find ./data -name '*.grandprix' -print`" +XML_FILE_LIST="`find ./data -name 'track.xml' -print` `find ./data -name 'scene.xml' -print` `find ./data -name '*.challenge' -print` `find ./data -name '*.grandprix' -print`" OTHER_XML_FILES=`find ./data -name '*.stkgui' -print && find ./data -name '*.challenge' -print && find ./data -name '*.grandprix' -print && find ./data -name 'kart.xml' -print` echo "--------------------"