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
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
88
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
130
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
69
Other Decks in Programming
See All in Programming
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
590
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
450
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.7k
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
170
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
210
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
970
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
540
あなたはユーザーではない #PdENight
kajitack
4
340
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Leo the Paperboy
mayatellez
4
1.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Ethics towards AI in product and experience design
skipperchong
2
220
The Cost Of JavaScript in 2023
addyosmani
55
9.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
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