Skip to content

Commit b6928a7

Browse files
author
Falko Richter
committed
writing the string definitions is optional
1 parent 5265f36 commit b6928a7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

resources.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import plistlib
99

1010
params = ["resources-folder=", "configuration=", "string-csv=", "checkImageUsage", "checkStringUsage",
11-
"stringsFileName=", "stringsFilePath=", "infoPlistFile=", "replaceRecursive", "verbose"]
11+
"stringsFileName=", "stringsFilePath=", "replaceRecursive", "verbose", "infoPlistFile=", "doNotWriteStringDefinitions"]
1212
configuration = None
1313
criticalError = False
1414
files = set([])
@@ -24,6 +24,7 @@
2424
verbose = False
2525
infoPlistFilePath = None
2626
infoPlistFile = None
27+
doNotWriteStringDefinitions = False
2728

2829

2930
def usage():
@@ -63,6 +64,8 @@ def usage():
6364
verbose = True
6465
elif o in "--infoPlistFile":
6566
infoPlistFilePath = a
67+
elif o in "--doNotWriteStringDefinitions":
68+
doNotWriteStringDefinitions = True
6669
else:
6770
assert False, "unhandled option" + o + a
6871

@@ -155,8 +158,9 @@ def replaceRecursiveAll(a, b):
155158
constantName = cleanName
156159
comment = row[len(row) - 1]
157160
german = row[1]
158-
constantsString += "#define {0} NSLocalizedStringFromTable(@\"{2}\",@\"{1}\",@\"{3}\")\n".format(
159-
constantName, stringsFileName, cleanName, comment)
161+
if not doNotWriteStringDefinitions:
162+
constantsString += "#define {0} NSLocalizedStringFromTable(@\"{2}\",@\"{1}\",@\"{3}\")\n".format(
163+
constantName, stringsFileName, cleanName, comment)
160164
stringConstants.append(constantName)
161165
localFile.write("\"{0}\" = \"{1}\";\n".format(cleanName, german))
162166

0 commit comments

Comments
 (0)