|
8 | 8 | import plistlib
|
9 | 9 |
|
10 | 10 | params = ["resources-folder=", "configuration=", "string-csv=", "checkImageUsage", "checkStringUsage",
|
11 |
| - "stringsFileName=", "stringsFilePath=", "infoPlistFile=", "replaceRecursive", "verbose"] |
| 11 | + "stringsFileName=", "stringsFilePath=", "replaceRecursive", "verbose", "infoPlistFile=", "doNotWriteStringDefinitions"] |
12 | 12 | configuration = None
|
13 | 13 | criticalError = False
|
14 | 14 | files = set([])
|
|
24 | 24 | verbose = False
|
25 | 25 | infoPlistFilePath = None
|
26 | 26 | infoPlistFile = None
|
| 27 | +doNotWriteStringDefinitions = False |
27 | 28 |
|
28 | 29 |
|
29 | 30 | def usage():
|
@@ -63,6 +64,8 @@ def usage():
|
63 | 64 | verbose = True
|
64 | 65 | elif o in "--infoPlistFile":
|
65 | 66 | infoPlistFilePath = a
|
| 67 | + elif o in "--doNotWriteStringDefinitions": |
| 68 | + doNotWriteStringDefinitions = True |
66 | 69 | else:
|
67 | 70 | assert False, "unhandled option" + o + a
|
68 | 71 |
|
@@ -155,8 +158,9 @@ def replaceRecursiveAll(a, b):
|
155 | 158 | constantName = cleanName
|
156 | 159 | comment = row[len(row) - 1]
|
157 | 160 | 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) |
160 | 164 | stringConstants.append(constantName)
|
161 | 165 | localFile.write("\"{0}\" = \"{1}\";\n".format(cleanName, german))
|
162 | 166 |
|
|
0 commit comments