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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aydar
December 14, 2017
Programming
0
64
Localization.pdf
Presentation for the Munich iOS Developers Meetup
Aydar
December 14, 2017
Tweet
Share
More Decks by Aydar
See All by Aydar
The Realities of A/B Testing
aydarin
0
89
Development on Kotlin/Native and Swift
aydarin
1
130
AppCode under the hood
aydarin
1
340
Bridging the gap between Kotlin and Swift
aydarin
0
140
A look into AB testing
aydarin
0
88
Exploring MVVM-C
aydarin
0
180
Coordinate your app
aydarin
1
99
MVVM vs MVP
aydarin
1
280
image_optimization.pdf
aydarin
0
70
Other Decks in Programming
See All in Programming
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
480
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
560
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
400
AI活用のコスパを最大化する方法
ochtum
0
330
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
100
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
810
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
190
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
310
Feature Toggle は捨てやすく使おう
gennei
0
360
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
360
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Crafting Experiences
bethany
1
94
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Fireside Chat
paigeccino
42
3.8k
sira's awesome portfolio website redesign presentation
elsirapls
0
200
The Pragmatic Product Professional
lauravandoore
37
7.2k
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