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
67
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
100
Development on Kotlin/Native and Swift
aydarin
1
130
AppCode under the hood
aydarin
1
350
Bridging the gap between Kotlin and Swift
aydarin
0
140
A look into AB testing
aydarin
0
92
Exploring MVVM-C
aydarin
0
180
Coordinate your app
aydarin
1
100
MVVM vs MVP
aydarin
1
290
image_optimization.pdf
aydarin
0
71
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
120
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
200
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
320
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
450
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
170
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
210
GitHub Copilot CLIのいいところ
htkym
2
1.3k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
260
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
660
CSC307 Lecture 17
javiergs
PRO
0
320
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
The Curse of the Amulet
leimatthew05
1
13k
Designing for Performance
lara
611
70k
What's in a price? How to price your products and services
michaelherold
247
13k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
600
Writing Fast Ruby
sferik
630
63k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
430
Visualization
eitanlees
152
17k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
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