ios-internationalization
by
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ӳޠ൛ϦϦʔεલʹ ͓͖͍ͬͯͨ͜ͱ! Potatotips 20 @horimislime
Slide 2
Slide 2 text
@horimislime גࣜձࣾτϨλ
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
ӳޠԽ • ݴޠϦιʔε͚ͯΔ͠େৎͩΖɾɾ • ͳΜͯࣄͳ͍ • Localizableͷ͍ํΛϛεΔͱେม • ͍͔ͭདྷΔӳޠ൛ʹࠓ͔Βඋ͑Α͏
Slide 7
Slide 7 text
NSLocalizedString
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
class Customer { var firstName: String! var lastName: String! } String.localizedStringWithFormat( "%@ %@༷", customer.lastName, customer.firstName )
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
class Customer { var firstName: String! var lastName: String! } String.localizedStringWithFormat( "%@ %@༷", customer.lastName, customer.firstName )
Slide 13
Slide 13 text
NSPersonNameComponents class Customer { var name: NSPersonNameComponents! ... } let formatter = NSPersonNameComponentsFormatter() formatter.style = .Medium formatter.stringFromPersonNameComponents(customer.name) // -> "Soichiro Horimi"
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
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."
Slide 16
Slide 16 text
NSPersonNameComponents & Formatter • @available(iOS 9.0, *) • ಠࣗͷComponentsͱFormatterΛ༻ҙ • কདྷతʹࠩ͠ସ͍͑ͨɾɾ
Slide 17
Slide 17 text
No content
Slide 18
Slide 18 text
String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) /* ͝༧ਓ */ "%d໊༷" = "%d Guests";
Slide 19
Slide 19 text
String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) /* ͝༧ਓ */ "%d໊༷" = "%d Guests";
Slide 20
Slide 20 text
stringsdict String.localizedStringWithFormat( NSLocalizedString("%d໊༷", comment: "͝༧ਓ"), reservation.guests.count) %d໊༷ NSStringLocalizedFormatKey %#@Guests@ days NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d one %d Guest other %d Guests ୯ ෳ
Slide 21
Slide 21 text
No content
Slide 22
Slide 22 text
NSDateIntervalFormatter • iOS >= 8.0 label.text = String.localizedStringWithFormat( "%@ - %@", begin, end)
Slide 23
Slide 23 text
NSDateIntervalFormatter • iOS >= 8.0 label.text = String.localizedStringWithFormat( "%@ - %@", begin, end) let formatter = NSDateIntervalFormatter() label.text = formatter.stringFromDate(begin, toDate: end)
Slide 24
Slide 24 text
NSDateIntervalFormatter stringsdict NSPersonNameComponents
Slide 25
Slide 25 text
FormatterΛ͍͜ͳͦ͏ • Localizable.strings͋͘·Ͱݴޠཧ • LocaleʹԠͨ͡୯ҐදهͷΓସ͑☓ • ͦͷPlaceholderɺຊʹඞཁʁ ࢀߟ: NSFormatter Class Reference
Slide 26
Slide 26 text
ը૾Ϧιʔε • Background Imageʹෆ͖ • ΞΠίϯ͖UIButtonͰ͍ͨ͘ͳΔ͕… • LocaleʹΑͬͯίʔυ্Ͱذ͕ඞཁ - Asset CatalogͷLocalize͑͞Ͱ͖Εɾɾ
Slide 27
Slide 27 text
ւ֎൛ϦϦʔεɺͦͷઌ • શػೳͷ༁͕ऴྃɺΊͰͨ͠ • ͳΜͯ͜ͱͳ͍ • Ή͠ΖϦϦʔεຖͷ༁࡞ۀ͕ॏՙʹ… • ։ൃεϐʔυΛམͱͣ͞ʹ༁ΛਐΊ͍ͨ
Slide 28
Slide 28 text
༁ࢧԉαʔϏε • Crowdin • XLIFFΛॻ͖ग़ͯ͠Ξοϓϩʔυ͢ΔͷΈ • ֎෦༁ऀͱͷڠۀ͕ḿΔ
Slide 29
Slide 29 text
༁ࢧԉαʔϏε • ༁ϦιʔεΛUPͯ͠ɺਐḿ͕ཧͰ͖Δ • ༁࿙ΕΛՄࢹԽͰ͖Δ • API࿈ܞ
Slide 30
Slide 30 text
ཧ ະ༁text ݁Ռ
Slide 31
Slide 31 text
ݱ࣮ • దͳϦιʔεཧͱࣗಈԽ • ͦΕͰɺݴޠ͕ଟ͍ͱେม • ଞݴޠԽΑΓແݴޠԽ - ݴ༿ແ͠ʹΘΔUI
Slide 32
Slide 32 text
·ͱΊ • FormatterΛ͏·͘׆༻͢Δ - Localizableʹ٧ΊࠐΈա͗ͳ͍ • ը૾Ϧιʔεߟ͑ͷ • ϦϦʔεޙ͏·ࣗ͘ಈԽ͍͚ͯ͠Δͱྑ͍ • ͱ͍͑ແݴޠͳUI͕Πνόϯͷཧ
Slide 33
Slide 33 text
͋Γ͕ͱ͏͍͟͝·ͨ͠ (ΤϯδχΞืूத!)