Slide 1

Slide 1 text

Automation for Localization Chris Vasselli @[email protected] @chrisvasselli @chrisvasselli try! Swift Tokyo, March 2024

Slide 2

Slide 2 text

About Me

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

NIHONGO A modern Japanese dictionary and study tool. NIHONGO LESSONS A new app for people serious about becoming fl uent in Japanese.

Slide 5

Slide 5 text

Nihongo Supported Languages • English • French • Spanish • German • Dutch • Simpli fi ed Chinese • Traditional Chinese • Russian

Slide 6

Slide 6 text

Why Localize? Nihongo Revenue Primarily English-Speaking Countries: 39% Primarily Non-English-Speaking Countries: 61%

Slide 7

Slide 7 text

Revenue in 1st year after localizing Year Before Localization Year After Localization Germany $157 +355% $716 China $2.5K +288% $10k Mexico $69 +174% $189 Spain $0 +++ $202 France $234 +214% $737 Taiwan $83 +909% $844 Hong Kong $486 +139% $1.2K Russia $103 +423% $541 Netherlands $221 +3% $228

Slide 8

Slide 8 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 9

Slide 9 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 10

Slide 10 text

Translation Types • Professional Translation • Paying translation company to translate • Machine Translation • Google Translate, etc. • Crowd Translation • Using your social network to provide translations

Slide 11

Slide 11 text

Translate new strings • Make sure your translation service is integrated with your git repo.

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Translate new strings • Make sure your translation service is integrated with your git repo.

Slide 14

Slide 14 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration

Slide 15

Slide 15 text

Generating strings files from code % genstrings WordEntryViewController.swift WordEntryViewController.swift Localizable.strings

Slide 16

Slide 16 text

Generating strings files from code % genstrings -SwiftUI KanjiView.swift KanjiView.swift Localizable.strings

Slide 17

Slide 17 text

Generating strings files from code # Generate Localizable.strings % find ./ -type f \( -iname \*.m -o -iname \*.swift \) \ -print0 | xargs -0 genstrings -SwiftUI -a

Slide 18

Slide 18 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration

Slide 19

Slide 19 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards.

Slide 20

Slide 20 text

Generating strings files from storyboards ibtool --export-strings-file "nihongo.strings" "nihongo.storyboard"

Slide 21

Slide 21 text

Generating strings files from storyboards Marking strings that don’t need localization perl -0777 -i -pe 's/\/\*.+Note = \"DNL\".+\n.+\n(?:\n|$)//ig' \ “nihongo-utf8.strings”

Slide 22

Slide 22 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards.

Slide 23

Slide 23 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards. • Generate app description from a shared app description fi le

Slide 24

Slide 24 text

Generating app descriptions based on language app_description_source.txt Nihongo is an offline Japanese dictionary, flashcard app, and reading assistant, designed to make the best use of the time you dedicate to studying Japanese. * Over 180,000 words and 6000 kanji entries. * Over 115,000 native German definitions and 6000 kanji entries. https://gist.github.com/chrisvasselli/ 51460cfee92ec3413de5ffe4b4b91460

Slide 25

Slide 25 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards. • Generate app description from a shared app description fi le

Slide 26

Slide 26 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards. • Generate app description from a shared app description fi le • Use Apple’s translations where possible

Slide 27

Slide 27 text

Using Apple’s Translations • Use Apple’s strings for common system vocabulary. • Supply these strings directly, don’t ask for professional translation.

Slide 28

Slide 28 text

Using Apple’s Translations https://gist.github.com/chrisvasselli/ 84e0201b667acba9f9cb95837ada76d7

Slide 29

Slide 29 text

Translate new strings • Make sure your translation service is integrated with your git repo. • Generate strings fi les from your code as part of Continuous Integration • Generate strings fi les from storyboards. • Generate app description from a shared app description fi le • Use Apple’s translations where possible

Slide 30

Slide 30 text

Translate new strings build_localizations.sh https://gist.github.com/chrisvasselli/ ec080640052f24c53d65429654e50aba

Slide 31

Slide 31 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 32

Slide 32 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 33

Slide 33 text

Create screenshots for translators

Slide 34

Slide 34 text

English

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

German

Slide 37

Slide 37 text

German

Slide 38

Slide 38 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 39

Slide 39 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 40

Slide 40 text

The Problem • 10 screenshots • (minimum) 4 device types • 8 languages • 10 * 4 * 8 = 320 screenshots

Slide 41

Slide 41 text

Basic Setup Fastlane Snapshot + Frameit + Deliver • Create UI tests that navigate to the screens you want • Use Fastlane Snapshot to automate taking screenshots in all languages • Use Fastlane FrameIt to put screenshots in device frames and add titles • Use Fastlane Deliver to upload screenshots to App Store Connect https://docs.fastlane.tools/getting-started/ ios/screenshots/

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Advanced Setup when Fastlane doesn’t do what you need

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Advanced Setup

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Advanced Setup Replace FrameIt with ImageMagick https://imagemagick.org

Slide 48

Slide 48 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 49

Slide 49 text

Localization Tasks Every Release 1. Generate screenshots to assist translators 2. Translate new strings 3. Verify layout/correctness of translated strings 4. Generate App Store screenshots 5. Translate release notes

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

ReleaseNotesGenerator.generate()

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

ReleaseNotesGenerator.swift https://gist.github.com/chrisvasselli/ 7d2baefb72076539f023e7c8834fa384

Slide 55

Slide 55 text

Summary • Good localization is more than just translating strings! • It’s possible to support lots of high-quality localizations even as an indie developer. • Most localization tasks can be automated! • Feel free to use/adapt any of the code shared in this deck.

Slide 56

Slide 56 text

͋Γ͕ͱ͏͍͟͝·͢ʂ