mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
add option to print only strings missing from the localized file
This commit is contained in:
parent
59f9ebc13d
commit
9a551c51f8
1 changed files with 5 additions and 2 deletions
|
@ -54,10 +54,12 @@ def load_strings(lang=''):
|
|||
def main():
|
||||
langs = []
|
||||
generate = False
|
||||
pairs, rest = getopt.getopt(sys.argv[1:], "l:g")
|
||||
newOnly = False
|
||||
pairs, rest = getopt.getopt(sys.argv[1:], "l:ghn")
|
||||
for option, value in pairs:
|
||||
if option == '-l': langs.append(value)
|
||||
elif option == '-g': generate = True
|
||||
elif option == '-n': newOnly = True
|
||||
else: usage()
|
||||
|
||||
if generate and 1 != len(langs):
|
||||
|
@ -86,7 +88,8 @@ def main():
|
|||
if indx in en_strings.values(): # it's a string
|
||||
id = [siid for siid in en_strings.keys() if en_strings[siid] == indx][0]
|
||||
if id in l_strings.keys():
|
||||
print l_nodes[l_strings[id]]
|
||||
if not newOnly:
|
||||
print l_nodes[l_strings[id]]
|
||||
else:
|
||||
print ' <!--XLATE-ME-->'
|
||||
print en_nodes[indx]
|
||||
|
|
Loading…
Reference in a new issue