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
スタートアップの急成長に寄り添うOn-Call体制構築とその変遷
horimislime
3
1.4k
How we build our app with minimum 3rd party dependencies
horimislime
0
77
サポート効率を上げるためのロギング環境構築
horimislime
7
3.7k
migrating-from-promise-to-reactive
horimislime
0
360
社内Swiftもくもく会成果発表
horimislime
0
110
Swift Optional Extension Tips
horimislime
1
1.4k
UI testing in XCode7
horimislime
3
740
UIテストをカジュアルに自動化 / UI Automation using Remote
horimislime
2
2.3k
Swift Libraryざっくり現状確認 / Swift library overview
horimislime
1
130
Other Decks in Programming
See All in Programming
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
370
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
140
sqlcを利用してsqlに型付けを
kamiyam
0
240
Делим тесты между QA и разработчиком
mariyasaygina
0
500
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
150
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
150
Iteratorでページネーションを実現する
sonatard
3
700
標準ライブラリの動向とイテレータのパフォーマンス
makki_d
3
190
Pythonによるイベントソーシングへの挑戦と現状に対する考察 / Challenging Event Sourcing with Python and Reflections on the Current State
nrslib
3
940
Progressive Web Apps for Rails developers
siaw23
2
530
タイミーにおけるデータの利用シーンと データ基盤の挑戦
marufeuille
4
3.1k
"noncopyable types" の使いどころについて考えてみた
andpad
0
140
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Speed Design
sergeychernyshev
22
470
How GitHub Uses GitHub to Build GitHub
holman
473
290k
BBQ
matthewcrist
84
9.2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
2.9k
Learning to Love Humans: Emotional Interface Design
aarron
271
40k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
279
13k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
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͕Πνόϯͷཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ (ΤϯδχΞืूத!)