Revert "Allow music title to be translatable, fix #4281"
Some translator and stk fans think it is confusing
This commit is contained in:
@@ -5,7 +5,7 @@ import codecs
|
||||
f = open('./data/po/gui_strings.h', 'w')
|
||||
f.write( codecs.BOM_UTF8 )
|
||||
|
||||
def traverse(file, node, isChallenge, isGP, isKart, isTrack, isAchievements, isMusic, level=0):
|
||||
def traverse(file, node, isChallenge, isGP, isKart, isTrack, isAchievements, level=0):
|
||||
|
||||
for e in node.childNodes:
|
||||
if e.localName == None:
|
||||
@@ -16,12 +16,7 @@ def traverse(file, node, isChallenge, isGP, isKart, isTrack, isAchievements, isM
|
||||
comment = None
|
||||
if e.hasAttribute("I18N"):
|
||||
comment = e.getAttribute("I18N")
|
||||
|
||||
if isMusic and e.hasAttribute("title") and len(e.getAttribute("title")) > 0:
|
||||
line = ""
|
||||
line += "//I18N: Music title from " + file + "\n_(\"" + e.getAttribute("title") + "\");\n\n"
|
||||
f.write( line.encode( "utf-8" ) )
|
||||
|
||||
|
||||
if e.localName == "subtitle" and e.hasAttribute("text") and len(e.getAttribute("text")) > 0:
|
||||
#print "Label=", e.getAttribute("name"), " Comment=", comment
|
||||
line = ""
|
||||
@@ -66,7 +61,7 @@ def traverse(file, node, isChallenge, isGP, isKart, isTrack, isAchievements, isM
|
||||
|
||||
# don't recurse in children nodes for karts, they can contain sounds, etc. that should not be translated
|
||||
if not isKart:
|
||||
traverse(file, e, isChallenge, isGP, isKart, isTrack, isAchievements, isMusic, level+1)
|
||||
traverse(file, e, isChallenge, isGP, isKart, isTrack, isAchievements, level+1)
|
||||
|
||||
filenames = sys.argv[1:]
|
||||
for file in filenames:
|
||||
@@ -77,8 +72,7 @@ for file in filenames:
|
||||
isKart = False
|
||||
isTrack = False
|
||||
isAchievements = False
|
||||
isMusic = False
|
||||
|
||||
|
||||
if file.endswith(".challenge"):
|
||||
isChallenge = True
|
||||
if file.endswith(".grandprix"):
|
||||
@@ -89,9 +83,7 @@ for file in filenames:
|
||||
isTrack = True
|
||||
if file.endswith("achievements.xml"):
|
||||
isAchievements = True
|
||||
if file.endswith(".music"):
|
||||
isMusic = True
|
||||
|
||||
|
||||
try:
|
||||
doc = xml.dom.minidom.parse(file)
|
||||
except Exception as ex:
|
||||
@@ -99,5 +91,5 @@ for file in filenames:
|
||||
print("/!\\ Expat doesn't like ", file, "! Error=", type(ex), " (", ex.args, ")")
|
||||
print("============================================")
|
||||
|
||||
traverse(file, doc, isChallenge, isGP, isKart, isTrack, isAchievements, isMusic)
|
||||
traverse(file, doc, isChallenge, isGP, isKart, isTrack, isAchievements)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user