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
62
Development on Kotlin/Native and Swift
aydarin
1
82
AppCode under the hood
aydarin
1
200
Bridging the gap between Kotlin and Swift
aydarin
0
100
A look into AB testing
aydarin
0
68
Exploring MVVM-C
aydarin
0
130
Coordinate your app
aydarin
1
68
MVVM vs MVP
aydarin
1
230
image_optimization.pdf
aydarin
0
63
Other Decks in Programming
See All in Programming
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
3.3k
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
100
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
300
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
12
6k
最近のVS Codeで気になるニュース 2025/01
74th
1
240
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
140
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
130
HTML/CSS超絶浅い説明
yuki0329
0
210
Flatt Security XSS Challenge 解答・解説
flatt_security
0
1.1k
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
170
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
200
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
140
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
270
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Speed Design
sergeychernyshev
25
760
Bash Introduction
62gerente
610
210k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
380
For a Future-Friendly Web
brad_frost
176
9.5k
Optimising Largest Contentful Paint
csswizardry
33
3k
A designer walks into a library…
pauljervisheath
205
24k
Navigating Team Friction
lara
183
15k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
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