├── .DS_Store ├── CleanLocalizableExample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ginowu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ginowu.xcuserdatad │ └── xcschemes │ ├── CleanLocalizableExample.xcscheme │ └── xcschememanagement.plist ├── CleanLocalizableExample ├── .DS_Store ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Launch Screen.storyboard ├── LocalizableListTableViewController.swift ├── Main.storyboard ├── RandomViewController.swift ├── en.lproj │ └── Localizable.strings ├── es.lproj │ └── Localizable.strings └── zh-Hans.lproj │ └── Localizable.strings ├── CleanLocalizableExampleTests ├── CleanLocalizableExampleTests.swift └── Info.plist ├── CleanLocalizableExampleUITests ├── CleanLocalizableExampleUITests.swift └── Info.plist └── scripts └── clean_localizable.sh /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ginowu7/CleanLocalizableExample/1c5b7a1a89afabd00c47016e65923050c61ab83e/.DS_Store -------------------------------------------------------------------------------- /CleanLocalizableExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7D6028C720435CF8003E6AC1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6028C620435CF8003E6AC1 /* AppDelegate.swift */; }; 11 | 7D6028CE20435CF8003E6AC1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D6028CD20435CF8003E6AC1 /* Assets.xcassets */; }; 12 | 7D6028DC20435CF8003E6AC1 /* CleanLocalizableExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6028DB20435CF8003E6AC1 /* CleanLocalizableExampleTests.swift */; }; 13 | 7D6028E720435CF8003E6AC1 /* CleanLocalizableExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6028E620435CF8003E6AC1 /* CleanLocalizableExampleUITests.swift */; }; 14 | 7D6028F520435D5D003E6AC1 /* LocalizableListTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D6028F420435D5D003E6AC1 /* LocalizableListTableViewController.swift */; }; 15 | 7D6028F720435E13003E6AC1 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7D6028F620435E13003E6AC1 /* Launch Screen.storyboard */; }; 16 | 7D6028F920435E42003E6AC1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7D6028F820435E42003E6AC1 /* Main.storyboard */; }; 17 | 7D6029012043606E003E6AC1 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7D6029032043606E003E6AC1 /* Localizable.strings */; }; 18 | 7D60290B20436376003E6AC1 /* RandomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D60290A20436376003E6AC1 /* RandomViewController.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 7D6028D820435CF8003E6AC1 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 7D6028BB20435CF8003E6AC1 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 7D6028C220435CF8003E6AC1; 27 | remoteInfo = CleanLocalizableExample; 28 | }; 29 | 7D6028E320435CF8003E6AC1 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 7D6028BB20435CF8003E6AC1 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 7D6028C220435CF8003E6AC1; 34 | remoteInfo = CleanLocalizableExample; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 7D6028C320435CF8003E6AC1 /* CleanLocalizableExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CleanLocalizableExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 7D6028C620435CF8003E6AC1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 7D6028CD20435CF8003E6AC1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 7D6028D220435CF8003E6AC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 7D6028D720435CF8003E6AC1 /* CleanLocalizableExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CleanLocalizableExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 7D6028DB20435CF8003E6AC1 /* CleanLocalizableExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CleanLocalizableExampleTests.swift; sourceTree = ""; }; 45 | 7D6028DD20435CF8003E6AC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 7D6028E220435CF8003E6AC1 /* CleanLocalizableExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CleanLocalizableExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 7D6028E620435CF8003E6AC1 /* CleanLocalizableExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CleanLocalizableExampleUITests.swift; sourceTree = ""; }; 48 | 7D6028E820435CF8003E6AC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 7D6028F420435D5D003E6AC1 /* LocalizableListTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizableListTableViewController.swift; sourceTree = ""; }; 50 | 7D6028F620435E13003E6AC1 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 51 | 7D6028F820435E42003E6AC1 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 52 | 7D6029082043618E003E6AC1 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 53 | 7D602909204361C5003E6AC1 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 54 | 7D60290A20436376003E6AC1 /* RandomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomViewController.swift; sourceTree = ""; }; 55 | 7D60290C204367A0003E6AC1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 7D6028C020435CF8003E6AC1 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 7D6028D420435CF8003E6AC1 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 7D6028DF20435CF8003E6AC1 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 7D6028BA20435CF8003E6AC1 = { 84 | isa = PBXGroup; 85 | children = ( 86 | 7D6028C520435CF8003E6AC1 /* CleanLocalizableExample */, 87 | 7D6028DA20435CF8003E6AC1 /* CleanLocalizableExampleTests */, 88 | 7D6028E520435CF8003E6AC1 /* CleanLocalizableExampleUITests */, 89 | 7D6028C420435CF8003E6AC1 /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 7D6028C420435CF8003E6AC1 /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 7D6028C320435CF8003E6AC1 /* CleanLocalizableExample.app */, 97 | 7D6028D720435CF8003E6AC1 /* CleanLocalizableExampleTests.xctest */, 98 | 7D6028E220435CF8003E6AC1 /* CleanLocalizableExampleUITests.xctest */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | 7D6028C520435CF8003E6AC1 /* CleanLocalizableExample */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 7D6028C620435CF8003E6AC1 /* AppDelegate.swift */, 107 | 7D6028F420435D5D003E6AC1 /* LocalizableListTableViewController.swift */, 108 | 7D60290A20436376003E6AC1 /* RandomViewController.swift */, 109 | 7D6028CD20435CF8003E6AC1 /* Assets.xcassets */, 110 | 7D6028D220435CF8003E6AC1 /* Info.plist */, 111 | 7D6028F620435E13003E6AC1 /* Launch Screen.storyboard */, 112 | 7D6028F820435E42003E6AC1 /* Main.storyboard */, 113 | 7D6029032043606E003E6AC1 /* Localizable.strings */, 114 | ); 115 | path = CleanLocalizableExample; 116 | sourceTree = ""; 117 | }; 118 | 7D6028DA20435CF8003E6AC1 /* CleanLocalizableExampleTests */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 7D6028DB20435CF8003E6AC1 /* CleanLocalizableExampleTests.swift */, 122 | 7D6028DD20435CF8003E6AC1 /* Info.plist */, 123 | ); 124 | path = CleanLocalizableExampleTests; 125 | sourceTree = ""; 126 | }; 127 | 7D6028E520435CF8003E6AC1 /* CleanLocalizableExampleUITests */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 7D6028E620435CF8003E6AC1 /* CleanLocalizableExampleUITests.swift */, 131 | 7D6028E820435CF8003E6AC1 /* Info.plist */, 132 | ); 133 | path = CleanLocalizableExampleUITests; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXNativeTarget section */ 139 | 7D6028C220435CF8003E6AC1 /* CleanLocalizableExample */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = 7D6028EB20435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExample" */; 142 | buildPhases = ( 143 | 7D6028BF20435CF8003E6AC1 /* Sources */, 144 | 7D6028C020435CF8003E6AC1 /* Frameworks */, 145 | 7D6028C120435CF8003E6AC1 /* Resources */, 146 | 7D9A39C520476FF800CB5803 /* Clean Localizable */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | ); 152 | name = CleanLocalizableExample; 153 | productName = CleanLocalizableExample; 154 | productReference = 7D6028C320435CF8003E6AC1 /* CleanLocalizableExample.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | 7D6028D620435CF8003E6AC1 /* CleanLocalizableExampleTests */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 7D6028EE20435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExampleTests" */; 160 | buildPhases = ( 161 | 7D6028D320435CF8003E6AC1 /* Sources */, 162 | 7D6028D420435CF8003E6AC1 /* Frameworks */, 163 | 7D6028D520435CF8003E6AC1 /* Resources */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | 7D6028D920435CF8003E6AC1 /* PBXTargetDependency */, 169 | ); 170 | name = CleanLocalizableExampleTests; 171 | productName = CleanLocalizableExampleTests; 172 | productReference = 7D6028D720435CF8003E6AC1 /* CleanLocalizableExampleTests.xctest */; 173 | productType = "com.apple.product-type.bundle.unit-test"; 174 | }; 175 | 7D6028E120435CF8003E6AC1 /* CleanLocalizableExampleUITests */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 7D6028F120435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExampleUITests" */; 178 | buildPhases = ( 179 | 7D6028DE20435CF8003E6AC1 /* Sources */, 180 | 7D6028DF20435CF8003E6AC1 /* Frameworks */, 181 | 7D6028E020435CF8003E6AC1 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | 7D6028E420435CF8003E6AC1 /* PBXTargetDependency */, 187 | ); 188 | name = CleanLocalizableExampleUITests; 189 | productName = CleanLocalizableExampleUITests; 190 | productReference = 7D6028E220435CF8003E6AC1 /* CleanLocalizableExampleUITests.xctest */; 191 | productType = "com.apple.product-type.bundle.ui-testing"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | 7D6028BB20435CF8003E6AC1 /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | LastSwiftUpdateCheck = 0920; 200 | LastUpgradeCheck = 0920; 201 | ORGANIZATIONNAME = "Gino Wu"; 202 | TargetAttributes = { 203 | 7D6028C220435CF8003E6AC1 = { 204 | CreatedOnToolsVersion = 9.2; 205 | ProvisioningStyle = Automatic; 206 | }; 207 | 7D6028D620435CF8003E6AC1 = { 208 | CreatedOnToolsVersion = 9.2; 209 | ProvisioningStyle = Automatic; 210 | TestTargetID = 7D6028C220435CF8003E6AC1; 211 | }; 212 | 7D6028E120435CF8003E6AC1 = { 213 | CreatedOnToolsVersion = 9.2; 214 | ProvisioningStyle = Automatic; 215 | TestTargetID = 7D6028C220435CF8003E6AC1; 216 | }; 217 | }; 218 | }; 219 | buildConfigurationList = 7D6028BE20435CF8003E6AC1 /* Build configuration list for PBXProject "CleanLocalizableExample" */; 220 | compatibilityVersion = "Xcode 8.0"; 221 | developmentRegion = en; 222 | hasScannedForEncodings = 0; 223 | knownRegions = ( 224 | en, 225 | Base, 226 | es, 227 | "zh-Hans", 228 | ); 229 | mainGroup = 7D6028BA20435CF8003E6AC1; 230 | productRefGroup = 7D6028C420435CF8003E6AC1 /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | 7D6028C220435CF8003E6AC1 /* CleanLocalizableExample */, 235 | 7D6028D620435CF8003E6AC1 /* CleanLocalizableExampleTests */, 236 | 7D6028E120435CF8003E6AC1 /* CleanLocalizableExampleUITests */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | 7D6028C120435CF8003E6AC1 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 7D6028F920435E42003E6AC1 /* Main.storyboard in Resources */, 247 | 7D6029012043606E003E6AC1 /* Localizable.strings in Resources */, 248 | 7D6028F720435E13003E6AC1 /* Launch Screen.storyboard in Resources */, 249 | 7D6028CE20435CF8003E6AC1 /* Assets.xcassets in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 7D6028D520435CF8003E6AC1 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 7D6028E020435CF8003E6AC1 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXShellScriptBuildPhase section */ 270 | 7D9A39C520476FF800CB5803 /* Clean Localizable */ = { 271 | isa = PBXShellScriptBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | inputPaths = ( 276 | ); 277 | name = "Clean Localizable"; 278 | outputPaths = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = ./scripts/clean_localizable.sh; 283 | }; 284 | /* End PBXShellScriptBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | 7D6028BF20435CF8003E6AC1 /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 7D60290B20436376003E6AC1 /* RandomViewController.swift in Sources */, 292 | 7D6028F520435D5D003E6AC1 /* LocalizableListTableViewController.swift in Sources */, 293 | 7D6028C720435CF8003E6AC1 /* AppDelegate.swift in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 7D6028D320435CF8003E6AC1 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 7D6028DC20435CF8003E6AC1 /* CleanLocalizableExampleTests.swift in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 7D6028DE20435CF8003E6AC1 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 7D6028E720435CF8003E6AC1 /* CleanLocalizableExampleUITests.swift in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 7D6028D920435CF8003E6AC1 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 7D6028C220435CF8003E6AC1 /* CleanLocalizableExample */; 319 | targetProxy = 7D6028D820435CF8003E6AC1 /* PBXContainerItemProxy */; 320 | }; 321 | 7D6028E420435CF8003E6AC1 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = 7D6028C220435CF8003E6AC1 /* CleanLocalizableExample */; 324 | targetProxy = 7D6028E320435CF8003E6AC1 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin PBXVariantGroup section */ 329 | 7D6029032043606E003E6AC1 /* Localizable.strings */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | 7D6029082043618E003E6AC1 /* es */, 333 | 7D602909204361C5003E6AC1 /* zh-Hans */, 334 | 7D60290C204367A0003E6AC1 /* en */, 335 | ); 336 | name = Localizable.strings; 337 | sourceTree = ""; 338 | }; 339 | /* End PBXVariantGroup section */ 340 | 341 | /* Begin XCBuildConfiguration section */ 342 | 7D6028E920435CF8003E6AC1 /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 347 | CLANG_ANALYZER_NONNULL = YES; 348 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 354 | CLANG_WARN_BOOL_CONVERSION = YES; 355 | CLANG_WARN_COMMA = YES; 356 | CLANG_WARN_CONSTANT_CONVERSION = YES; 357 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 358 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INFINITE_RECURSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 364 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 367 | CLANG_WARN_STRICT_PROTOTYPES = YES; 368 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 369 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 370 | CLANG_WARN_UNREACHABLE_CODE = YES; 371 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 372 | CODE_SIGN_IDENTITY = "iPhone Developer"; 373 | COPY_PHASE_STRIP = NO; 374 | DEBUG_INFORMATION_FORMAT = dwarf; 375 | ENABLE_STRICT_OBJC_MSGSEND = YES; 376 | ENABLE_TESTABILITY = YES; 377 | GCC_C_LANGUAGE_STANDARD = gnu11; 378 | GCC_DYNAMIC_NO_PIC = NO; 379 | GCC_NO_COMMON_BLOCKS = YES; 380 | GCC_OPTIMIZATION_LEVEL = 0; 381 | GCC_PREPROCESSOR_DEFINITIONS = ( 382 | "DEBUG=1", 383 | "$(inherited)", 384 | ); 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 392 | MTL_ENABLE_DEBUG_INFO = YES; 393 | ONLY_ACTIVE_ARCH = YES; 394 | SDKROOT = iphoneos; 395 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 396 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 397 | }; 398 | name = Debug; 399 | }; 400 | 7D6028EA20435CF8003E6AC1 /* Release */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | ALWAYS_SEARCH_USER_PATHS = NO; 404 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 405 | CLANG_ANALYZER_NONNULL = YES; 406 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_MODULES = YES; 410 | CLANG_ENABLE_OBJC_ARC = YES; 411 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 412 | CLANG_WARN_BOOL_CONVERSION = YES; 413 | CLANG_WARN_COMMA = YES; 414 | CLANG_WARN_CONSTANT_CONVERSION = YES; 415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 416 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 417 | CLANG_WARN_EMPTY_BODY = YES; 418 | CLANG_WARN_ENUM_CONVERSION = YES; 419 | CLANG_WARN_INFINITE_RECURSION = YES; 420 | CLANG_WARN_INT_CONVERSION = YES; 421 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 422 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 424 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 425 | CLANG_WARN_STRICT_PROTOTYPES = YES; 426 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 427 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 428 | CLANG_WARN_UNREACHABLE_CODE = YES; 429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 430 | CODE_SIGN_IDENTITY = "iPhone Developer"; 431 | COPY_PHASE_STRIP = NO; 432 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 433 | ENABLE_NS_ASSERTIONS = NO; 434 | ENABLE_STRICT_OBJC_MSGSEND = YES; 435 | GCC_C_LANGUAGE_STANDARD = gnu11; 436 | GCC_NO_COMMON_BLOCKS = YES; 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 444 | MTL_ENABLE_DEBUG_INFO = NO; 445 | SDKROOT = iphoneos; 446 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 447 | VALIDATE_PRODUCT = YES; 448 | }; 449 | name = Release; 450 | }; 451 | 7D6028EC20435CF8003E6AC1 /* Debug */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | CODE_SIGN_STYLE = Automatic; 456 | INFOPLIST_FILE = CleanLocalizableExample/Info.plist; 457 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 458 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExample; 459 | PRODUCT_NAME = "$(TARGET_NAME)"; 460 | SWIFT_VERSION = 4.0; 461 | TARGETED_DEVICE_FAMILY = "1,2"; 462 | }; 463 | name = Debug; 464 | }; 465 | 7D6028ED20435CF8003E6AC1 /* Release */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 469 | CODE_SIGN_STYLE = Automatic; 470 | INFOPLIST_FILE = CleanLocalizableExample/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 472 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExample; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SWIFT_VERSION = 4.0; 475 | TARGETED_DEVICE_FAMILY = "1,2"; 476 | }; 477 | name = Release; 478 | }; 479 | 7D6028EF20435CF8003E6AC1 /* Debug */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 483 | BUNDLE_LOADER = "$(TEST_HOST)"; 484 | CODE_SIGN_STYLE = Automatic; 485 | INFOPLIST_FILE = CleanLocalizableExampleTests/Info.plist; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 487 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExampleTests; 488 | PRODUCT_NAME = "$(TARGET_NAME)"; 489 | SWIFT_VERSION = 4.0; 490 | TARGETED_DEVICE_FAMILY = "1,2"; 491 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CleanLocalizableExample.app/CleanLocalizableExample"; 492 | }; 493 | name = Debug; 494 | }; 495 | 7D6028F020435CF8003E6AC1 /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 499 | BUNDLE_LOADER = "$(TEST_HOST)"; 500 | CODE_SIGN_STYLE = Automatic; 501 | INFOPLIST_FILE = CleanLocalizableExampleTests/Info.plist; 502 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 503 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExampleTests; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_VERSION = 4.0; 506 | TARGETED_DEVICE_FAMILY = "1,2"; 507 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CleanLocalizableExample.app/CleanLocalizableExample"; 508 | }; 509 | name = Release; 510 | }; 511 | 7D6028F220435CF8003E6AC1 /* Debug */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 515 | CODE_SIGN_STYLE = Automatic; 516 | INFOPLIST_FILE = CleanLocalizableExampleUITests/Info.plist; 517 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 518 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExampleUITests; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | SWIFT_VERSION = 4.0; 521 | TARGETED_DEVICE_FAMILY = "1,2"; 522 | TEST_TARGET_NAME = CleanLocalizableExample; 523 | }; 524 | name = Debug; 525 | }; 526 | 7D6028F320435CF8003E6AC1 /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | buildSettings = { 529 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 530 | CODE_SIGN_STYLE = Automatic; 531 | INFOPLIST_FILE = CleanLocalizableExampleUITests/Info.plist; 532 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 533 | PRODUCT_BUNDLE_IDENTIFIER = example.CleanLocalizableExampleUITests; 534 | PRODUCT_NAME = "$(TARGET_NAME)"; 535 | SWIFT_VERSION = 4.0; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | TEST_TARGET_NAME = CleanLocalizableExample; 538 | }; 539 | name = Release; 540 | }; 541 | /* End XCBuildConfiguration section */ 542 | 543 | /* Begin XCConfigurationList section */ 544 | 7D6028BE20435CF8003E6AC1 /* Build configuration list for PBXProject "CleanLocalizableExample" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 7D6028E920435CF8003E6AC1 /* Debug */, 548 | 7D6028EA20435CF8003E6AC1 /* Release */, 549 | ); 550 | defaultConfigurationIsVisible = 0; 551 | defaultConfigurationName = Release; 552 | }; 553 | 7D6028EB20435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExample" */ = { 554 | isa = XCConfigurationList; 555 | buildConfigurations = ( 556 | 7D6028EC20435CF8003E6AC1 /* Debug */, 557 | 7D6028ED20435CF8003E6AC1 /* Release */, 558 | ); 559 | defaultConfigurationIsVisible = 0; 560 | defaultConfigurationName = Release; 561 | }; 562 | 7D6028EE20435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExampleTests" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | 7D6028EF20435CF8003E6AC1 /* Debug */, 566 | 7D6028F020435CF8003E6AC1 /* Release */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | 7D6028F120435CF8003E6AC1 /* Build configuration list for PBXNativeTarget "CleanLocalizableExampleUITests" */ = { 572 | isa = XCConfigurationList; 573 | buildConfigurations = ( 574 | 7D6028F220435CF8003E6AC1 /* Debug */, 575 | 7D6028F320435CF8003E6AC1 /* Release */, 576 | ); 577 | defaultConfigurationIsVisible = 0; 578 | defaultConfigurationName = Release; 579 | }; 580 | /* End XCConfigurationList section */ 581 | }; 582 | rootObject = 7D6028BB20435CF8003E6AC1 /* Project object */; 583 | } 584 | -------------------------------------------------------------------------------- /CleanLocalizableExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CleanLocalizableExample.xcodeproj/project.xcworkspace/xcuserdata/ginowu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ginowu7/CleanLocalizableExample/1c5b7a1a89afabd00c47016e65923050c61ab83e/CleanLocalizableExample.xcodeproj/project.xcworkspace/xcuserdata/ginowu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CleanLocalizableExample.xcodeproj/xcuserdata/ginowu.xcuserdatad/xcschemes/CleanLocalizableExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 44 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 76 | 78 | 84 | 85 | 86 | 87 | 88 | 89 | 95 | 97 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /CleanLocalizableExample.xcodeproj/xcuserdata/ginowu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CleanLocalizableExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 7D6028C220435CF8003E6AC1 16 | 17 | primary 18 | 19 | 20 | 7D6028D620435CF8003E6AC1 21 | 22 | primary 23 | 24 | 25 | 7D6028E120435CF8003E6AC1 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /CleanLocalizableExample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ginowu7/CleanLocalizableExample/1c5b7a1a89afabd00c47016e65923050c61ab83e/CleanLocalizableExample/.DS_Store -------------------------------------------------------------------------------- /CleanLocalizableExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CleanLocalizableExample 4 | // 5 | // Created by Gino Wu on 2/25/18. 6 | // Copyright © 2018 Gino Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /CleanLocalizableExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /CleanLocalizableExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CleanLocalizableExample/Launch Screen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /CleanLocalizableExample/LocalizableListTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocalizableListTableViewController.swift 3 | // CleanLocalizableExample 4 | // 5 | // Created by Gino Wu on 2/25/18. 6 | // Copyright © 2018 Gino Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LocalizableListTableViewController: UITableViewController { 12 | 13 | let fruits: [String] = [ 14 | NSLocalizedString("LocalizableListTableViewController:Fruit:Apple", comment: "Apple title"), 15 | NSLocalizedString("LocalizableListTableViewController:Fruit:Orange", comment: "Orange title"), 16 | NSLocalizedString("LocalizableListTableViewController:Fruit:Grape", comment: "Grape title"), 17 | NSLocalizedString("LocalizableListTableViewController:Fruit:Strawberry", comment: "Strawberry title") 18 | ] 19 | 20 | override func viewDidLoad() { 21 | super.viewDidLoad() 22 | view.backgroundColor = .white 23 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") 24 | } 25 | 26 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 27 | return fruits.count 28 | } 29 | 30 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 31 | guard let cell = tableView.dequeueReusableCell(withIdentifier: "cell") else { fatalError() } 32 | cell.textLabel?.text = fruits[indexPath.row] 33 | return cell 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CleanLocalizableExample/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CleanLocalizableExample/RandomViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomViewController.swift 3 | // CleanLocalizableExample 4 | // 5 | // Created by Gino Wu on 2/25/18. 6 | // Copyright © 2018 Gino Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class RandomViewController: UIViewController { 12 | 13 | let otherLocalizableStrings: [String] = [ 14 | NSLocalizedString("RandomViewController:Vehicle:Car", comment: "Car title"), 15 | NSLocalizedString("RandomViewController:Vehicle:Plane", comment: "Plane title"), 16 | NSLocalizedString("RandomViewController:Vehicle:Boat", comment: "Boat title") 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /CleanLocalizableExample/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "LocalizableListTableViewController:Fruit:Apple" = "Apple"; 2 | "LocalizableListTableViewController:Fruit:Grape" = "Grape"; 3 | "LocalizableListTableViewController:Fruit:Orange" = "Orange"; 4 | "LoginViewController:UIAlertController:Message" = "Please sign in first"; 5 | "LoginViewController:UIButton:Title" = "Log in"; 6 | "RandomViewController:Vehicle:Boat" = "Boat"; 7 | "RandomViewController:Vehicle:Car" = "Car"; 8 | "RandomViewController:Vehicle:Plane" = "Plane"; 9 | "RandomViewController:Vehicle:Train" = "Train"; 10 | "UserProfileViewController:UINavigationItem:Title" = "User"; 11 | "UserProfileViewController:UINavigationItem:Title" = "User Title"; 12 | -------------------------------------------------------------------------------- /CleanLocalizableExample/es.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "LocalizableListTableViewController:Fruit:Apple" = "Manzana"; 2 | "LocalizableListTableViewController:Fruit:Grape" = "Uva"; 3 | "LocalizableListTableViewController:Fruit:Orange" = "Naranja"; 4 | "LocalizableListTableViewController:Fruit:Strawberry" = "Fresa"; 5 | "RandomViewController:Vehicle:Boat" = "Barco"; 6 | "RandomViewController:Vehicle:Car" = "Coche"; 7 | "RandomViewController:Vehicle:Plane" = "Avión"; 8 | "RandomViewController:Vehicle:Train" = "Tren"; 9 | -------------------------------------------------------------------------------- /CleanLocalizableExample/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "LocalizableListTableViewController:Fruit:Apple" = "苹果"; 2 | "LocalizableListTableViewController:Fruit:Grape" = "葡萄"; 3 | "LocalizableListTableViewController:Fruit:Orange" = "橙子"; 4 | "LocalizableListTableViewController:Fruit:Strawberry" = "草莓"; 5 | "LoginViewController:UIAlertController:Message" = "请先登录"; 6 | "LoginViewController:UIButton:Title" = "登录"; 7 | "RandomViewController:Vehicle:Boat" = "船"; 8 | "RandomViewController:Vehicle:Car" = "汽车"; 9 | "RandomViewController:Vehicle:Plane" = "平面"; 10 | "RandomViewController:Vehicle:Train" = "🚄"; 11 | "UserProfileViewController:UINavigationItem:Title" = "用户"; 12 | -------------------------------------------------------------------------------- /CleanLocalizableExampleTests/CleanLocalizableExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CleanLocalizableExampleTests.swift 3 | // CleanLocalizableExampleTests 4 | // 5 | // Created by Gino Wu on 2/25/18. 6 | // Copyright © 2018 Gino Wu. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import CleanLocalizableExample 11 | 12 | class CleanLocalizableExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CleanLocalizableExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /CleanLocalizableExampleUITests/CleanLocalizableExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CleanLocalizableExampleUITests.swift 3 | // CleanLocalizableExampleUITests 4 | // 5 | // Created by Gino Wu on 2/25/18. 6 | // Copyright © 2018 Gino Wu. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CleanLocalizableExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CleanLocalizableExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /scripts/clean_localizable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | project_name="CleanLocalizableExample" 4 | development_file="./$project_name/en.lproj/Localizable.strings" 5 | 6 | es_duplicates=9 7 | es_match=8 8 | es_not_included=7 9 | 10 | sort_and_find_duplicates() { 11 | echo "== Sorting localizable files: $1 ==" 12 | sed -i '' '/^$/d' $1 #deletes whitespace lines 13 | sort $1 -o $1 #sorts file 14 | duplicates=`sed 's/^[^"]*"\([^"]*\)".*/\1/' $1 | uniq -d` 15 | if [ ! -z "${duplicates}" ]; then 16 | echo "error: Found duplicated keys" 17 | echo "error: $duplicates in file: $1" 18 | exit $es_duplicates 19 | fi 20 | } 21 | 22 | keys_match() { 23 | echo "== Checking if keys match in localizable files: $1 ==" 24 | base_keys=`sed 's/^[^"]*"\([^"]*\)".*/\1/' $development_file` 25 | localizable_keys=`sed 's/^[^"]*"\([^"]*\)".*/\1/' $1` 26 | is_different=`diff <(echo "$base_keys") <(echo "$localizable_keys")` 27 | 28 | if [ ! -z "${is_different}" ]; then 29 | echo "error: Localizable string keys do not match" 30 | echo "error: $is_different in file: $1" 31 | exit $es_match 32 | fi 33 | } 34 | 35 | keys_not_used() { 36 | echo "== Checking keys not used in code ==" 37 | sed 's/^[^"]*"\([^"]*\)".*/\1/' $development_file | 38 | while read key; do 39 | exist=`grep -rl "NSLocalizedString(\"$key\"" --include \*.swift --include \*.m ./$project_name/*` 40 | if [ -z "${exist}" ]; then 41 | echo "warning: Found keys not used in code" 42 | echo "warning: \"$key\" is not used being used" 43 | fi 44 | done 45 | } 46 | 47 | keys_not_included() { 48 | echo "== Checking keys not included in localizable ==" 49 | base_keys=`sed 's/^[^"]*"\([^"]*\)".*/\1/' $development_file` 50 | # grep NSLocalizedString("anything until first quotes" | sed everything in between quotes | sort and unique 51 | grep -r -o "NSLocalizedString(\"[^\"]*\"" --include \*.swift --include \*.m ./$project_name/* --exclude ./$project_name/NSLocalizedString.swift | 52 | grep -v "%d" | 53 | sed 's/^[^"]*"\([^"]*\)".*/\1/' | 54 | sort -u | 55 | while read key; do 56 | if [[ $base_keys != *$key* ]]; then 57 | echo "error: Found keys not included in localizable file" 58 | echo "error: \"$key\" not define in file: $1" 59 | exit $es_not_included 60 | fi 61 | done 62 | } 63 | 64 | 65 | find ./$project_name -name 'Localizable.strings' | 66 | while read file; do 67 | sort_and_find_duplicates $file 68 | keys_match $file 69 | echo "" 70 | done 71 | keys_not_used 72 | keys_not_included 73 | --------------------------------------------------------------------------------