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
Arm移行タイムアタック
qnighy
0
300
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.8k
CSC509 Lecture 09
javiergs
PRO
0
140
役立つログに取り組もう
irof
28
9.6k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Better Code Design in PHP
afilina
PRO
0
120
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
CSC509 Lecture 12
javiergs
PRO
0
160
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Building Applications with DynamoDB
mza
90
6.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Adopting Sorbet at Scale
ufuk
73
9.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
GraphQLとの向き合い方2022年版
quramy
43
13k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Into the Great Unknown - MozCon
thekraken
32
1.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
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͕Πνόϯͷཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ (ΤϯδχΞืूத!)