├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── Localize-Swift.podspec ├── Localize_Swift.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── Localize_Swift OSX.xcscheme │ ├── Localize_Swift tvOS.xcscheme │ ├── Localize_Swift watchOS.xcscheme │ ├── Localize_Swift.xcscheme │ └── Localize_SwiftTests.xcscheme ├── Localize_Swift └── Info.plist ├── Localize_SwiftTests ├── Info.plist └── Localize_SwiftTests.swift ├── Package.swift ├── README.md ├── Sources ├── Localize.swift ├── Localize_Swift.h ├── String+LocalizeBundle.swift ├── String+LocalizeTableName.swift ├── String+LocalizedBundleTableName.swift └── UI │ └── IBDesignable+Localize.swift ├── build.sh ├── examples ├── LanguageSwitch │ ├── .gitignore │ ├── Podfile │ ├── Sample.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Sample.xcscheme │ │ └── xcuserdata │ │ │ └── marmelroy.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── SampleTests.xcscheme │ │ │ └── xcschememanagement.plist │ ├── Sample │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── ViewController.swift │ │ ├── de.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── en.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── es.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── fr.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── he.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── it.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── ja.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ ├── zh-Hans.lproj │ │ │ ├── ButtonTitles.strings │ │ │ └── Localizable.strings │ │ └── zh-Hant.lproj │ │ │ └── Localizable.strings │ └── SampleTests │ │ ├── Info.plist │ │ └── SampleTests.swift └── README.md └── genstrings.swift /.gitignore: -------------------------------------------------------------------------------- 1 | Localize.xcodeproj/project.xcworkspace/xcuserdata/marmelroy.xcuserdatad/UserInterfaceState.xcuserstate 2 | Localize.xcodeproj/project.xcworkspace/xcshareddata/Localize.xccheckout 3 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize.xcodeproj/xcshareddata/xcschemes/Localize.xcscheme 4 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/Images.xcassets/AppIcon.appiconset/Contents.json 5 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/genstrings.py 6 | examples/LanguageSwitch/Cartfile.resolved 7 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/xcschememanagement.plist 8 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/module.modulemap 9 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/LICENSE 10 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/x86_64.swiftdoc 11 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Headers/Localize-Swift.h 12 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize/Localize.swift 13 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Headers/Localize.h 14 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/AppDelegate.swift 15 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/i386.swiftdoc 16 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/SampleTests/Info.plist 17 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/SampleTests/SampleTests.swift 18 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/x86_64.swiftmodule 19 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/Info.plist 20 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/README.md 21 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/project.xcworkspace/xcuserdata/marmelroy.xcuserdatad/UserInterfaceState.xcuserstate 22 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Localize 23 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/ViewController.swift 24 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/project.xcworkspace/xcshareddata/Sample.xccheckout 25 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/arm64.swiftdoc 26 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize.xcodeproj/project.xcworkspace/contents.xcworkspacedata 27 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/Base.lproj/LaunchScreen.xib 28 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist 29 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/i386.swiftmodule 30 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Cartfile 31 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize-Swift.podspec 32 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Info.plist 33 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/arm.swiftdoc 34 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/project.pbxproj 35 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/Sample.xcscheme 36 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata 37 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/.gitignore 38 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize/Info.plist 39 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/arm64.swiftmodule 40 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/Modules/Localize.swiftmodule/arm.swiftmodule 41 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Carthage/Build 42 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize/Localize.h 43 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/xcschememanagement.plist 44 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/Localize.xcodeproj/project.pbxproj 45 | examples/LanguageSwitch/Carthage/Checkouts/Localize-Swift/examples/LanguageSwitch/Sample/Base.lproj/Main.storyboard 46 | examples/LanguageSwitch/Carthage/Build/iOS/Localize.framework/_CodeSignature/CodeResources 47 | examples/LanguageSwitch/Sample.xcodeproj/project.xcworkspace/xcuserdata/marmelroy.xcuserdatad/UserInterfaceState.xcuserstate 48 | examples/LanguageSwitch/Carthage 49 | Sample.xccheckout 50 | examples/LanguageSwitch/Podfile.lock 51 | examples/LanguageSwitch/Pods/Headers/Private/Localize-Swift/Localize.h 52 | examples/LanguageSwitch/Pods/Local Podspecs/Localize-Swift.podspec.json 53 | examples/LanguageSwitch/Pods/Manifest.lock 54 | examples/LanguageSwitch/Pods/Pods.xcodeproj/project.pbxproj 55 | examples/LanguageSwitch/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Localize-Swift.xcscheme 56 | examples/LanguageSwitch/Pods/Pods.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/Pods.xcscheme 57 | examples/LanguageSwitch/Pods/Pods.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/xcschememanagement.plist 58 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Info.plist 59 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Localize-Swift-dummy.m 60 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Localize-Swift-prefix.pch 61 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Localize-Swift-umbrella.h 62 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Localize-Swift.modulemap 63 | examples/LanguageSwitch/Pods/Target Support Files/Localize-Swift/Localize-Swift.xcconfig 64 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Info.plist 65 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown 66 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-acknowledgements.plist 67 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-dummy.m 68 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-frameworks.sh 69 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-resources.sh 70 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods-umbrella.h 71 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods.debug.xcconfig 72 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods.modulemap 73 | examples/LanguageSwitch/Pods/Target Support Files/Pods/Pods.release.xcconfig 74 | examples/LanguageSwitch/Sample.xcworkspace/xcuserdata/marmelroy.xcuserdatad/UserInterfaceState.xcuserstate 75 | 76 | # Created by https://www.gitignore.io/api/xcode,osx 77 | 78 | ### Xcode ### 79 | # Xcode 80 | # 81 | 82 | ## Build generated 83 | build/ 84 | DerivedData 85 | 86 | ## Various settings 87 | *.pbxuser 88 | !default.pbxuser 89 | *.mode1v3 90 | !default.mode1v3 91 | *.mode2v3 92 | !default.mode2v3 93 | *.perspectivev3 94 | !default.perspectivev3 95 | xcuserdata 96 | 97 | ## Other 98 | *.xccheckout 99 | *.moved-aside 100 | *.xcuserstate 101 | 102 | 103 | ### OSX ### 104 | .DS_Store 105 | .AppleDouble 106 | .LSOverride 107 | 108 | # Icon must end with two \r 109 | Icon 110 | 111 | # Thumbnails 112 | ._* 113 | 114 | # Files that might appear in the root of a volume 115 | .DocumentRevisions-V100 116 | .fseventsd 117 | .Spotlight-V100 118 | .TemporaryItems 119 | .Trashes 120 | .VolumeIcon.icns 121 | 122 | # Directories potentially created on remote AFP share 123 | .AppleDB 124 | .AppleDesktop 125 | Network Trash Folder 126 | Temporary Items 127 | .apdisk 128 | /.build 129 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode12 2 | language: swift 3 | env: 4 | global: 5 | - LC_CTYPE=en_US.UTF-8 6 | - LANG=en_US.UTF-8 7 | before_install: 8 | - brew update 9 | - gem install cocoapods --pre 10 | - xcrun simctl list 11 | install: echo "<3" 12 | env: 13 | - MODE=build 14 | - MODE=examples 15 | script: ./build.sh $MODE 16 | 17 | # whitelist 18 | branches: 19 | only: 20 | - master 21 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [Unreleased](https://github.com/marmelroy/Localize-Swift/tree/HEAD) 4 | 5 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.5...HEAD) 6 | 7 | **Merged pull requests:** 8 | 9 | - Spellings [\#10](https://github.com/marmelroy/Localize-Swift/pull/10) ([jameshartt](https://github.com/jameshartt)) 10 | 11 | ## [0.5](https://github.com/marmelroy/Localize-Swift/tree/0.5) (2015-11-03) 12 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.4...0.5) 13 | 14 | **Merged pull requests:** 15 | 16 | - Much type-safer swift .localize implementation [\#9](https://github.com/marmelroy/Localize-Swift/pull/9) ([rshev](https://github.com/rshev)) 17 | 18 | ## [0.4](https://github.com/marmelroy/Localize-Swift/tree/0.4) (2015-10-10) 19 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.3...0.4) 20 | 21 | **Closed issues:** 22 | 23 | - Can not get localized string in swift files using genstrings.py [\#8](https://github.com/marmelroy/Localize-Swift/issues/8) 24 | - Suggestion: Change the Localized\(\) method name to localized\(\) to match style best practices [\#7](https://github.com/marmelroy/Localize-Swift/issues/7) 25 | 26 | ## [0.3](https://github.com/marmelroy/Localize-Swift/tree/0.3) (2015-09-28) 27 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.2...0.3) 28 | 29 | ## [0.2](https://github.com/marmelroy/Localize-Swift/tree/0.2) (2015-09-26) 30 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.1...0.2) 31 | 32 | **Closed issues:** 33 | 34 | - Swift 2.0 Compatibility [\#6](https://github.com/marmelroy/Localize-Swift/issues/6) 35 | - Add unit tests [\#5](https://github.com/marmelroy/Localize-Swift/issues/5) 36 | - Add support for plurals with .stringsdict [\#4](https://github.com/marmelroy/Localize-Swift/issues/4) 37 | 38 | ## [0.1](https://github.com/marmelroy/Localize-Swift/tree/0.1) (2015-08-06) 39 | [Full Changelog](https://github.com/marmelroy/Localize-Swift/compare/0.0.1...0.1) 40 | 41 | **Closed issues:** 42 | 43 | - Create Localize-Swift genstrings equivalent [\#3](https://github.com/marmelroy/Localize-Swift/issues/3) 44 | - Add example code [\#2](https://github.com/marmelroy/Localize-Swift/issues/2) 45 | - Add notification on language change [\#1](https://github.com/marmelroy/Localize-Swift/issues/1) 46 | 47 | ## [0.0.1](https://github.com/marmelroy/Localize-Swift/tree/0.0.1) (2015-08-05) 48 | 49 | 50 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Roy Marmelstein (http://roysapps.com/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Localize-Swift.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Localize-Swift" 3 | s.version = "3.2.0" 4 | s.summary = "Swift-friendly localization and i18n syntax with in-app language switching." 5 | s.description = <<-DESC 6 | A simple framework that improves localization and i18n in Swift apps with cleaner syntax and in-app language switching. 7 | DESC 8 | 9 | s.homepage = "https://github.com/marmelroy/Localize-Swift" 10 | s.license = 'MIT' 11 | s.author = { "Roy Marmelstein" => "marmelroy@gmail.com" } 12 | s.source = { :git => "https://github.com/marmelroy/Localize-Swift.git", :tag => s.version.to_s, :submodules => true} 13 | s.social_media_url = "http://twitter.com/marmelroy" 14 | 15 | s.swift_version = '5.3' 16 | s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.3' } 17 | s.requires_arc = true 18 | 19 | s.ios.deployment_target = '9.0' 20 | s.osx.deployment_target = '10.10' 21 | s.tvos.deployment_target = '9.0' 22 | s.watchos.deployment_target = '4.0' 23 | 24 | s.subspec 'LocalizeSwiftCore' do |core| 25 | core.ios.deployment_target = '9.0' 26 | core.osx.deployment_target = '10.10' 27 | core.tvos.deployment_target = '9.0' 28 | core.watchos.deployment_target = '4.0' 29 | core.source_files = "Sources/" 30 | end 31 | 32 | s.subspec 'UIKit' do |ui| 33 | ui.dependency 'Localize-Swift/LocalizeSwiftCore' 34 | ui.ios.deployment_target = '9.0' 35 | ui.source_files = 'Sources/UI/' 36 | end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3433F2411C518AF7003AE34D /* Localize_Swift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3433F2361C518AF7003AE34D /* Localize_Swift.framework */; }; 11 | 3433F2461C518AF7003AE34D /* Localize_SwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3433F2451C518AF7003AE34D /* Localize_SwiftTests.swift */; }; 12 | 3433F2521C518B38003AE34D /* Localize_Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 3433F2501C518B38003AE34D /* Localize_Swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 3433F2531C518B38003AE34D /* Localize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3433F2511C518B38003AE34D /* Localize.swift */; }; 14 | 343A6DD11D1529560081AA37 /* Localize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3433F2511C518B38003AE34D /* Localize.swift */; }; 15 | 343A6DD41D1529560081AA37 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344169461C67539300B93D28 /* Foundation.framework */; }; 16 | 343A6DD61D1529560081AA37 /* Localize_Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 3433F2501C518B38003AE34D /* Localize_Swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 343A6DDF1D152B1B0081AA37 /* Localize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3433F2511C518B38003AE34D /* Localize.swift */; }; 18 | 343A6DE11D152B1B0081AA37 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344169461C67539300B93D28 /* Foundation.framework */; }; 19 | 343A6DE31D152B1B0081AA37 /* Localize_Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 3433F2501C518B38003AE34D /* Localize_Swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20 | 343A6DEC1D152E5A0081AA37 /* Localize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3433F2511C518B38003AE34D /* Localize.swift */; }; 21 | 343A6DEE1D152E5A0081AA37 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344169461C67539300B93D28 /* Foundation.framework */; }; 22 | 343A6DF01D152E5A0081AA37 /* Localize_Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 3433F2501C518B38003AE34D /* Localize_Swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | 344169471C67539300B93D28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344169461C67539300B93D28 /* Foundation.framework */; }; 24 | 345D5906251F83910088CBEC /* IBDesignable+Localize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345D5905251F83910088CBEC /* IBDesignable+Localize.swift */; }; 25 | 68973D661DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */; }; 26 | 68973D671DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */; }; 27 | 68973D681DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */; }; 28 | 68973D691DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */; }; 29 | 68973D6B1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */; }; 30 | 68973D6C1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */; }; 31 | 68973D6D1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */; }; 32 | 68973D6E1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */; }; 33 | 68A520041DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */; }; 34 | 68A520051DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */; }; 35 | 68A520061DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */; }; 36 | 68A520071DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */; }; 37 | /* End PBXBuildFile section */ 38 | 39 | /* Begin PBXContainerItemProxy section */ 40 | 3433F2421C518AF7003AE34D /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 3433F22D1C518AF7003AE34D /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 3433F2351C518AF7003AE34D; 45 | remoteInfo = Localize_Swift; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | 3433F2361C518AF7003AE34D /* Localize_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Localize_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 3433F23B1C518AF7003AE34D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 3433F2401C518AF7003AE34D /* Localize_SwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Localize_SwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 3433F2451C518AF7003AE34D /* Localize_SwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localize_SwiftTests.swift; sourceTree = ""; }; 54 | 3433F2471C518AF7003AE34D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 3433F2501C518B38003AE34D /* Localize_Swift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Localize_Swift.h; path = Sources/Localize_Swift.h; sourceTree = SOURCE_ROOT; }; 56 | 3433F2511C518B38003AE34D /* Localize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Localize.swift; path = Sources/Localize.swift; sourceTree = SOURCE_ROOT; }; 57 | 343A6DDB1D1529560081AA37 /* Localize_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Localize_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 343A6DE81D152B1B0081AA37 /* Localize_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Localize_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 343A6DF51D152E5A0081AA37 /* Localize_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Localize_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 344169461C67539300B93D28 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 61 | 345D5905251F83910088CBEC /* IBDesignable+Localize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "IBDesignable+Localize.swift"; path = "Sources/UI/IBDesignable+Localize.swift"; sourceTree = SOURCE_ROOT; }; 62 | 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+LocalizeBundle.swift"; path = "Sources/String+LocalizeBundle.swift"; sourceTree = SOURCE_ROOT; }; 63 | 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "String+LocalizedBundleTableName.swift"; path = "Sources/String+LocalizedBundleTableName.swift"; sourceTree = SOURCE_ROOT; }; 64 | 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; name = "String+LocalizeTableName.swift"; path = "Sources/String+LocalizeTableName.swift"; sourceTree = SOURCE_ROOT; tabWidth = 4; usesTabs = 0; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 3433F2321C518AF7003AE34D /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 344169471C67539300B93D28 /* Foundation.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 3433F23D1C518AF7003AE34D /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | 3433F2411C518AF7003AE34D /* Localize_Swift.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 343A6DD21D1529560081AA37 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 343A6DD41D1529560081AA37 /* Foundation.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 343A6DE01D152B1B0081AA37 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | 343A6DE11D152B1B0081AA37 /* Foundation.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | 343A6DED1D152E5A0081AA37 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 343A6DEE1D152E5A0081AA37 /* Foundation.framework in Frameworks */, 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXFrameworksBuildPhase section */ 109 | 110 | /* Begin PBXGroup section */ 111 | 3433F22C1C518AF7003AE34D = { 112 | isa = PBXGroup; 113 | children = ( 114 | 3433F2381C518AF7003AE34D /* Localize_Swift */, 115 | 3433F2441C518AF7003AE34D /* Localize_SwiftTests */, 116 | 3433F2371C518AF7003AE34D /* Products */, 117 | ); 118 | indentWidth = 4; 119 | sourceTree = ""; 120 | tabWidth = 4; 121 | }; 122 | 3433F2371C518AF7003AE34D /* Products */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 3433F2361C518AF7003AE34D /* Localize_Swift.framework */, 126 | 3433F2401C518AF7003AE34D /* Localize_SwiftTests.xctest */, 127 | 343A6DDB1D1529560081AA37 /* Localize_Swift.framework */, 128 | 343A6DE81D152B1B0081AA37 /* Localize_Swift.framework */, 129 | 343A6DF51D152E5A0081AA37 /* Localize_Swift.framework */, 130 | ); 131 | name = Products; 132 | sourceTree = ""; 133 | }; 134 | 3433F2381C518AF7003AE34D /* Localize_Swift */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 3433F2501C518B38003AE34D /* Localize_Swift.h */, 138 | 3433F2511C518B38003AE34D /* Localize.swift */, 139 | 68A520031DA6D5FD00F43D9E /* String+LocalizeTableName.swift */, 140 | 68973D651DA7AA200076F08A /* String+LocalizeBundle.swift */, 141 | 68973D6A1DA7AB140076F08A /* String+LocalizedBundleTableName.swift */, 142 | 345D5905251F83910088CBEC /* IBDesignable+Localize.swift */, 143 | 3433F23B1C518AF7003AE34D /* Info.plist */, 144 | 344169461C67539300B93D28 /* Foundation.framework */, 145 | ); 146 | path = Localize_Swift; 147 | sourceTree = ""; 148 | }; 149 | 3433F2441C518AF7003AE34D /* Localize_SwiftTests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 3433F2451C518AF7003AE34D /* Localize_SwiftTests.swift */, 153 | 3433F2471C518AF7003AE34D /* Info.plist */, 154 | ); 155 | path = Localize_SwiftTests; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXHeadersBuildPhase section */ 161 | 3433F2331C518AF7003AE34D /* Headers */ = { 162 | isa = PBXHeadersBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 3433F2521C518B38003AE34D /* Localize_Swift.h in Headers */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | 343A6DD51D1529560081AA37 /* Headers */ = { 170 | isa = PBXHeadersBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 343A6DD61D1529560081AA37 /* Localize_Swift.h in Headers */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | 343A6DE21D152B1B0081AA37 /* Headers */ = { 178 | isa = PBXHeadersBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | 343A6DE31D152B1B0081AA37 /* Localize_Swift.h in Headers */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | 343A6DEF1D152E5A0081AA37 /* Headers */ = { 186 | isa = PBXHeadersBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | 343A6DF01D152E5A0081AA37 /* Localize_Swift.h in Headers */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXHeadersBuildPhase section */ 194 | 195 | /* Begin PBXNativeTarget section */ 196 | 3433F2351C518AF7003AE34D /* Localize_Swift */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 3433F24A1C518AF7003AE34D /* Build configuration list for PBXNativeTarget "Localize_Swift" */; 199 | buildPhases = ( 200 | 3433F2311C518AF7003AE34D /* Sources */, 201 | 3433F2321C518AF7003AE34D /* Frameworks */, 202 | 3433F2331C518AF7003AE34D /* Headers */, 203 | 3433F2341C518AF7003AE34D /* Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | ); 209 | name = Localize_Swift; 210 | productName = Localize_Swift; 211 | productReference = 3433F2361C518AF7003AE34D /* Localize_Swift.framework */; 212 | productType = "com.apple.product-type.framework"; 213 | }; 214 | 3433F23F1C518AF7003AE34D /* Localize_SwiftTests */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = 3433F24D1C518AF7003AE34D /* Build configuration list for PBXNativeTarget "Localize_SwiftTests" */; 217 | buildPhases = ( 218 | 3433F23C1C518AF7003AE34D /* Sources */, 219 | 3433F23D1C518AF7003AE34D /* Frameworks */, 220 | 3433F23E1C518AF7003AE34D /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | 3433F2431C518AF7003AE34D /* PBXTargetDependency */, 226 | ); 227 | name = Localize_SwiftTests; 228 | productName = Localize_SwiftTests; 229 | productReference = 3433F2401C518AF7003AE34D /* Localize_SwiftTests.xctest */; 230 | productType = "com.apple.product-type.bundle.unit-test"; 231 | }; 232 | 343A6DCF1D1529560081AA37 /* Localize_Swift OSX */ = { 233 | isa = PBXNativeTarget; 234 | buildConfigurationList = 343A6DD81D1529560081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift OSX" */; 235 | buildPhases = ( 236 | 343A6DD01D1529560081AA37 /* Sources */, 237 | 343A6DD21D1529560081AA37 /* Frameworks */, 238 | 343A6DD51D1529560081AA37 /* Headers */, 239 | 343A6DD71D1529560081AA37 /* Resources */, 240 | ); 241 | buildRules = ( 242 | ); 243 | dependencies = ( 244 | ); 245 | name = "Localize_Swift OSX"; 246 | productName = Localize_Swift; 247 | productReference = 343A6DDB1D1529560081AA37 /* Localize_Swift.framework */; 248 | productType = "com.apple.product-type.framework"; 249 | }; 250 | 343A6DDD1D152B1B0081AA37 /* Localize_Swift tvOS */ = { 251 | isa = PBXNativeTarget; 252 | buildConfigurationList = 343A6DE51D152B1B0081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift tvOS" */; 253 | buildPhases = ( 254 | 343A6DDE1D152B1B0081AA37 /* Sources */, 255 | 343A6DE01D152B1B0081AA37 /* Frameworks */, 256 | 343A6DE21D152B1B0081AA37 /* Headers */, 257 | 343A6DE41D152B1B0081AA37 /* Resources */, 258 | ); 259 | buildRules = ( 260 | ); 261 | dependencies = ( 262 | ); 263 | name = "Localize_Swift tvOS"; 264 | productName = Localize_Swift; 265 | productReference = 343A6DE81D152B1B0081AA37 /* Localize_Swift.framework */; 266 | productType = "com.apple.product-type.framework"; 267 | }; 268 | 343A6DEA1D152E5A0081AA37 /* Localize_Swift watchOS */ = { 269 | isa = PBXNativeTarget; 270 | buildConfigurationList = 343A6DF21D152E5A0081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift watchOS" */; 271 | buildPhases = ( 272 | 343A6DEB1D152E5A0081AA37 /* Sources */, 273 | 343A6DED1D152E5A0081AA37 /* Frameworks */, 274 | 343A6DEF1D152E5A0081AA37 /* Headers */, 275 | 343A6DF11D152E5A0081AA37 /* Resources */, 276 | ); 277 | buildRules = ( 278 | ); 279 | dependencies = ( 280 | ); 281 | name = "Localize_Swift watchOS"; 282 | productName = Localize_Swift; 283 | productReference = 343A6DF51D152E5A0081AA37 /* Localize_Swift.framework */; 284 | productType = "com.apple.product-type.framework"; 285 | }; 286 | /* End PBXNativeTarget section */ 287 | 288 | /* Begin PBXProject section */ 289 | 3433F22D1C518AF7003AE34D /* Project object */ = { 290 | isa = PBXProject; 291 | attributes = { 292 | LastSwiftUpdateCheck = 0720; 293 | LastUpgradeCheck = 1200; 294 | ORGANIZATIONNAME = "Roy Marmelstein"; 295 | TargetAttributes = { 296 | 3433F2351C518AF7003AE34D = { 297 | CreatedOnToolsVersion = 7.2; 298 | LastSwiftMigration = 1020; 299 | }; 300 | 3433F23F1C518AF7003AE34D = { 301 | CreatedOnToolsVersion = 7.2; 302 | LastSwiftMigration = 0900; 303 | }; 304 | 343A6DEA1D152E5A0081AA37 = { 305 | LastSwiftMigration = 0800; 306 | }; 307 | }; 308 | }; 309 | buildConfigurationList = 3433F2301C518AF7003AE34D /* Build configuration list for PBXProject "Localize_Swift" */; 310 | compatibilityVersion = "Xcode 3.2"; 311 | developmentRegion = en; 312 | hasScannedForEncodings = 0; 313 | knownRegions = ( 314 | en, 315 | Base, 316 | ); 317 | mainGroup = 3433F22C1C518AF7003AE34D; 318 | productRefGroup = 3433F2371C518AF7003AE34D /* Products */; 319 | projectDirPath = ""; 320 | projectRoot = ""; 321 | targets = ( 322 | 3433F2351C518AF7003AE34D /* Localize_Swift */, 323 | 3433F23F1C518AF7003AE34D /* Localize_SwiftTests */, 324 | 343A6DCF1D1529560081AA37 /* Localize_Swift OSX */, 325 | 343A6DDD1D152B1B0081AA37 /* Localize_Swift tvOS */, 326 | 343A6DEA1D152E5A0081AA37 /* Localize_Swift watchOS */, 327 | ); 328 | }; 329 | /* End PBXProject section */ 330 | 331 | /* Begin PBXResourcesBuildPhase section */ 332 | 3433F2341C518AF7003AE34D /* Resources */ = { 333 | isa = PBXResourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | 3433F23E1C518AF7003AE34D /* Resources */ = { 340 | isa = PBXResourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | }; 346 | 343A6DD71D1529560081AA37 /* Resources */ = { 347 | isa = PBXResourcesBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | 343A6DE41D152B1B0081AA37 /* Resources */ = { 354 | isa = PBXResourcesBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | }; 360 | 343A6DF11D152E5A0081AA37 /* Resources */ = { 361 | isa = PBXResourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | /* End PBXResourcesBuildPhase section */ 368 | 369 | /* Begin PBXSourcesBuildPhase section */ 370 | 3433F2311C518AF7003AE34D /* Sources */ = { 371 | isa = PBXSourcesBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | 68973D6B1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */, 375 | 345D5906251F83910088CBEC /* IBDesignable+Localize.swift in Sources */, 376 | 68973D661DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */, 377 | 3433F2531C518B38003AE34D /* Localize.swift in Sources */, 378 | 68A520041DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */, 379 | ); 380 | runOnlyForDeploymentPostprocessing = 0; 381 | }; 382 | 3433F23C1C518AF7003AE34D /* Sources */ = { 383 | isa = PBXSourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | 3433F2461C518AF7003AE34D /* Localize_SwiftTests.swift in Sources */, 387 | ); 388 | runOnlyForDeploymentPostprocessing = 0; 389 | }; 390 | 343A6DD01D1529560081AA37 /* Sources */ = { 391 | isa = PBXSourcesBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | 68973D6C1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */, 395 | 68973D671DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */, 396 | 343A6DD11D1529560081AA37 /* Localize.swift in Sources */, 397 | 68A520051DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */, 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | 343A6DDE1D152B1B0081AA37 /* Sources */ = { 402 | isa = PBXSourcesBuildPhase; 403 | buildActionMask = 2147483647; 404 | files = ( 405 | 68973D6D1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */, 406 | 68973D681DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */, 407 | 343A6DDF1D152B1B0081AA37 /* Localize.swift in Sources */, 408 | 68A520061DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | 343A6DEB1D152E5A0081AA37 /* Sources */ = { 413 | isa = PBXSourcesBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | 68973D6E1DA7AB140076F08A /* String+LocalizedBundleTableName.swift in Sources */, 417 | 68973D691DA7AA200076F08A /* String+LocalizeBundle.swift in Sources */, 418 | 343A6DEC1D152E5A0081AA37 /* Localize.swift in Sources */, 419 | 68A520071DA6D5FD00F43D9E /* String+LocalizeTableName.swift in Sources */, 420 | ); 421 | runOnlyForDeploymentPostprocessing = 0; 422 | }; 423 | /* End PBXSourcesBuildPhase section */ 424 | 425 | /* Begin PBXTargetDependency section */ 426 | 3433F2431C518AF7003AE34D /* PBXTargetDependency */ = { 427 | isa = PBXTargetDependency; 428 | target = 3433F2351C518AF7003AE34D /* Localize_Swift */; 429 | targetProxy = 3433F2421C518AF7003AE34D /* PBXContainerItemProxy */; 430 | }; 431 | /* End PBXTargetDependency section */ 432 | 433 | /* Begin XCBuildConfiguration section */ 434 | 3433F2481C518AF7003AE34D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 439 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 440 | CLANG_CXX_LIBRARY = "libc++"; 441 | CLANG_ENABLE_MODULES = YES; 442 | CLANG_ENABLE_OBJC_ARC = YES; 443 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_COMMA = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 448 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 449 | CLANG_WARN_EMPTY_BODY = YES; 450 | CLANG_WARN_ENUM_CONVERSION = YES; 451 | CLANG_WARN_INFINITE_RECURSION = YES; 452 | CLANG_WARN_INT_CONVERSION = YES; 453 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 455 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 456 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 457 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 458 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 459 | CLANG_WARN_STRICT_PROTOTYPES = YES; 460 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 461 | CLANG_WARN_UNREACHABLE_CODE = YES; 462 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 463 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 464 | COPY_PHASE_STRIP = NO; 465 | CURRENT_PROJECT_VERSION = 14; 466 | DEBUG_INFORMATION_FORMAT = dwarf; 467 | ENABLE_STRICT_OBJC_MSGSEND = YES; 468 | ENABLE_TESTABILITY = YES; 469 | GCC_C_LANGUAGE_STANDARD = gnu99; 470 | GCC_DYNAMIC_NO_PIC = NO; 471 | GCC_NO_COMMON_BLOCKS = YES; 472 | GCC_OPTIMIZATION_LEVEL = 0; 473 | GCC_PREPROCESSOR_DEFINITIONS = ( 474 | "DEBUG=1", 475 | "$(inherited)", 476 | ); 477 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 478 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 479 | GCC_WARN_UNDECLARED_SELECTOR = YES; 480 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 481 | GCC_WARN_UNUSED_FUNCTION = YES; 482 | GCC_WARN_UNUSED_VARIABLE = YES; 483 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 484 | MTL_ENABLE_DEBUG_INFO = YES; 485 | ONLY_ACTIVE_ARCH = YES; 486 | SDKROOT = iphoneos; 487 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 488 | SWIFT_VERSION = 5.0; 489 | TARGETED_DEVICE_FAMILY = "1,2"; 490 | VERSIONING_SYSTEM = "apple-generic"; 491 | VERSION_INFO_PREFIX = ""; 492 | }; 493 | name = Debug; 494 | }; 495 | 3433F2491C518AF7003AE34D /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | ALWAYS_SEARCH_USER_PATHS = NO; 499 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 500 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 501 | CLANG_CXX_LIBRARY = "libc++"; 502 | CLANG_ENABLE_MODULES = YES; 503 | CLANG_ENABLE_OBJC_ARC = YES; 504 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 505 | CLANG_WARN_BOOL_CONVERSION = YES; 506 | CLANG_WARN_COMMA = YES; 507 | CLANG_WARN_CONSTANT_CONVERSION = YES; 508 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 509 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 510 | CLANG_WARN_EMPTY_BODY = YES; 511 | CLANG_WARN_ENUM_CONVERSION = YES; 512 | CLANG_WARN_INFINITE_RECURSION = YES; 513 | CLANG_WARN_INT_CONVERSION = YES; 514 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 515 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 516 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 517 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 518 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 519 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 520 | CLANG_WARN_STRICT_PROTOTYPES = YES; 521 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 522 | CLANG_WARN_UNREACHABLE_CODE = YES; 523 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 524 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 525 | COPY_PHASE_STRIP = NO; 526 | CURRENT_PROJECT_VERSION = 14; 527 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 528 | ENABLE_NS_ASSERTIONS = NO; 529 | ENABLE_STRICT_OBJC_MSGSEND = YES; 530 | GCC_C_LANGUAGE_STANDARD = gnu99; 531 | GCC_NO_COMMON_BLOCKS = YES; 532 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 533 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 534 | GCC_WARN_UNDECLARED_SELECTOR = YES; 535 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 536 | GCC_WARN_UNUSED_FUNCTION = YES; 537 | GCC_WARN_UNUSED_VARIABLE = YES; 538 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 539 | MTL_ENABLE_DEBUG_INFO = NO; 540 | SDKROOT = iphoneos; 541 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 542 | SWIFT_VERSION = 5.0; 543 | TARGETED_DEVICE_FAMILY = "1,2"; 544 | VALIDATE_PRODUCT = YES; 545 | VERSIONING_SYSTEM = "apple-generic"; 546 | VERSION_INFO_PREFIX = ""; 547 | }; 548 | name = Release; 549 | }; 550 | 3433F24B1C518AF7003AE34D /* Debug */ = { 551 | isa = XCBuildConfiguration; 552 | buildSettings = { 553 | APPLICATION_EXTENSION_API_ONLY = YES; 554 | CLANG_ENABLE_MODULES = YES; 555 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 556 | DEFINES_MODULE = YES; 557 | DYLIB_COMPATIBILITY_VERSION = 1; 558 | DYLIB_CURRENT_VERSION = 14; 559 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 560 | INFOPLIST_FILE = Localize_Swift/Info.plist; 561 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 562 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 563 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 564 | ONLY_ACTIVE_ARCH = NO; 565 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 566 | PRODUCT_NAME = "$(TARGET_NAME)"; 567 | SKIP_INSTALL = YES; 568 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 569 | SWIFT_VERSION = 5.0; 570 | }; 571 | name = Debug; 572 | }; 573 | 3433F24C1C518AF7003AE34D /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | buildSettings = { 576 | APPLICATION_EXTENSION_API_ONLY = YES; 577 | CLANG_ENABLE_MODULES = YES; 578 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 579 | DEFINES_MODULE = YES; 580 | DYLIB_COMPATIBILITY_VERSION = 1; 581 | DYLIB_CURRENT_VERSION = 14; 582 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 583 | INFOPLIST_FILE = Localize_Swift/Info.plist; 584 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 585 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 586 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 587 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 588 | PRODUCT_NAME = "$(TARGET_NAME)"; 589 | SKIP_INSTALL = YES; 590 | SWIFT_VERSION = 5.0; 591 | }; 592 | name = Release; 593 | }; 594 | 3433F24E1C518AF7003AE34D /* Debug */ = { 595 | isa = XCBuildConfiguration; 596 | buildSettings = { 597 | INFOPLIST_FILE = Localize_SwiftTests/Info.plist; 598 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 599 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-SwiftTests"; 600 | PRODUCT_NAME = "$(TARGET_NAME)"; 601 | SWIFT_VERSION = 5.0; 602 | }; 603 | name = Debug; 604 | }; 605 | 3433F24F1C518AF7003AE34D /* Release */ = { 606 | isa = XCBuildConfiguration; 607 | buildSettings = { 608 | INFOPLIST_FILE = Localize_SwiftTests/Info.plist; 609 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 610 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-SwiftTests"; 611 | PRODUCT_NAME = "$(TARGET_NAME)"; 612 | SWIFT_VERSION = 5.0; 613 | }; 614 | name = Release; 615 | }; 616 | 343A6DD91D1529560081AA37 /* Debug */ = { 617 | isa = XCBuildConfiguration; 618 | buildSettings = { 619 | APPLICATION_EXTENSION_API_ONLY = YES; 620 | CLANG_ENABLE_MODULES = YES; 621 | DEFINES_MODULE = YES; 622 | DYLIB_COMPATIBILITY_VERSION = 1; 623 | DYLIB_CURRENT_VERSION = 14; 624 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 625 | INFOPLIST_FILE = Localize_Swift/Info.plist; 626 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 627 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 628 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 629 | MACOSX_DEPLOYMENT_TARGET = 10.10; 630 | ONLY_ACTIVE_ARCH = NO; 631 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 632 | PRODUCT_NAME = Localize_Swift; 633 | SDKROOT = macosx; 634 | SKIP_INSTALL = YES; 635 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 636 | SWIFT_VERSION = 5.0; 637 | }; 638 | name = Debug; 639 | }; 640 | 343A6DDA1D1529560081AA37 /* Release */ = { 641 | isa = XCBuildConfiguration; 642 | buildSettings = { 643 | APPLICATION_EXTENSION_API_ONLY = YES; 644 | CLANG_ENABLE_MODULES = YES; 645 | DEFINES_MODULE = YES; 646 | DYLIB_COMPATIBILITY_VERSION = 1; 647 | DYLIB_CURRENT_VERSION = 14; 648 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 649 | INFOPLIST_FILE = Localize_Swift/Info.plist; 650 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 651 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 652 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 653 | MACOSX_DEPLOYMENT_TARGET = 10.10; 654 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 655 | PRODUCT_NAME = Localize_Swift; 656 | SDKROOT = macosx; 657 | SKIP_INSTALL = YES; 658 | SWIFT_VERSION = 5.0; 659 | }; 660 | name = Release; 661 | }; 662 | 343A6DE61D152B1B0081AA37 /* Debug */ = { 663 | isa = XCBuildConfiguration; 664 | buildSettings = { 665 | APPLICATION_EXTENSION_API_ONLY = YES; 666 | CLANG_ENABLE_MODULES = YES; 667 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 668 | DEFINES_MODULE = YES; 669 | DYLIB_COMPATIBILITY_VERSION = 1; 670 | DYLIB_CURRENT_VERSION = 14; 671 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 672 | INFOPLIST_FILE = "$(SRCROOT)/Localize_Swift/Info.plist"; 673 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 674 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 675 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 676 | ONLY_ACTIVE_ARCH = NO; 677 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 678 | PRODUCT_NAME = Localize_Swift; 679 | SDKROOT = appletvos; 680 | SKIP_INSTALL = YES; 681 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 682 | SWIFT_VERSION = 5.0; 683 | TARGETED_DEVICE_FAMILY = 3; 684 | TVOS_DEPLOYMENT_TARGET = 9.0; 685 | }; 686 | name = Debug; 687 | }; 688 | 343A6DE71D152B1B0081AA37 /* Release */ = { 689 | isa = XCBuildConfiguration; 690 | buildSettings = { 691 | APPLICATION_EXTENSION_API_ONLY = YES; 692 | CLANG_ENABLE_MODULES = YES; 693 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 694 | DEFINES_MODULE = YES; 695 | DYLIB_COMPATIBILITY_VERSION = 1; 696 | DYLIB_CURRENT_VERSION = 14; 697 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 698 | INFOPLIST_FILE = "$(SRCROOT)/Localize_Swift/Info.plist"; 699 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 700 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 701 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 702 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 703 | PRODUCT_NAME = Localize_Swift; 704 | SDKROOT = appletvos; 705 | SKIP_INSTALL = YES; 706 | SWIFT_VERSION = 5.0; 707 | TARGETED_DEVICE_FAMILY = 3; 708 | TVOS_DEPLOYMENT_TARGET = 9.0; 709 | }; 710 | name = Release; 711 | }; 712 | 343A6DF31D152E5A0081AA37 /* Debug */ = { 713 | isa = XCBuildConfiguration; 714 | buildSettings = { 715 | APPLICATION_EXTENSION_API_ONLY = YES; 716 | CLANG_ENABLE_MODULES = YES; 717 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 718 | DEFINES_MODULE = YES; 719 | DYLIB_COMPATIBILITY_VERSION = 1; 720 | DYLIB_CURRENT_VERSION = 14; 721 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 722 | INFOPLIST_FILE = "$(SRCROOT)/Localize_Swift/Info.plist"; 723 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 724 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 725 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 726 | ONLY_ACTIVE_ARCH = NO; 727 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 728 | PRODUCT_NAME = Localize_Swift; 729 | SDKROOT = watchos; 730 | SKIP_INSTALL = YES; 731 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 732 | SWIFT_VERSION = 5.0; 733 | TARGETED_DEVICE_FAMILY = 4; 734 | WATCHOS_DEPLOYMENT_TARGET = 4.0; 735 | }; 736 | name = Debug; 737 | }; 738 | 343A6DF41D152E5A0081AA37 /* Release */ = { 739 | isa = XCBuildConfiguration; 740 | buildSettings = { 741 | APPLICATION_EXTENSION_API_ONLY = YES; 742 | CLANG_ENABLE_MODULES = YES; 743 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 744 | DEFINES_MODULE = YES; 745 | DYLIB_COMPATIBILITY_VERSION = 1; 746 | DYLIB_CURRENT_VERSION = 14; 747 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 748 | INFOPLIST_FILE = "$(SRCROOT)/Localize_Swift/Info.plist"; 749 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 750 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 751 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 752 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.Localize-Swift"; 753 | PRODUCT_NAME = Localize_Swift; 754 | SDKROOT = watchos; 755 | SKIP_INSTALL = YES; 756 | SWIFT_VERSION = 5.0; 757 | TARGETED_DEVICE_FAMILY = 4; 758 | WATCHOS_DEPLOYMENT_TARGET = 4.0; 759 | }; 760 | name = Release; 761 | }; 762 | /* End XCBuildConfiguration section */ 763 | 764 | /* Begin XCConfigurationList section */ 765 | 3433F2301C518AF7003AE34D /* Build configuration list for PBXProject "Localize_Swift" */ = { 766 | isa = XCConfigurationList; 767 | buildConfigurations = ( 768 | 3433F2481C518AF7003AE34D /* Debug */, 769 | 3433F2491C518AF7003AE34D /* Release */, 770 | ); 771 | defaultConfigurationIsVisible = 0; 772 | defaultConfigurationName = Release; 773 | }; 774 | 3433F24A1C518AF7003AE34D /* Build configuration list for PBXNativeTarget "Localize_Swift" */ = { 775 | isa = XCConfigurationList; 776 | buildConfigurations = ( 777 | 3433F24B1C518AF7003AE34D /* Debug */, 778 | 3433F24C1C518AF7003AE34D /* Release */, 779 | ); 780 | defaultConfigurationIsVisible = 0; 781 | defaultConfigurationName = Release; 782 | }; 783 | 3433F24D1C518AF7003AE34D /* Build configuration list for PBXNativeTarget "Localize_SwiftTests" */ = { 784 | isa = XCConfigurationList; 785 | buildConfigurations = ( 786 | 3433F24E1C518AF7003AE34D /* Debug */, 787 | 3433F24F1C518AF7003AE34D /* Release */, 788 | ); 789 | defaultConfigurationIsVisible = 0; 790 | defaultConfigurationName = Release; 791 | }; 792 | 343A6DD81D1529560081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift OSX" */ = { 793 | isa = XCConfigurationList; 794 | buildConfigurations = ( 795 | 343A6DD91D1529560081AA37 /* Debug */, 796 | 343A6DDA1D1529560081AA37 /* Release */, 797 | ); 798 | defaultConfigurationIsVisible = 0; 799 | defaultConfigurationName = Release; 800 | }; 801 | 343A6DE51D152B1B0081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift tvOS" */ = { 802 | isa = XCConfigurationList; 803 | buildConfigurations = ( 804 | 343A6DE61D152B1B0081AA37 /* Debug */, 805 | 343A6DE71D152B1B0081AA37 /* Release */, 806 | ); 807 | defaultConfigurationIsVisible = 0; 808 | defaultConfigurationName = Release; 809 | }; 810 | 343A6DF21D152E5A0081AA37 /* Build configuration list for PBXNativeTarget "Localize_Swift watchOS" */ = { 811 | isa = XCConfigurationList; 812 | buildConfigurations = ( 813 | 343A6DF31D152E5A0081AA37 /* Debug */, 814 | 343A6DF41D152E5A0081AA37 /* Release */, 815 | ); 816 | defaultConfigurationIsVisible = 0; 817 | defaultConfigurationName = Release; 818 | }; 819 | /* End XCConfigurationList section */ 820 | }; 821 | rootObject = 3433F22D1C518AF7003AE34D /* Project object */; 822 | } 823 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/xcshareddata/xcschemes/Localize_Swift OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/xcshareddata/xcschemes/Localize_Swift tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/xcshareddata/xcschemes/Localize_Swift watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/xcshareddata/xcschemes/Localize_Swift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 63 | 69 | 70 | 71 | 72 | 78 | 79 | 85 | 86 | 87 | 88 | 90 | 91 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Localize_Swift.xcodeproj/xcshareddata/xcschemes/Localize_SwiftTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 37 | 38 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Localize_Swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 14 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Localize_SwiftTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | 3.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 14 23 | 24 | 25 | -------------------------------------------------------------------------------- /Localize_SwiftTests/Localize_SwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Localize_SwiftTests.swift 3 | // Localize_SwiftTests 4 | // 5 | // Created by Roy Marmelstein on 21/01/2016. 6 | // Copyright © 2020 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Localize_Swift 11 | 12 | class Localize_SwiftTests: 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 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Localize_Swift", 7 | products: [ 8 | .library( 9 | name: "Localize_Swift", 10 | targets: ["Localize_Swift"]), 11 | ], 12 | dependencies: [], 13 | targets: [ 14 | .target( 15 | name: "Localize_Swift", 16 | path: "Sources") 17 | ], 18 | swiftLanguageVersions: [.v5] 19 | ) 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Platform](https://img.shields.io/cocoapods/p/Localize-Swift.svg?maxAge=2592000)](http://cocoapods.org/?q=Localize-Swift) 2 | [![Version](http://img.shields.io/cocoapods/v/Localize-Swift.svg)](http://cocoapods.org/?q=Localize-Swift) 3 | [![Build Status](https://travis-ci.org/marmelroy/Localize-Swift.svg?branch=master)](https://travis-ci.org/marmelroy/Localize-Swift) 4 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 5 | 6 | # Localize-Swift 7 | Localize-Swift is a simple framework that improves i18n and localization in Swift iOS apps - providing cleaner syntax and in-app language switching. 8 | 9 |

10 | 11 | ## Features 12 | 13 | - Keep the Localizable.strings file your app already uses. 14 | - Allow your users to change the app's language without changing their device language. 15 | - Use .localized() instead of NSLocalizedString(key,comment) - a more Swifty syntax. 16 | - Generate your strings with a new genstrings swift/python script that recognises .localized(). 17 | 18 | ## Usage 19 | 20 | Import Localize at the top of each Swift file that will contain localized text. 21 | 22 | If CocoaPods - 23 | ```swift 24 | import Localize_Swift 25 | ``` 26 | 27 | Add `.localized()` following any `String` object you want translated: 28 | ```swift 29 | textLabel.text = "Hello World".localized() 30 | ``` 31 | 32 | To get an array of available localizations: 33 | ```swift 34 | Localize.availableLanguages() 35 | ``` 36 | 37 | To change the current language: 38 | ```swift 39 | Localize.setCurrentLanguage("fr") 40 | ``` 41 | 42 | To update the UI in the view controller where a language change can take place, observe LCLLanguageChangeNotification: 43 | ```swift 44 | NotificationCenter.default.addObserver(self, selector: #selector(setText), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil) 45 | ``` 46 | 47 | To reset back to the default app language: 48 | ```swift 49 | Localize.resetCurrentLanguageToDefault() 50 | ``` 51 | 52 | ## genstrings 53 | 54 | To support this new i18n syntax, Localize-Swift includes custom genstrings swift script. 55 | 56 | Copy the genstrings.swift file into your project's root folder and run with 57 | 58 | ```bash 59 | ./genstrings.swift 60 | ``` 61 | 62 | This will print the collected strings in the terminal. Select and copy to your default Localizable.strings. 63 | 64 | The script includes the ability to specify excluded directories and files (by editing the script). 65 | 66 | ### [Preferrred] Setting up with [Swift Package Manager](https://swiftpm.co/?query=Localize-Swift) 67 | 68 | The [Swift Package Manager](https://swift.org/package-manager/) is now the preferred tool for distributing Localize-Swift. 69 | 70 | From Xcode 11+ : 71 | 72 | 1. Select File > Swift Packages > Add Package Dependency. Enter `https://github.com/marmelroy/Localize-Swift.git` in the "Choose Package Repository" dialog. 73 | 2. In the next page, specify the version resolving rule as "Up to Next Major" with "3.2.0". 74 | 3. After Xcode checked out the source and resolving the version, you can choose the "Localize-Swift" library and add it to your app target. 75 | 76 | For more info, read [Adding Package Dependencies to Your App](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) from Apple. 77 | 78 | Alternatively, you can also add Localize-Swift to your `Package.swift` file: 79 | 80 | ```swift 81 | dependencies: [ 82 | .package(url: "https://github.com/marmelroy/Localize-Swift.git", .upToNextMajor(from: "3.2.0")) 83 | ] 84 | ``` 85 | 86 | ### Setting up with Carthage 87 | 88 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application. 89 | 90 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 91 | 92 | ```bash 93 | $ brew update 94 | $ brew install carthage 95 | ``` 96 | 97 | To integrate Localize-Swift into your Xcode project using Carthage, specify it in your `Cartfile`: 98 | 99 | ```ogdl 100 | github "marmelroy/Localize-Swift" 101 | ``` 102 | 103 | ### Setting up with [CocoaPods](http://cocoapods.org/?q=Localize-Swift) 104 | ```ruby 105 | source 'https://github.com/CocoaPods/Specs.git' 106 | pod 'Localize-Swift', '~> 3.2' 107 | ``` 108 | -------------------------------------------------------------------------------- /Sources/Localize.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Localize.swift 3 | // Localize 4 | // 5 | // Created by Roy Marmelstein on 05/08/2015. 6 | // Copyright © 2015 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Internal current language key 12 | let LCLCurrentLanguageKey = "LCLCurrentLanguageKey" 13 | 14 | /// Default language. English. If English is unavailable defaults to base localization. 15 | let LCLDefaultLanguage = "en" 16 | 17 | /// Base bundle as fallback. 18 | let LCLBaseBundle = "Base" 19 | 20 | /// Name for language change notification 21 | public let LCLLanguageChangeNotification = "LCLLanguageChangeNotification" 22 | 23 | // MARK: Localization Syntax 24 | 25 | /** 26 | Swift 1.x friendly localization syntax, replaces NSLocalizedString 27 | - Parameter string: Key to be localized. 28 | - Returns: The localized string. 29 | */ 30 | public func Localized(_ string: String) -> String { 31 | return string.localized() 32 | } 33 | 34 | /** 35 | Swift 1.x friendly localization syntax with format arguments, replaces String(format:NSLocalizedString) 36 | - Parameter string: Key to be localized. 37 | - Returns: The formatted localized string with arguments. 38 | */ 39 | public func Localized(_ string: String, arguments: CVarArg...) -> String { 40 | return String(format: string.localized(), arguments: arguments) 41 | } 42 | 43 | /** 44 | Swift 1.x friendly plural localization syntax with a format argument 45 | 46 | - parameter string: String to be formatted 47 | - parameter argument: Argument to determine pluralisation 48 | 49 | - returns: Pluralized localized string. 50 | */ 51 | public func LocalizedPlural(_ string: String, argument: CVarArg) -> String { 52 | return string.localizedPlural(argument) 53 | } 54 | 55 | 56 | public extension String { 57 | /** 58 | Swift 2 friendly localization syntax, replaces NSLocalizedString 59 | - Returns: The localized string. 60 | */ 61 | func localized() -> String { 62 | return localized(using: nil, in: .main) 63 | } 64 | 65 | /** 66 | Swift 2 friendly localization syntax with format arguments, replaces String(format:NSLocalizedString) 67 | - Returns: The formatted localized string with arguments. 68 | */ 69 | func localizedFormat(_ arguments: CVarArg...) -> String { 70 | return String(format: localized(), arguments: arguments) 71 | } 72 | 73 | /** 74 | Swift 2 friendly plural localization syntax with a format argument 75 | 76 | - parameter argument: Argument to determine pluralisation 77 | 78 | - returns: Pluralized localized string. 79 | */ 80 | func localizedPlural(_ argument: CVarArg) -> String { 81 | return NSString.localizedStringWithFormat(localized() as NSString, argument) as String 82 | } 83 | 84 | /** 85 | Add comment for NSLocalizedString 86 | - Returns: The localized string. 87 | */ 88 | func commented(_ argument: String) -> String { 89 | return self 90 | } 91 | } 92 | 93 | 94 | 95 | // MARK: Language Setting Functions 96 | 97 | open class Localize: NSObject { 98 | 99 | /** 100 | List available languages 101 | - Returns: Array of available languages. 102 | */ 103 | open class func availableLanguages(_ excludeBase: Bool = false) -> [String] { 104 | var availableLanguages = Bundle.main.localizations 105 | // If excludeBase = true, don't include "Base" in available languages 106 | if let indexOfBase = availableLanguages.firstIndex(of: "Base") , excludeBase == true { 107 | availableLanguages.remove(at: indexOfBase) 108 | } 109 | return availableLanguages 110 | } 111 | 112 | /** 113 | Current language 114 | - Returns: The current language. String. 115 | */ 116 | open class func currentLanguage() -> String { 117 | if let currentLanguage = UserDefaults.standard.object(forKey: LCLCurrentLanguageKey) as? String { 118 | return currentLanguage 119 | } 120 | return defaultLanguage() 121 | } 122 | 123 | /** 124 | Change the current language 125 | - Parameter language: Desired language. 126 | */ 127 | open class func setCurrentLanguage(_ language: String) { 128 | let selectedLanguage = availableLanguages().contains(language) ? language : defaultLanguage() 129 | if (selectedLanguage != currentLanguage()){ 130 | UserDefaults.standard.set(selectedLanguage, forKey: LCLCurrentLanguageKey) 131 | UserDefaults.standard.synchronize() 132 | NotificationCenter.default.post(name: Notification.Name(rawValue: LCLLanguageChangeNotification), object: nil) 133 | } 134 | } 135 | 136 | /** 137 | Default language 138 | - Returns: The app's default language. String. 139 | */ 140 | open class func defaultLanguage() -> String { 141 | var defaultLanguage: String = String() 142 | guard let preferredLanguage = Bundle.main.preferredLocalizations.first else { 143 | return LCLDefaultLanguage 144 | } 145 | let availableLanguages: [String] = self.availableLanguages() 146 | if (availableLanguages.contains(preferredLanguage)) { 147 | defaultLanguage = preferredLanguage 148 | } 149 | else { 150 | defaultLanguage = LCLDefaultLanguage 151 | } 152 | return defaultLanguage 153 | } 154 | 155 | /** 156 | Resets the current language to the default 157 | */ 158 | open class func resetCurrentLanguageToDefault() { 159 | setCurrentLanguage(self.defaultLanguage()) 160 | } 161 | 162 | /** 163 | Get the current language's display name for a language. 164 | - Parameter language: Desired language. 165 | - Returns: The localized string. 166 | */ 167 | open class func displayNameForLanguage(_ language: String) -> String { 168 | let locale : NSLocale = NSLocale(localeIdentifier: currentLanguage()) 169 | if let displayName = locale.displayName(forKey: NSLocale.Key.identifier, value: language) { 170 | return displayName 171 | } 172 | return String() 173 | } 174 | } 175 | 176 | -------------------------------------------------------------------------------- /Sources/Localize_Swift.h: -------------------------------------------------------------------------------- 1 | // 2 | // Localize_Swift.h 3 | // Localize_Swift 4 | // 5 | // Created by Roy Marmelstein on 21/01/2016. 6 | // Copyright © 2020 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | //! Project version number for Localize_Swift. 12 | FOUNDATION_EXPORT double Localize_SwiftVersionNumber; 13 | 14 | //! Project version string for Localize_Swift. 15 | FOUNDATION_EXPORT const unsigned char Localize_SwiftVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/String+LocalizeBundle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+LocalizeBundle.swift 3 | // Localize_Swift 4 | // 5 | // Copyright © 2020 Roy Marmelstein. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | /// bundle friendly extension 11 | public extension String { 12 | 13 | /** 14 | Swift 2 friendly localization syntax, replaces NSLocalizedString. 15 | 16 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 17 | the method attempts to use main bundle. 18 | 19 | - returns: The localized string. 20 | */ 21 | func localized(in bundle: Bundle?) -> String { 22 | return localized(using: nil, in: bundle) 23 | } 24 | 25 | /** 26 | Swift 2 friendly localization syntax with format arguments, replaces String(format:NSLocalizedString). 27 | 28 | - parameter arguments: arguments values for temlpate (substituted according to the user’s default locale). 29 | 30 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 31 | the method attempts to use main bundle. 32 | 33 | - returns: The formatted localized string with arguments. 34 | */ 35 | func localizedFormat(arguments: CVarArg..., in bundle: Bundle?) -> String { 36 | return String(format: localized(in: bundle), arguments: arguments) 37 | } 38 | 39 | /** 40 | Swift 2 friendly plural localization syntax with a format argument. 41 | 42 | - parameter argument: Argument to determine pluralisation. 43 | 44 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 45 | the method attempts to use main bundle. 46 | 47 | - returns: Pluralized localized string. 48 | */ 49 | func localizedPlural(argument: CVarArg, in bundle: Bundle?) -> String { 50 | return NSString.localizedStringWithFormat(localized(in: bundle) as NSString, argument) as String 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Sources/String+LocalizeTableName.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+LocalizeTableName.swift 3 | // Localize_Swift 4 | // 5 | // Copyright © 2020 Vitalii Budnik. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | /// tableName friendly extension 11 | public extension String { 12 | 13 | /** 14 | Swift 2 friendly localization syntax, replaces NSLocalizedString. 15 | 16 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 17 | or is an empty string, the method attempts to use `Localizable.strings`. 18 | 19 | - returns: The localized string. 20 | */ 21 | func localized(using tableName: String?) -> String { 22 | return localized(using: tableName, in: .main) 23 | } 24 | 25 | /** 26 | Swift 2 friendly localization syntax with format arguments, replaces String(format:NSLocalizedString). 27 | 28 | - parameter arguments: arguments values for temlpate (substituted according to the user’s default locale). 29 | 30 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 31 | or is an empty string, the method attempts to use `Localizable.strings`. 32 | 33 | - returns: The formatted localized string with arguments. 34 | */ 35 | func localizedFormat(arguments: CVarArg..., using tableName: String?) -> String { 36 | return String(format: localized(using: tableName), arguments: arguments) 37 | } 38 | 39 | /** 40 | Swift 2 friendly plural localization syntax with a format argument. 41 | 42 | - parameter argument: Argument to determine pluralisation. 43 | 44 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 45 | or is an empty string, the method attempts to use `Localizable.strings`. 46 | 47 | - returns: Pluralized localized string. 48 | */ 49 | func localizedPlural(argument: CVarArg, using tableName: String?) -> String { 50 | return NSString.localizedStringWithFormat(localized(using: tableName) as NSString, argument) as String 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Sources/String+LocalizedBundleTableName.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+LocalizedBundleTableName.swift 3 | // Localize_Swift 4 | // 5 | // Copyright © 2020 Roy Marmelstein. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | /// bundle & tableName friendly extension 11 | public extension String { 12 | 13 | /** 14 | Swift 2 friendly localization syntax, replaces NSLocalizedString. 15 | 16 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 17 | or is an empty string, the method attempts to use `Localizable.strings`. 18 | 19 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 20 | the method attempts to use main bundle. 21 | 22 | - returns: The localized string. 23 | */ 24 | func localized(using tableName: String?, in bundle: Bundle?) -> String { 25 | let bundle: Bundle = bundle ?? .main 26 | if let path = bundle.path(forResource: Localize.currentLanguage(), ofType: "lproj"), 27 | let bundle = Bundle(path: path) { 28 | return bundle.localizedString(forKey: self, value: nil, table: tableName) 29 | } 30 | else if let path = bundle.path(forResource: LCLBaseBundle, ofType: "lproj"), 31 | let bundle = Bundle(path: path) { 32 | return bundle.localizedString(forKey: self, value: nil, table: tableName) 33 | } 34 | return self 35 | } 36 | 37 | /** 38 | Swift 2 friendly localization syntax with format arguments, replaces String(format:NSLocalizedString). 39 | 40 | - parameter arguments: arguments values for temlpate (substituted according to the user’s default locale). 41 | 42 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 43 | or is an empty string, the method attempts to use `Localizable.strings`. 44 | 45 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 46 | the method attempts to use main bundle. 47 | 48 | - returns: The formatted localized string with arguments. 49 | */ 50 | func localizedFormat(arguments: CVarArg..., using tableName: String?, in bundle: Bundle?) -> String { 51 | return String(format: localized(using: tableName, in: bundle), arguments: arguments) 52 | } 53 | 54 | /** 55 | Swift 2 friendly plural localization syntax with a format argument. 56 | 57 | - parameter argument: Argument to determine pluralisation. 58 | 59 | - parameter tableName: The receiver’s string table to search. If tableName is `nil` 60 | or is an empty string, the method attempts to use `Localizable.strings`. 61 | 62 | - parameter bundle: The receiver’s bundle to search. If bundle is `nil`, 63 | the method attempts to use main bundle. 64 | 65 | - returns: Pluralized localized string. 66 | */ 67 | func localizedPlural(argument: CVarArg, using tableName: String?, in bundle: Bundle?) -> String { 68 | return NSString.localizedStringWithFormat(localized(using: tableName, in: bundle) as NSString, argument) as String 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Sources/UI/IBDesignable+Localize.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBDesignable+Localize1.swift 3 | // Localize-Swift 4 | // 5 | // Copyright © 2020 Roy Marmelstein. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | // MARK: - UILabel localize Key extention for language in story board 12 | 13 | @IBDesignable public extension UILabel { 14 | @IBInspectable var localizeKey: String? { 15 | set { 16 | // set new value from dictionary 17 | DispatchQueue.main.async { 18 | self.text = newValue?.localized() 19 | } 20 | } 21 | get { 22 | return self.text 23 | } 24 | } 25 | } 26 | 27 | // MARK: - UIButton localize Key extention for language in story board 28 | 29 | @IBDesignable public extension UIButton { 30 | 31 | @IBInspectable var localizeKey: String? { 32 | set { 33 | // set new value from dictionary 34 | DispatchQueue.main.async { 35 | self.setTitle(newValue?.localized(), for: .normal) 36 | } 37 | } 38 | get { 39 | return self.titleLabel?.text 40 | } 41 | } 42 | } 43 | 44 | // MARK: - UITextView localize Key extention for language in story board 45 | 46 | @IBDesignable public extension UITextView { 47 | 48 | @IBInspectable var localizeKey: String? { 49 | set { 50 | // set new value from dictionary 51 | DispatchQueue.main.async { 52 | self.text = newValue?.localized() 53 | } 54 | } 55 | get { 56 | return self.text 57 | } 58 | } 59 | } 60 | 61 | // MARK: - UITextField localize Key extention for language in story board 62 | 63 | @IBDesignable public extension UITextField { 64 | @IBInspectable var localizeKey: String? { 65 | set { 66 | // set new value from dictionary 67 | DispatchQueue.main.async { 68 | self.placeholder = newValue?.localized() 69 | } 70 | } 71 | get { 72 | return self.placeholder 73 | } 74 | } 75 | } 76 | 77 | // MARK: - UINavigationItem localize Key extention for language in story board 78 | 79 | @IBDesignable public extension UINavigationItem { 80 | 81 | @IBInspectable var localizeKey: String? { 82 | set { 83 | // set new value from dictionary 84 | DispatchQueue.main.async { 85 | self.title = newValue?.localized() 86 | } 87 | } 88 | get { 89 | return self.title 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # **** Update me when new Xcode versions are released! **** 4 | PLATFORM="platform=iOS Simulator,OS=14.0,name=iPhone 11" 5 | SDK="iphonesimulator" 6 | 7 | 8 | # It is pitch black. 9 | set -e 10 | function trap_handler() { 11 | echo -e "\n\nOh no! You walked directly into the slavering fangs of a lurking grue!" 12 | echo "**** You have died ****" 13 | exit 255 14 | } 15 | trap trap_handler INT TERM EXIT 16 | 17 | 18 | MODE="$1" 19 | 20 | if [ "$MODE" = "build" ]; then 21 | echo "Building Localize-Swift." 22 | xcodebuild \ 23 | -project Localize_Swift.xcodeproj \ 24 | -scheme Localize_Swift \ 25 | -sdk "$SDK" \ 26 | -destination "$PLATFORM" \ 27 | build 28 | trap - EXIT 29 | exit 0 30 | fi 31 | 32 | if [ "$MODE" = "examples" ]; then 33 | echo "Building and testing all Localize-Swift examples." 34 | 35 | for example in examples/*/; do 36 | echo "Building $example." 37 | pod install --project-directory=$example 38 | xcodebuild \ 39 | -workspace "${example}Sample.xcworkspace" \ 40 | -scheme Sample \ 41 | -sdk "$SDK" \ 42 | -destination "$PLATFORM" \ 43 | build test 44 | done 45 | trap - EXIT 46 | exit 0 47 | fi 48 | 49 | echo "Unrecognised mode '$MODE'." 50 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/.gitignore: -------------------------------------------------------------------------------- 1 | Pods 2 | *.xcworkspace 3 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, "9.0" 3 | use_frameworks! 4 | 5 | target 'Sample' do 6 | use_frameworks! 7 | 8 | # Pods for Sample 9 | pod 'Localize-Swift', :path => '../..' 10 | 11 | target 'SampleTests' do 12 | inherit! :search_paths 13 | # Pods for testing 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 06E2E79FC9AE1C1A60C82901 /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 333B3261F84DF59D1EBBD7A4 /* Pods_Sample.framework */; }; 11 | 3426FF931BB6AEE200E8E1BB /* SampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3426FF921BB6AEE200E8E1BB /* SampleTests.swift */; }; 12 | 3426FF9B1BB6AF5D00E8E1BB /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34346D2F1B72983C0063FED4 /* Localizable.strings */; }; 13 | 34346D031B7294470063FED4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34346D021B7294470063FED4 /* AppDelegate.swift */; }; 14 | 34346D051B7294470063FED4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34346D041B7294470063FED4 /* ViewController.swift */; }; 15 | 34346D081B7294470063FED4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34346D061B7294470063FED4 /* Main.storyboard */; }; 16 | 34346D0A1B7294470063FED4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34346D091B7294470063FED4 /* Images.xcassets */; }; 17 | 34346D0D1B7294470063FED4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34346D0B1B7294470063FED4 /* LaunchScreen.xib */; }; 18 | 34346D2C1B72983C0063FED4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34346D2F1B72983C0063FED4 /* Localizable.strings */; }; 19 | 38D3913AD60437BD37190772 /* Pods_SampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B823A35026E31B4C36949480 /* Pods_SampleTests.framework */; }; 20 | 68A5200A1DA6D98000F43D9E /* ButtonTitles.strings in Resources */ = {isa = PBXBuildFile; fileRef = 68A5200C1DA6D98000F43D9E /* ButtonTitles.strings */; }; 21 | 68A520181DA6DC0200F43D9E /* ButtonTitles.strings in Resources */ = {isa = PBXBuildFile; fileRef = 68A5200C1DA6D98000F43D9E /* ButtonTitles.strings */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 3426FF951BB6AEE200E8E1BB /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 34346CF51B7294470063FED4 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 34346CFC1B7294470063FED4; 30 | remoteInfo = Sample; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXCopyFilesBuildPhase section */ 35 | 342B3BE61DDAEA4700F6D25D /* Embed Frameworks */ = { 36 | isa = PBXCopyFilesBuildPhase; 37 | buildActionMask = 2147483647; 38 | dstPath = ""; 39 | dstSubfolderSpec = 10; 40 | files = ( 41 | ); 42 | name = "Embed Frameworks"; 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXCopyFilesBuildPhase section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | 066A759900EDAF0801EE7E71 /* Pods-SampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleTests/Pods-SampleTests.debug.xcconfig"; sourceTree = ""; }; 49 | 20D57BE01DC0AF00001BA2F9 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; 50 | 333B3261F84DF59D1EBBD7A4 /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 3426FF901BB6AEE200E8E1BB /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 3426FF921BB6AEE200E8E1BB /* SampleTests.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = SampleTests.swift; sourceTree = ""; tabWidth = 4; usesTabs = 0; }; 53 | 3426FF941BB6AEE200E8E1BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 34346CFD1B7294470063FED4 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 34346D011B7294470063FED4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 34346D021B7294470063FED4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 57 | 34346D041B7294470063FED4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 58 | 34346D091B7294470063FED4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 59 | 34346D2E1B72983C0063FED4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 60 | 34346D301B7298A80063FED4 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; 61 | 34346D311B7298AF0063FED4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 62 | 34346D321B7298B70063FED4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 63 | 34346D331B7298BD0063FED4 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; 64 | 34346D341B7298C60063FED4 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; 65 | 34346D351B7298DD0063FED4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 66 | 34346D361B7298E80063FED4 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; 67 | 68A5200B1DA6D98000F43D9E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ButtonTitles.strings; sourceTree = ""; }; 68 | 68A520111DA6DA3400F43D9E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/ButtonTitles.strings; sourceTree = ""; }; 69 | 68A520121DA6DA4100F43D9E /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/ButtonTitles.strings; sourceTree = ""; }; 70 | 68A520131DA6DA5A00F43D9E /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/ButtonTitles.strings; sourceTree = ""; }; 71 | 68A520141DA6DA6C00F43D9E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/ButtonTitles.strings; sourceTree = ""; }; 72 | 68A520151DA6DA7A00F43D9E /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/ButtonTitles.strings; sourceTree = ""; }; 73 | 68A520161DA6DA8900F43D9E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ButtonTitles.strings"; sourceTree = ""; }; 74 | 68A520171DA6DA9600F43D9E /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/ButtonTitles.strings; sourceTree = ""; }; 75 | 90CA2BF966754C71EDEE5937 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; 76 | B5FD741D4E0971BE3BCD2E74 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; 77 | B823A35026E31B4C36949480 /* Pods_SampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | D50B0502E8EE0192A195033B /* Pods-SampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleTests/Pods-SampleTests.release.xcconfig"; sourceTree = ""; }; 79 | E74D4EC72176ECAE002CB79C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 80 | E74D4EC82176ECAE002CB79C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | 3426FF8D1BB6AEE200E8E1BB /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 38D3913AD60437BD37190772 /* Pods_SampleTests.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 34346CFA1B7294470063FED4 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | 06E2E79FC9AE1C1A60C82901 /* Pods_Sample.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | /* End PBXFrameworksBuildPhase section */ 101 | 102 | /* Begin PBXGroup section */ 103 | 1296D3EDC6FA72EB325EB960 /* Frameworks */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 333B3261F84DF59D1EBBD7A4 /* Pods_Sample.framework */, 107 | B823A35026E31B4C36949480 /* Pods_SampleTests.framework */, 108 | ); 109 | name = Frameworks; 110 | sourceTree = ""; 111 | }; 112 | 3426FF911BB6AEE200E8E1BB /* SampleTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 3426FF921BB6AEE200E8E1BB /* SampleTests.swift */, 116 | 3426FF941BB6AEE200E8E1BB /* Info.plist */, 117 | ); 118 | path = SampleTests; 119 | sourceTree = ""; 120 | }; 121 | 34346CF41B7294470063FED4 = { 122 | isa = PBXGroup; 123 | children = ( 124 | 34346CFF1B7294470063FED4 /* Sample */, 125 | 3426FF911BB6AEE200E8E1BB /* SampleTests */, 126 | 34346CFE1B7294470063FED4 /* Products */, 127 | 1296D3EDC6FA72EB325EB960 /* Frameworks */, 128 | 43F4D0F30FD2BE97E5D8C9D4 /* Pods */, 129 | ); 130 | sourceTree = ""; 131 | }; 132 | 34346CFE1B7294470063FED4 /* Products */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 34346CFD1B7294470063FED4 /* Sample.app */, 136 | 3426FF901BB6AEE200E8E1BB /* SampleTests.xctest */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | 34346CFF1B7294470063FED4 /* Sample */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 34346D021B7294470063FED4 /* AppDelegate.swift */, 145 | 34346D041B7294470063FED4 /* ViewController.swift */, 146 | 34346D061B7294470063FED4 /* Main.storyboard */, 147 | 34346D091B7294470063FED4 /* Images.xcassets */, 148 | 34346D0B1B7294470063FED4 /* LaunchScreen.xib */, 149 | 34346D281B7297820063FED4 /* Resources */, 150 | 34346D001B7294470063FED4 /* Supporting Files */, 151 | ); 152 | path = Sample; 153 | sourceTree = ""; 154 | }; 155 | 34346D001B7294470063FED4 /* Supporting Files */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 34346D011B7294470063FED4 /* Info.plist */, 159 | ); 160 | name = "Supporting Files"; 161 | sourceTree = ""; 162 | }; 163 | 34346D281B7297820063FED4 /* Resources */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 68A5200C1DA6D98000F43D9E /* ButtonTitles.strings */, 167 | 34346D2F1B72983C0063FED4 /* Localizable.strings */, 168 | ); 169 | name = Resources; 170 | sourceTree = ""; 171 | }; 172 | 43F4D0F30FD2BE97E5D8C9D4 /* Pods */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 90CA2BF966754C71EDEE5937 /* Pods-Sample.debug.xcconfig */, 176 | B5FD741D4E0971BE3BCD2E74 /* Pods-Sample.release.xcconfig */, 177 | 066A759900EDAF0801EE7E71 /* Pods-SampleTests.debug.xcconfig */, 178 | D50B0502E8EE0192A195033B /* Pods-SampleTests.release.xcconfig */, 179 | ); 180 | name = Pods; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | 3426FF8F1BB6AEE200E8E1BB /* SampleTests */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 3426FF971BB6AEE200E8E1BB /* Build configuration list for PBXNativeTarget "SampleTests" */; 189 | buildPhases = ( 190 | 58CED79B0F7646DD660E38BB /* [CP] Check Pods Manifest.lock */, 191 | 3426FF8C1BB6AEE200E8E1BB /* Sources */, 192 | 3426FF8D1BB6AEE200E8E1BB /* Frameworks */, 193 | 3426FF8E1BB6AEE200E8E1BB /* Resources */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | 3426FF961BB6AEE200E8E1BB /* PBXTargetDependency */, 199 | ); 200 | name = SampleTests; 201 | productName = SampleTests; 202 | productReference = 3426FF901BB6AEE200E8E1BB /* SampleTests.xctest */; 203 | productType = "com.apple.product-type.bundle.unit-test"; 204 | }; 205 | 34346CFC1B7294470063FED4 /* Sample */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = 34346D1C1B7294470063FED4 /* Build configuration list for PBXNativeTarget "Sample" */; 208 | buildPhases = ( 209 | 3A2E3E26A724A9234A6B7337 /* [CP] Check Pods Manifest.lock */, 210 | 34346CF91B7294470063FED4 /* Sources */, 211 | 34346CFA1B7294470063FED4 /* Frameworks */, 212 | 34346CFB1B7294470063FED4 /* Resources */, 213 | 342B3BE61DDAEA4700F6D25D /* Embed Frameworks */, 214 | A30F1C3629E78977BF20051D /* [CP] Embed Pods Frameworks */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | ); 220 | name = Sample; 221 | productName = Sample; 222 | productReference = 34346CFD1B7294470063FED4 /* Sample.app */; 223 | productType = "com.apple.product-type.application"; 224 | }; 225 | /* End PBXNativeTarget section */ 226 | 227 | /* Begin PBXProject section */ 228 | 34346CF51B7294470063FED4 /* Project object */ = { 229 | isa = PBXProject; 230 | attributes = { 231 | LastSwiftMigration = 0700; 232 | LastSwiftUpdateCheck = 0700; 233 | LastUpgradeCheck = 1200; 234 | ORGANIZATIONNAME = "Roy Marmelstein"; 235 | TargetAttributes = { 236 | 3426FF8F1BB6AEE200E8E1BB = { 237 | CreatedOnToolsVersion = 7.0; 238 | LastSwiftMigration = 1020; 239 | TestTargetID = 34346CFC1B7294470063FED4; 240 | }; 241 | 34346CFC1B7294470063FED4 = { 242 | CreatedOnToolsVersion = 6.4; 243 | LastSwiftMigration = 1020; 244 | }; 245 | }; 246 | }; 247 | buildConfigurationList = 34346CF81B7294470063FED4 /* Build configuration list for PBXProject "Sample" */; 248 | compatibilityVersion = "Xcode 3.2"; 249 | developmentRegion = en; 250 | hasScannedForEncodings = 0; 251 | knownRegions = ( 252 | en, 253 | fr, 254 | de, 255 | es, 256 | it, 257 | ja, 258 | "zh-Hans", 259 | he, 260 | "zh-Hant", 261 | Base, 262 | ); 263 | mainGroup = 34346CF41B7294470063FED4; 264 | productRefGroup = 34346CFE1B7294470063FED4 /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 34346CFC1B7294470063FED4 /* Sample */, 269 | 3426FF8F1BB6AEE200E8E1BB /* SampleTests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 3426FF8E1BB6AEE200E8E1BB /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 3426FF9B1BB6AF5D00E8E1BB /* Localizable.strings in Resources */, 280 | 68A520181DA6DC0200F43D9E /* ButtonTitles.strings in Resources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 34346CFB1B7294470063FED4 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 34346D081B7294470063FED4 /* Main.storyboard in Resources */, 289 | 34346D2C1B72983C0063FED4 /* Localizable.strings in Resources */, 290 | 68A5200A1DA6D98000F43D9E /* ButtonTitles.strings in Resources */, 291 | 34346D0D1B7294470063FED4 /* LaunchScreen.xib in Resources */, 292 | 34346D0A1B7294470063FED4 /* Images.xcassets in Resources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | /* End PBXResourcesBuildPhase section */ 297 | 298 | /* Begin PBXShellScriptBuildPhase section */ 299 | 3A2E3E26A724A9234A6B7337 /* [CP] Check Pods Manifest.lock */ = { 300 | isa = PBXShellScriptBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | ); 304 | inputPaths = ( 305 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 306 | "${PODS_ROOT}/Manifest.lock", 307 | ); 308 | name = "[CP] Check Pods Manifest.lock"; 309 | outputPaths = ( 310 | "$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt", 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | shellPath = /bin/sh; 314 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 315 | showEnvVarsInLog = 0; 316 | }; 317 | 58CED79B0F7646DD660E38BB /* [CP] Check Pods Manifest.lock */ = { 318 | isa = PBXShellScriptBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | ); 322 | inputPaths = ( 323 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 324 | "${PODS_ROOT}/Manifest.lock", 325 | ); 326 | name = "[CP] Check Pods Manifest.lock"; 327 | outputPaths = ( 328 | "$(DERIVED_FILE_DIR)/Pods-SampleTests-checkManifestLockResult.txt", 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | shellPath = /bin/sh; 332 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 333 | showEnvVarsInLog = 0; 334 | }; 335 | A30F1C3629E78977BF20051D /* [CP] Embed Pods Frameworks */ = { 336 | isa = PBXShellScriptBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | ); 340 | inputPaths = ( 341 | "${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh", 342 | "${BUILT_PRODUCTS_DIR}/Localize-Swift/Localize_Swift.framework", 343 | ); 344 | name = "[CP] Embed Pods Frameworks"; 345 | outputPaths = ( 346 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Localize_Swift.framework", 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | shellPath = /bin/sh; 350 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; 351 | showEnvVarsInLog = 0; 352 | }; 353 | /* End PBXShellScriptBuildPhase section */ 354 | 355 | /* Begin PBXSourcesBuildPhase section */ 356 | 3426FF8C1BB6AEE200E8E1BB /* Sources */ = { 357 | isa = PBXSourcesBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | 3426FF931BB6AEE200E8E1BB /* SampleTests.swift in Sources */, 361 | ); 362 | runOnlyForDeploymentPostprocessing = 0; 363 | }; 364 | 34346CF91B7294470063FED4 /* Sources */ = { 365 | isa = PBXSourcesBuildPhase; 366 | buildActionMask = 2147483647; 367 | files = ( 368 | 34346D051B7294470063FED4 /* ViewController.swift in Sources */, 369 | 34346D031B7294470063FED4 /* AppDelegate.swift in Sources */, 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | }; 373 | /* End PBXSourcesBuildPhase section */ 374 | 375 | /* Begin PBXTargetDependency section */ 376 | 3426FF961BB6AEE200E8E1BB /* PBXTargetDependency */ = { 377 | isa = PBXTargetDependency; 378 | target = 34346CFC1B7294470063FED4 /* Sample */; 379 | targetProxy = 3426FF951BB6AEE200E8E1BB /* PBXContainerItemProxy */; 380 | }; 381 | /* End PBXTargetDependency section */ 382 | 383 | /* Begin PBXVariantGroup section */ 384 | 34346D061B7294470063FED4 /* Main.storyboard */ = { 385 | isa = PBXVariantGroup; 386 | children = ( 387 | E74D4EC72176ECAE002CB79C /* Base */, 388 | ); 389 | name = Main.storyboard; 390 | sourceTree = ""; 391 | }; 392 | 34346D0B1B7294470063FED4 /* LaunchScreen.xib */ = { 393 | isa = PBXVariantGroup; 394 | children = ( 395 | E74D4EC82176ECAE002CB79C /* Base */, 396 | ); 397 | name = LaunchScreen.xib; 398 | sourceTree = ""; 399 | }; 400 | 34346D2F1B72983C0063FED4 /* Localizable.strings */ = { 401 | isa = PBXVariantGroup; 402 | children = ( 403 | 34346D2E1B72983C0063FED4 /* en */, 404 | 34346D301B7298A80063FED4 /* fr */, 405 | 34346D311B7298AF0063FED4 /* de */, 406 | 34346D321B7298B70063FED4 /* es */, 407 | 34346D331B7298BD0063FED4 /* it */, 408 | 34346D341B7298C60063FED4 /* ja */, 409 | 34346D351B7298DD0063FED4 /* zh-Hans */, 410 | 34346D361B7298E80063FED4 /* he */, 411 | 20D57BE01DC0AF00001BA2F9 /* zh-Hant */, 412 | ); 413 | name = Localizable.strings; 414 | sourceTree = ""; 415 | }; 416 | 68A5200C1DA6D98000F43D9E /* ButtonTitles.strings */ = { 417 | isa = PBXVariantGroup; 418 | children = ( 419 | 68A5200B1DA6D98000F43D9E /* en */, 420 | 68A520111DA6DA3400F43D9E /* fr */, 421 | 68A520121DA6DA4100F43D9E /* de */, 422 | 68A520131DA6DA5A00F43D9E /* es */, 423 | 68A520141DA6DA6C00F43D9E /* it */, 424 | 68A520151DA6DA7A00F43D9E /* ja */, 425 | 68A520161DA6DA8900F43D9E /* zh-Hans */, 426 | 68A520171DA6DA9600F43D9E /* he */, 427 | ); 428 | name = ButtonTitles.strings; 429 | sourceTree = ""; 430 | }; 431 | /* End PBXVariantGroup section */ 432 | 433 | /* Begin XCBuildConfiguration section */ 434 | 3426FF981BB6AEE200E8E1BB /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 066A759900EDAF0801EE7E71 /* Pods-SampleTests.debug.xcconfig */; 437 | buildSettings = { 438 | BUNDLE_LOADER = "$(TEST_HOST)"; 439 | DEBUG_INFORMATION_FORMAT = dwarf; 440 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 441 | INFOPLIST_FILE = SampleTests/Info.plist; 442 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 443 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 444 | PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; 445 | PRODUCT_NAME = "$(TARGET_NAME)"; 446 | SWIFT_VERSION = 5.0; 447 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; 448 | }; 449 | name = Debug; 450 | }; 451 | 3426FF991BB6AEE200E8E1BB /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | baseConfigurationReference = D50B0502E8EE0192A195033B /* Pods-SampleTests.release.xcconfig */; 454 | buildSettings = { 455 | BUNDLE_LOADER = "$(TEST_HOST)"; 456 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 457 | INFOPLIST_FILE = SampleTests/Info.plist; 458 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | SWIFT_VERSION = 5.0; 463 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; 464 | }; 465 | name = Release; 466 | }; 467 | 34346D1A1B7294470063FED4 /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 471 | ALWAYS_SEARCH_USER_PATHS = NO; 472 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 473 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 474 | CLANG_CXX_LIBRARY = "libc++"; 475 | CLANG_ENABLE_MODULES = YES; 476 | CLANG_ENABLE_OBJC_ARC = YES; 477 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 478 | CLANG_WARN_BOOL_CONVERSION = YES; 479 | CLANG_WARN_COMMA = YES; 480 | CLANG_WARN_CONSTANT_CONVERSION = YES; 481 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 482 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 483 | CLANG_WARN_EMPTY_BODY = YES; 484 | CLANG_WARN_ENUM_CONVERSION = YES; 485 | CLANG_WARN_INFINITE_RECURSION = YES; 486 | CLANG_WARN_INT_CONVERSION = YES; 487 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 488 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 489 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 490 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 491 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 492 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 493 | CLANG_WARN_STRICT_PROTOTYPES = YES; 494 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 495 | CLANG_WARN_UNREACHABLE_CODE = YES; 496 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 497 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 498 | COPY_PHASE_STRIP = NO; 499 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 500 | ENABLE_STRICT_OBJC_MSGSEND = YES; 501 | ENABLE_TESTABILITY = YES; 502 | GCC_C_LANGUAGE_STANDARD = gnu99; 503 | GCC_DYNAMIC_NO_PIC = NO; 504 | GCC_NO_COMMON_BLOCKS = YES; 505 | GCC_OPTIMIZATION_LEVEL = 0; 506 | GCC_PREPROCESSOR_DEFINITIONS = ( 507 | "DEBUG=1", 508 | "$(inherited)", 509 | ); 510 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 511 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 512 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 513 | GCC_WARN_UNDECLARED_SELECTOR = YES; 514 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 515 | GCC_WARN_UNUSED_FUNCTION = YES; 516 | GCC_WARN_UNUSED_VARIABLE = YES; 517 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 518 | MTL_ENABLE_DEBUG_INFO = YES; 519 | ONLY_ACTIVE_ARCH = YES; 520 | SDKROOT = iphoneos; 521 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 522 | SWIFT_VERSION = 5.0; 523 | }; 524 | name = Debug; 525 | }; 526 | 34346D1B1B7294470063FED4 /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | buildSettings = { 529 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 530 | ALWAYS_SEARCH_USER_PATHS = NO; 531 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 532 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 533 | CLANG_CXX_LIBRARY = "libc++"; 534 | CLANG_ENABLE_MODULES = YES; 535 | CLANG_ENABLE_OBJC_ARC = YES; 536 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 537 | CLANG_WARN_BOOL_CONVERSION = YES; 538 | CLANG_WARN_COMMA = YES; 539 | CLANG_WARN_CONSTANT_CONVERSION = YES; 540 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 541 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 542 | CLANG_WARN_EMPTY_BODY = YES; 543 | CLANG_WARN_ENUM_CONVERSION = YES; 544 | CLANG_WARN_INFINITE_RECURSION = YES; 545 | CLANG_WARN_INT_CONVERSION = YES; 546 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 547 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 548 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 549 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 550 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 551 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 552 | CLANG_WARN_STRICT_PROTOTYPES = YES; 553 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 554 | CLANG_WARN_UNREACHABLE_CODE = YES; 555 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 556 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 557 | COPY_PHASE_STRIP = NO; 558 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 559 | ENABLE_NS_ASSERTIONS = NO; 560 | ENABLE_STRICT_OBJC_MSGSEND = YES; 561 | GCC_C_LANGUAGE_STANDARD = gnu99; 562 | GCC_NO_COMMON_BLOCKS = YES; 563 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 564 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 565 | GCC_WARN_UNDECLARED_SELECTOR = YES; 566 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 567 | GCC_WARN_UNUSED_FUNCTION = YES; 568 | GCC_WARN_UNUSED_VARIABLE = YES; 569 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 570 | MTL_ENABLE_DEBUG_INFO = NO; 571 | SDKROOT = iphoneos; 572 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 573 | SWIFT_VERSION = 5.0; 574 | VALIDATE_PRODUCT = YES; 575 | }; 576 | name = Release; 577 | }; 578 | 34346D1D1B7294470063FED4 /* Debug */ = { 579 | isa = XCBuildConfiguration; 580 | baseConfigurationReference = 90CA2BF966754C71EDEE5937 /* Pods-Sample.debug.xcconfig */; 581 | buildSettings = { 582 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 583 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 584 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 585 | INFOPLIST_FILE = Sample/Info.plist; 586 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 587 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.$(PRODUCT_NAME:rfc1034identifier)"; 588 | PRODUCT_NAME = "$(TARGET_NAME)"; 589 | SWIFT_VERSION = 5.0; 590 | }; 591 | name = Debug; 592 | }; 593 | 34346D1E1B7294470063FED4 /* Release */ = { 594 | isa = XCBuildConfiguration; 595 | baseConfigurationReference = B5FD741D4E0971BE3BCD2E74 /* Pods-Sample.release.xcconfig */; 596 | buildSettings = { 597 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 598 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 599 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 600 | INFOPLIST_FILE = Sample/Info.plist; 601 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 602 | PRODUCT_BUNDLE_IDENTIFIER = "com.roymarmelstein.$(PRODUCT_NAME:rfc1034identifier)"; 603 | PRODUCT_NAME = "$(TARGET_NAME)"; 604 | SWIFT_VERSION = 5.0; 605 | }; 606 | name = Release; 607 | }; 608 | /* End XCBuildConfiguration section */ 609 | 610 | /* Begin XCConfigurationList section */ 611 | 3426FF971BB6AEE200E8E1BB /* Build configuration list for PBXNativeTarget "SampleTests" */ = { 612 | isa = XCConfigurationList; 613 | buildConfigurations = ( 614 | 3426FF981BB6AEE200E8E1BB /* Debug */, 615 | 3426FF991BB6AEE200E8E1BB /* Release */, 616 | ); 617 | defaultConfigurationIsVisible = 0; 618 | defaultConfigurationName = Release; 619 | }; 620 | 34346CF81B7294470063FED4 /* Build configuration list for PBXProject "Sample" */ = { 621 | isa = XCConfigurationList; 622 | buildConfigurations = ( 623 | 34346D1A1B7294470063FED4 /* Debug */, 624 | 34346D1B1B7294470063FED4 /* Release */, 625 | ); 626 | defaultConfigurationIsVisible = 0; 627 | defaultConfigurationName = Release; 628 | }; 629 | 34346D1C1B7294470063FED4 /* Build configuration list for PBXNativeTarget "Sample" */ = { 630 | isa = XCConfigurationList; 631 | buildConfigurations = ( 632 | 34346D1D1B7294470063FED4 /* Debug */, 633 | 34346D1E1B7294470063FED4 /* Release */, 634 | ); 635 | defaultConfigurationIsVisible = 0; 636 | defaultConfigurationName = Release; 637 | }; 638 | /* End XCConfigurationList section */ 639 | }; 640 | rootObject = 34346CF51B7294470063FED4 /* Project object */; 641 | } 642 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 76 | 78 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/SampleTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 37 | 38 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample.xcodeproj/xcuserdata/marmelroy.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Sample.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | SampleTests.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 3426FF8F1BB6AEE200E8E1BB 21 | 22 | primary 23 | 24 | 25 | 34346CFC1B7294470063FED4 26 | 27 | primary 28 | 29 | 30 | 34346D111B7294470063FED4 31 | 32 | primary 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Sample 4 | // 5 | // Created by Roy Marmelstein on 05/08/2015. 6 | // Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: 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 throttle down OpenGL ES frame rates. 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 inactive 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 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 44 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Sample 4 | // 5 | // Created by Roy Marmelstein on 05/08/2015. 6 | // Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Localize_Swift 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var textLabel: UILabel! 15 | @IBOutlet weak var changeButton: UIButton! 16 | @IBOutlet weak var resetButton: UIButton! 17 | 18 | var actionSheet: UIAlertController! 19 | 20 | let availableLanguages = Localize.availableLanguages() 21 | 22 | // MARK: UIViewController 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | self.setText() 27 | } 28 | 29 | // Add an observer for LCLLanguageChangeNotification on viewWillAppear. This is posted whenever a language changes and allows the viewcontroller to make the necessary UI updated. Very useful for places in your app when a language change might happen. 30 | override func viewWillAppear(_ animated: Bool) { 31 | super.viewWillAppear(animated) 32 | NotificationCenter.default.addObserver(self, selector: #selector(setText), name: NSNotification.Name( LCLLanguageChangeNotification), object: nil) 33 | } 34 | 35 | // Remove the LCLLanguageChangeNotification on viewWillDisappear 36 | override func viewWillDisappear(_ animated: Bool) { 37 | super.viewWillDisappear(animated) 38 | NotificationCenter.default.removeObserver(self) 39 | } 40 | 41 | // MARK: Localized Text 42 | 43 | @objc func setText(){ 44 | textLabel.text = "Hello world".localized(); 45 | changeButton.setTitle("Change".localized(using: "ButtonTitles"), for: UIControl.State.normal) 46 | resetButton.setTitle("Reset".localized(using: "ButtonTitles"), for: UIControl.State.normal) 47 | } 48 | 49 | // MARK: IBActions 50 | 51 | @IBAction func doChangeLanguage(_ sender: AnyObject) { 52 | actionSheet = UIAlertController(title: nil, message: "Switch Language", preferredStyle: UIAlertController.Style.actionSheet) 53 | for language in availableLanguages { 54 | let displayName = Localize.displayNameForLanguage(language) 55 | let languageAction = UIAlertAction(title: displayName, style: .default, handler: { 56 | (alert: UIAlertAction!) -> Void in 57 | Localize.setCurrentLanguage(language) 58 | }) 59 | actionSheet.addAction(languageAction) 60 | } 61 | let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: { 62 | (alert: UIAlertAction) -> Void in 63 | }) 64 | actionSheet.addAction(cancelAction) 65 | self.present(actionSheet, animated: true, completion: nil) 66 | } 67 | 68 | @IBAction func doResetLanguage(_ sender: AnyObject) { 69 | Localize.resetCurrentLanguageToDefault() 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/de.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "Ändern"; 10 | 11 | "Reset" = "Umkehren"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "Hallo Welt"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/en.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | ButtonTitles.strings 3 | Sample 4 | 5 | Created by Vitalii Budnik on 10/6/16. 6 | Copyright © 2016 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "Change"; 10 | 11 | "Reset" = "Reset"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "Hello world"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/es.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "Cambiar"; 10 | 11 | "Reset" = "Reiniciar"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/es.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "Hola mundo"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/fr.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | ButtonTitles.strings 3 | Sample 4 | 5 | Created by Vitalii Budnik on 10/6/16. 6 | Copyright © 2016 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "Modifier"; 10 | 11 | "Reset" = "Réinitialiser"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "Bonjour le monde"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/he.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "שינוי"; 10 | 11 | "Reset" = "אתחל"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/he.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "שלום עולם"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/it.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "Cambia"; 10 | 11 | "Reset" = "Ripristinare"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/it.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "Ciao mondo"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/ja.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "変更します"; 10 | 11 | "Reset" = "リセットします"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/ja.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "こんにちは世界"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/zh-Hans.lproj/ButtonTitles.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "改变"; 10 | 11 | "Reset" = "重置"; 12 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Hello world" = "你好世界"; 10 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/Sample/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | Sample 4 | 5 | Created by Roy Marmelstein on 05/08/2015. 6 | Copyright (c) 2015 Roy Marmelstein. All rights reserved. 7 | */ 8 | 9 | "Change" = "改變"; 10 | 11 | "Hello world" = "你好世界"; 12 | 13 | "Reset" = "重置"; 14 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/SampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/LanguageSwitch/SampleTests/SampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleTests.swift 3 | // SampleTests 4 | // 5 | // Created by Roy Marmelstein on 26/09/2015. 6 | // Copyright © 2015 Roy Marmelstein. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import Localize_Swift 11 | 12 | class SampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | Localize.resetCurrentLanguageToDefault() 17 | } 18 | 19 | func testSwift1Syntax() { 20 | let testString = "Hello world"; 21 | Localize.setCurrentLanguage("fr") 22 | let translatedString = Localized(testString) 23 | XCTAssertEqual(translatedString, "Bonjour le monde") 24 | } 25 | 26 | func testSwift2Syntax() { 27 | let testString = "Hello world"; 28 | Localize.setCurrentLanguage("fr") 29 | let translatedString = testString.localized() 30 | XCTAssertEqual(translatedString, "Bonjour le monde") 31 | } 32 | 33 | func testMultipleLanguageSwitching() { 34 | let testString = "Hello world"; 35 | Localize.setCurrentLanguage("es") 36 | XCTAssertEqual(testString.localized(), "Hola mundo") 37 | Localize.setCurrentLanguage("de") 38 | XCTAssertEqual(testString.localized(), "Hallo Welt") 39 | Localize.resetCurrentLanguageToDefault() 40 | XCTAssertEqual(testString.localized(), "Hello world") 41 | } 42 | 43 | func testFalseLanguage() { 44 | let testString = "Hello world"; 45 | Localize.setCurrentLanguage("xxx") 46 | XCTAssertEqual(testString.localized(), "Hello world") 47 | } 48 | 49 | func testFalseString() { 50 | let testString = "Non translated string"; 51 | Localize.setCurrentLanguage("fr") 52 | XCTAssertEqual(testString.localized(), "Non translated string") 53 | } 54 | 55 | func testTableName() { 56 | let testString = "Change"; 57 | Localize.setCurrentLanguage("fr") 58 | let translatedString = testString.localized(using: "ButtonTitles") 59 | XCTAssertEqual(translatedString, "Modifier") 60 | } 61 | 62 | func testTableNameMultipleLanguage() { 63 | let testString = "Change"; 64 | Localize.setCurrentLanguage("es") 65 | XCTAssertEqual(testString.localized(using: "ButtonTitles"), "Cambiar") 66 | Localize.setCurrentLanguage("de") 67 | XCTAssertEqual(testString.localized(using: "ButtonTitles"), "Ändern") 68 | Localize.resetCurrentLanguageToDefault() 69 | XCTAssertEqual(testString.localized(using: "ButtonTitles"), "Change") 70 | } 71 | 72 | func testTableNameFail() { 73 | let testString = "Change"; 74 | Localize.setCurrentLanguage("xxx") 75 | let translatedString = testString.localized(using: "ButtonTitles") 76 | XCTAssertEqual(translatedString, "Change") 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Sample projects 2 | 3 | ## Building 4 | 5 | Run `pod update` in each sample project directory to set up their 6 | dependencies. 7 | -------------------------------------------------------------------------------- /genstrings.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift 2 | 3 | import Foundation 4 | 5 | class GenStrings { 6 | 7 | var str = "Hello, playground" 8 | let fileManager = FileManager.default 9 | let acceptedFileExtensions = ["swift"] 10 | let excludedFolderNames = ["Carthage"] 11 | let excludedFileNames = ["genstrings.swift"] 12 | var regularExpresions = [String:NSRegularExpression]() 13 | 14 | let localizedRegex = "(?<=\")([^\"]*)(?=\".(localized|localizedFormat))|(?<=(Localized|NSLocalizedString)\\(\")([^\"]*?)(?=\")" 15 | let commentedRegex = "(?<=.commented\\(\")([^\"]*)(?=\")" 16 | 17 | enum GenstringsError: Error { 18 | case Error 19 | } 20 | 21 | // Performs the genstrings functionality 22 | func perform(path: String? = nil) { 23 | let directoryPath = path ?? fileManager.currentDirectoryPath 24 | let rootPath = URL(fileURLWithPath:directoryPath) 25 | let allFiles = fetchFilesInFolder(rootPath: rootPath) 26 | // We use a set to avoid duplicates 27 | var localizableStrings = Set() 28 | var comments = [String:String]() 29 | for filePath in allFiles { 30 | let (stringsInFile, commentsInFile) = localizableStringsInFile(filePath: filePath) 31 | localizableStrings = localizableStrings.union(stringsInFile) 32 | comments = comments.merging(commentsInFile, uniquingKeysWith: { (_, last) in last }) 33 | } 34 | // We sort the strings 35 | let sortedStrings = localizableStrings.sorted(by: { $0 < $1 }) 36 | var processedStrings = String() 37 | for string in sortedStrings { 38 | if let comment = comments[string] { 39 | processedStrings.append("/* \(comment) */ \n") 40 | } 41 | processedStrings.append("\"\(string)\" = \"\(string)\"; \n") 42 | } 43 | print(processedStrings) 44 | } 45 | 46 | // Applies regex to a file at filePath. 47 | func localizableStringsInFile(filePath: URL) -> (Set, [String:String]) { 48 | do { 49 | let fileContentsData = try Data(contentsOf: filePath) 50 | guard let fileContentsString = NSString(data: fileContentsData, encoding: String.Encoding.utf8.rawValue) else { 51 | return (Set(), [String:String]()) 52 | } 53 | 54 | let localizedMatches = try regexMatches(pattern: localizedRegex, string: fileContentsString as String) 55 | let commentedMatches = try regexMatches(pattern: commentedRegex, string: fileContentsString as String) 56 | 57 | let localizedStringsArray = localizedMatches.map({fileContentsString.substring(with: $0.range)}) 58 | var comments = [String:String]() 59 | for m in commentedMatches { 60 | let comment = fileContentsString.substring(with: m.range) 61 | let localizedRange = localizedMatches.filter { $0.range.location + $0.range.length <= m.range.location }.last?.range 62 | if localizedRange != nil { 63 | let localized = fileContentsString.substring(with: localizedRange!) 64 | comments[localized] = comment 65 | } 66 | } 67 | 68 | return (Set(localizedStringsArray), comments) 69 | } catch {} 70 | return (Set(), [String:String]()) 71 | } 72 | 73 | //MARK: Regex 74 | 75 | func regexWithPattern(pattern: String) throws -> NSRegularExpression { 76 | var safeRegex = regularExpresions 77 | if let regex = safeRegex[pattern] { 78 | return regex 79 | } 80 | else { 81 | do { 82 | let currentPattern: NSRegularExpression 83 | currentPattern = try NSRegularExpression(pattern: pattern, options:NSRegularExpression.Options.caseInsensitive) 84 | safeRegex.updateValue(currentPattern, forKey: pattern) 85 | regularExpresions = safeRegex 86 | return currentPattern 87 | } 88 | catch { 89 | throw GenstringsError.Error 90 | } 91 | } 92 | } 93 | 94 | func regexMatches(pattern: String, string: String) throws -> [NSTextCheckingResult] { 95 | do { 96 | let internalString = string 97 | let currentPattern = try regexWithPattern(pattern: pattern) 98 | // NSRegularExpression accepts Swift strings but works with NSString under the hood. Safer to bridge to NSString for taking range. 99 | let nsString = internalString as NSString 100 | let stringRange = NSMakeRange(0, nsString.length) 101 | let matches = currentPattern.matches(in: internalString, options: [], range: stringRange) 102 | return matches 103 | } 104 | catch { 105 | throw GenstringsError.Error 106 | } 107 | } 108 | 109 | //MARK: File manager 110 | 111 | func fetchFilesInFolder(rootPath: URL) -> [URL] { 112 | var files = [URL]() 113 | do { 114 | let directoryContents = try fileManager.contentsOfDirectory(at: rootPath as URL, includingPropertiesForKeys: [], options: .skipsHiddenFiles) 115 | for urlPath in directoryContents { 116 | let stringPath = urlPath.path 117 | let lastPathComponent = urlPath.lastPathComponent 118 | let pathExtension = urlPath.pathExtension 119 | var isDir : ObjCBool = false 120 | if fileManager.fileExists(atPath: stringPath, isDirectory:&isDir) { 121 | if isDir.boolValue { 122 | if !excludedFolderNames.contains(lastPathComponent) { 123 | let dirFiles = fetchFilesInFolder(rootPath: urlPath) 124 | files.append(contentsOf: dirFiles) 125 | } 126 | } else { 127 | if acceptedFileExtensions.contains(pathExtension) && !excludedFileNames.contains(lastPathComponent) { 128 | files.append(urlPath) 129 | } 130 | } 131 | } 132 | } 133 | } catch {} 134 | return files 135 | } 136 | 137 | } 138 | 139 | let genStrings = GenStrings() 140 | if CommandLine.arguments.count > 1 { 141 | let path = CommandLine.arguments[1] 142 | genStrings.perform(path: path) 143 | } else { 144 | genStrings.perform() 145 | } 146 | --------------------------------------------------------------------------------