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
Aydar
December 14, 2017
Programming
0
34
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
59
Development on Kotlin/Native and Swift
aydarin
1
80
AppCode under the hood
aydarin
1
180
Bridging the gap between Kotlin and Swift
aydarin
0
96
A look into AB testing
aydarin
0
65
Exploring MVVM-C
aydarin
0
120
Coordinate your app
aydarin
1
63
MVVM vs MVP
aydarin
1
220
image_optimization.pdf
aydarin
0
62
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
520
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
150
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
190
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
880
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Scaling GitHub
holman
458
140k
Producing Creativity
orderedlist
PRO
341
39k
Done Done
chrislema
181
16k
Building an army of robots
kneath
302
43k
What's new in Ruby 2.0
geeforr
343
31k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
What's in a price? How to price your products and services
michaelherold
243
12k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Ruby is Unlike a Banana
tanoku
97
11k
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