Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swift Scripting on the rescue of Localizable st...

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Swift Scripting on the rescue of Localizable strings files management on iOS 

How using SwiftGen, Lokalise.co and Swift scripts are helping us managing Localizable.strings & Localizable.stringsdict files efficiently.

Related post on Medium:
https://medium.com/back-market-engineering/swift-scripting-on-the-rescue-of-localizable-strings-files-management-on-ios-11d3e99af73

Avatar for Jean-Charles SORIN

Jean-Charles SORIN

April 11, 2019

More Decks by Jean-Charles SORIN

Other Decks in Programming

Transcript

  1. Swift Scripting On the rescue of Localizable strings files management

    on iOS Cocoaheads Paris - April 2019 @jcsorin
  2. Issue N°1: lokalise.co strings up to date • What about

    our string code integration with SwiftGen? • What about strings fall-back? • What about first launch? • If there is no network at launch? • What if lokalise.co is down?
  3. 6 Steps 1. Make shell commands call possible 2. Create

    the API download calls with URLSession & Codable ⬇ 3. Multi-languages support ( 4. Create the zip unarchiving and copy files code 5. Use the command line parameters 6. Clean & make it beautiful
  4. Issue N°2: What about plurals? • There is no official

    SwiftGen template (yet) • Stringsdict rocks • Yes, we love SwiftGen • But, we love Swift more! ❤
  5. Use Swift Scripts • Swift scripting is ✓ Easy and

    accessible for an iOS developer ✓ Powerful (shell calls, arguments, console printing, using Foundation (Codable, URLSession...) • Use your Swit scripts as: ✓ A custom command line tool ✓ As a custom build phase in your project
  6. More ✓ Use Playgrounds to test & format it! ✓

    Use aliases for your command lines, we are lazy