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
ios-internationalization
Search
horimislime
August 11, 2015
Programming
2
8.8k
ios-internationalization
horimislime
August 11, 2015
Tweet
Share
More Decks by horimislime
See All by horimislime
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
170
スタートアップの急成長に寄り添うOn-Call体制構築とその変遷
horimislime
3
1.6k
How we build our app with minimum 3rd party dependencies
horimislime
0
85
サポート効率を上げるためのロギング環境構築
horimislime
7
3.8k
migrating-from-promise-to-reactive
horimislime
0
360
社内Swiftもくもく会成果発表
horimislime
0
120
Swift Optional Extension Tips
horimislime
1
1.5k
UI testing in XCode7
horimislime
3
760
UIテストをカジュアルに自動化 / UI Automation using Remote
horimislime
2
2.3k
Other Decks in Programming
See All in Programming
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
return文におけるstd::moveについて
onihusube
1
1.1k
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
情報漏洩させないための設計
kubotak
2
240
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
440
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
200
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
370
命名をリントする
chiroruxx
1
410
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
280
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
It's Worth the Effort
3n
183
28k
Optimising Largest Contentful Paint
csswizardry
33
3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
Music & Morning Musume
bryan
46
6.2k
How STYLIGHT went responsive
nonsquared
95
5.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Transcript
ӳޠ൛ϦϦʔεલʹ ͓͖͍ͬͯͨ͜ͱ! Potatotips 20 @horimislime
@horimislime גࣜձࣾτϨλ
None
None
None
ӳޠԽ • ݴޠϦιʔε͚ͯΔ͠େৎͩΖɾɾ • ͳΜͯࣄͳ͍ • Localizableͷ͍ํΛϛεΔͱେม • ͍͔ͭདྷΔӳޠ൛ʹࠓ͔Βඋ͑Α͏
NSLocalizedString
None
None
class Customer { var firstName: String! var lastName: String! }
String.localizedStringWithFormat( "%@ %@༷", customer.lastName, customer.firstName )
None
class Customer { var firstName: String! var lastName: String! }
String.localizedStringWithFormat( "%@ %@༷", customer.lastName, customer.firstName )
NSPersonNameComponents class Customer { var name: NSPersonNameComponents! ... } let
formatter = NSPersonNameComponentsFormatter() formatter.style = .Medium formatter.stringFromPersonNameComponents(customer.name) // -> "Soichiro Horimi"
None
NSPersonNameComponents & Formatter let customer = Customer() customer.name.familyName = "Horimi"
customer.name.givenName = "Soichiro" customer.name.nameSuffix = "Mr." let formatter = NSPersonNameComponentsFormatter() formatter.style = .Long formatter.stringFromPersonNameComponents(customer.name) // -> "Soichiro Horimi Mr."
NSPersonNameComponents & Formatter • @available(iOS 9.0, *) • ಠࣗͷComponentsͱFormatterΛ༻ҙ •
কདྷతʹࠩ͠ସ͍͑ͨɾɾ
None
String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) /* ͝༧ਓ */ "%d໊༷"
= "%d Guests";
String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) /* ͝༧ਓ */ "%d໊༷"
= "%d Guests";
stringsdict String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) <key>%d໊༷</key> <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@Guests@</string>
<key>days</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> <string>%d Guest</string> <key>other</key> <string>%d Guests</string> </dict> </dict> ୯ ෳ
None
NSDateIntervalFormatter • iOS >= 8.0 label.text = String.localizedStringWithFormat( "%@ -
%@", begin, end)
NSDateIntervalFormatter • iOS >= 8.0 label.text = String.localizedStringWithFormat( "%@ -
%@", begin, end) let formatter = NSDateIntervalFormatter() label.text = formatter.stringFromDate(begin, toDate: end)
NSDateIntervalFormatter stringsdict NSPersonNameComponents
FormatterΛ͍͜ͳͦ͏ • Localizable.strings͋͘·Ͱݴޠཧ • LocaleʹԠͨ͡୯ҐදهͷΓସ͑☓ • ͦͷPlaceholderɺຊʹඞཁʁ ࢀߟ: NSFormatter Class
Reference
ը૾Ϧιʔε • Background Imageʹෆ͖ • ΞΠίϯ͖UIButtonͰ͍ͨ͘ͳΔ͕… • LocaleʹΑͬͯίʔυ্Ͱذ͕ඞཁ - Asset
CatalogͷLocalize͑͞Ͱ͖Εɾɾ
ւ֎൛ϦϦʔεɺͦͷઌ • શػೳͷ༁͕ऴྃɺΊͰͨ͠ • ͳΜͯ͜ͱͳ͍ • Ή͠ΖϦϦʔεຖͷ༁࡞ۀ͕ॏՙʹ… • ։ൃεϐʔυΛམͱͣ͞ʹ༁ΛਐΊ͍ͨ
༁ࢧԉαʔϏε • Crowdin • XLIFFΛॻ͖ग़ͯ͠Ξοϓϩʔυ͢ΔͷΈ • ֎෦༁ऀͱͷڠۀ͕ḿΔ
༁ࢧԉαʔϏε • ༁ϦιʔεΛUPͯ͠ɺਐḿ͕ཧͰ͖Δ • ༁࿙ΕΛՄࢹԽͰ͖Δ • API࿈ܞ
ཧ ະ༁text ݁Ռ
ݱ࣮ • దͳϦιʔεཧͱࣗಈԽ • ͦΕͰɺݴޠ͕ଟ͍ͱେม • ଞݴޠԽΑΓແݴޠԽ - ݴ༿ແ͠ʹΘΔUI
·ͱΊ • FormatterΛ͏·͘׆༻͢Δ - Localizableʹ٧ΊࠐΈա͗ͳ͍ • ը૾Ϧιʔεߟ͑ͷ • ϦϦʔεޙ͏·ࣗ͘ಈԽ͍͚ͯ͠Δͱྑ͍ •
ͱ͍͑ແݴޠͳUI͕Πνόϯͷཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ (ΤϯδχΞืूத!)