first modification made by script

This commit is contained in:
Eric House 2014-04-11 22:54:13 -07:00
parent 77b87c6458
commit 30b861879a
5 changed files with 21 additions and 12 deletions

View file

@ -24,7 +24,7 @@
<string name="list_item_new_from">Nova</string>
<string name="play">Partida</string>
<string name="title_dicts_list">Diccionaris del Crosswords</string>
<string name="title_game_configf">Configura el %s</string>
<string name="title_game_config_fmt">Configura el %s</string>
<string name="title_prefs">Configuració del Crosswords</string>
<string name="button_ok">D\'acord</string>

View file

@ -24,7 +24,7 @@
<string name="list_item_new_from">Nová hra podle vzoru</string>
<string name="play">Hrát hru</string>
<string name="title_dicts_list">Slovníky Crosswords</string>
<string name="title_game_configf">Konfigurovat %s</string>
<string name="title_game_config_fmt">Konfigurovat %s</string>
<string name="title_prefs">Předvolby Crosswords</string>
<string name="button_ok">OK</string>

View file

@ -25,7 +25,7 @@
(language, player names, etc), is substituted for %2$s. This
does not require translation unless the parentheses or
ordering is wrong for your language.-->
<string name="str_game_namef">%1$s (%2$s)</string>
<string name="str_game_name_fmt">%1$s (%2$s)</string>
<!-- Used to format robot player names in the lists of players
found in each game listing -->

View file

@ -24,7 +24,7 @@
<string name="list_item_new_from">Nová hra podľa vzoru</string>
<string name="play">Hrať hru</string>
<string name="title_dicts_list">Slovníky Crosswords</string>
<string name="title_game_configf">Konfigurovať %s</string>
<string name="title_game_config_fmt">Konfigurovať %s</string>
<string name="title_prefs">Predvoľby Crosswords</string>
<string name="button_ok">OK</string>

View file

@ -11,20 +11,28 @@ def longestCommon( name, pairs ):
for key in pairs.keys():
if str == key[:ii]:
print str, "matches", key, "so far"
match = str
match = key
break
sys.exit(0)
return match
def checkAgainst( path, pairs ):
print "looking at", path
doc = etree.parse( path )
root = doc.getroot();
# for child in root.iter():
# if child.tag == "string":
# name = child.get("name")
# if not name in pairs:
# longestCommon( name, pairs )
for child in root.iter():
if child.tag == "string":
name = child.get("name")
if not name in pairs:
candidate = longestCommon( name, pairs )
print name, "not found in the English strings"
print "closest I can find is", candidate
print "here are the two strings, English then the other"
print pairs[candidate]
print child.text
response = raw_input( "replace %s with %s? (y or n)" % (name, candidate) )
if response == 'y':
child.set('name', candidate)
break
# try = tryNames( name, pairs )
# response = raw_input( "unknown name: %s; respond:" % (name) )
# print "you wrote:", response
@ -43,6 +51,7 @@ def main():
for file in [file for file in files if file == "strings.xml"]:
path = "%s/%s" % (subdir, file)
checkAgainst( path, pairs )
break
##############################################################################