Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Localization.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Aydar
December 14, 2017
Programming
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Localization.pdf
Presentation for the Munich iOS Developers Meetup
Aydar
December 14, 2017
More Decks by Aydar
See All by Aydar
The Realities of A/B Testing
aydarin
0
120
Development on Kotlin/Native and Swift
aydarin
1
130
AppCode under the hood
aydarin
1
360
Bridging the gap between Kotlin and Swift
aydarin
0
150
A look into AB testing
aydarin
0
99
Exploring MVVM-C
aydarin
0
190
Coordinate your app
aydarin
1
110
MVVM vs MVP
aydarin
1
300
image_optimization.pdf
aydarin
0
74
Other Decks in Programming
See All in Programming
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
260
不幸な GC
chencmd
0
540
初めての模倣学習とVLA
natsutan
0
160
30年振りにコンパイラの定数整数除算を改善した
herumi
8
3.7k
源内ハンズオン概要編
hideg
0
210
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
220
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
240
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
230
Hono + Inertia + React で LP を構築した話
oukayuka
2
130
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
200
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
330
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
140
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Mind Mapping
helmedeiros
PRO
1
330
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Agile that works and the tools we love
rasmusluckow
331
22k
Prompt Engineering for Job Search
mfonobong
0
410
The untapped power of vector embeddings
frankvandijk
2
1.8k
Music & Morning Musume
bryan
47
7.3k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Building the Perfect Custom Keyboard
takai
2
850
Marketing to machines
jonoalderson
1
5.7k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
Transcript
Improve your app localization with .stringsdict Aydar Mukhametzyanov, Freeletics
Agenda 1.The story 2.Handling plurals with .stringsdict 3.Adaptive strings
Who knows what .stringsdict is?
1.The story 2.Handling plurals with .stringsdict 3.Adaptive strings
!"#$ %&'( The story
The story !"#$ %&'( ) * +
The story Category Count ! * One 1 1 month
1 miesiąc Few 2-4, 22-24, 32-34,… 2 months 2 miesiące Many 5-19, 100,… 5 months 5 miesięcy Other 0.0-1.5, 10.0 1.5 months 1.5 miesiąca
The story if count == 1 { // one }
else { // many } !
The story if count >= 5 && count <= 19
{ // many } else if lastDigit == 1 { // one } else if lastDigit > 1 && lastDigit < 5 { // few } else { // many } )
1.The story 2.Handling plurals with .stringsdict 3.Adaptive strings
Handling plurals { login_button_title: Login, … }
Handling plurals { login_button_title: Login, … days_one: %d day, days_many:
%d days, … }
Handling plurals { login_button_title: Login, … days_one: %d day, days_many:
%d days, … } if count == 1 { // Use days_one } else { // Use days_many }
Handling plurals { login_button_title: Login, … days: { one: %d
day, many: %d days } … }
Handling plurals { login_button_title: Login, … days: { one: %d
day, many: %d days } … } String.localizedString(key: “days", count: count)
Handling plurals
Handling plurals
Handling plurals Localizable.sctringsdict Key Format Localization Plural cases
Handling plurals
Handling plurals Plural cases: zero, one, two, few, many, other
http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html
Handling plurals
How to use? Handling plurals
Handling plurals let format = NSLocalizedString("days", comment: "") let string
= String.localizedStringWithFormat(format, 12) How to use?
Handling plurals let format = NSLocalizedString("days", comment: "") let string
= String.localizedStringWithFormat(format, 12) New localization doesn’t bring code changes
Handling plurals • Localizable.stringsdict • Specific format for plural rules
• Available since iOS 7
1.The story 2.Handling plurals with .stringsdict 3.Adaptive strings
Adaptive strings
Adaptive strings Key “M width available on the screen” (WWDC
2015, Session 227, 15:06) Localization options
Adaptive strings “M width available on the screen” (WWDC 2015,
Session 227, 15:06)
How to use? Adaptive strings
Adaptive strings textLabel.text = NSLocalizedString("gdp", comment: "") How to use?
Adaptive strings textLabel.text = NSLocalizedString("gdp", comment: "") New localization doesn’t
bring code changes
Adaptive strings • Specific format for adaptive strings • Easy
to start using • Available since iOS 9
Resources • WWDC 2013 Session 219: Making Your App World-Ready
• WWDC 2015 Session 227: What’s new in Internationalization • WWDC 2017 Session 401: Localizing with Xcode 9 • Demo app: https://github.com/aydarin/localizationdemo Contacts aydar.mukh
[email protected]
aydarin
Demo