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
140
スタートアップの急成長に寄り添うOn-Call体制構築とその変遷
horimislime
3
1.5k
How we build our app with minimum 3rd party dependencies
horimislime
0
82
サポート効率を上げるためのロギング環境構築
horimislime
7
3.8k
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
750
UIテストをカジュアルに自動化 / UI Automation using Remote
horimislime
2
2.3k
Other Decks in Programming
See All in Programming
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
230
CSC509 Lecture 11
javiergs
PRO
0
180
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Jakarta EE meets AI
ivargrimstad
0
670
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
How STYLIGHT went responsive
nonsquared
95
5.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
What's new in Ruby 2.0
geeforr
343
31k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Visualization
eitanlees
145
15k
Writing Fast Ruby
sferik
627
61k
Navigating Team Friction
lara
183
14k
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͕Πνόϯͷཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ (ΤϯδχΞืूத!)