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
楽しい夏休み!String Catalogs で新しい発見
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ojun
August 24, 2023
Programming
2.6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
楽しい夏休み!String Catalogs で新しい発見
ojun
August 24, 2023
More Decks by ojun
See All by ojun
配列と所有権
ojun9
0
80
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
400
アセットのコンパイルについて
ojun9
0
260
Exit 8 for SwiftUI
ojun9
1
300
Swift Evolution かるた
ojun9
2
140
Xcode 16のPreviewModifierと@Previewableを活用した効率的なプレビュー方法の考察
ojun9
4
1.1k
Catch Up with Swift 5.10
ojun9
2
920
Overview: Swift OpenAPI Generator
ojun9
3
2.6k
if 式と switch 式による SwiftUI のプレビューエラー対策
ojun9
1
2.3k
Other Decks in Programming
See All in Programming
スマートグラスで並列バイブコーディング
hyshu
0
290
自作OSでスライド発表する
uyuki234
1
3.8k
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
220
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
どこまでゆるくて許されるのか
tk3fftk
0
470
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
170
フィードバックで育てるAI開発
kotaminato
1
110
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
100
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
140
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Paper Plane (Part 1)
katiecoart
PRO
0
9.6k
Ethics towards AI in product and experience design
skipperchong
2
330
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
Exploring anti-patterns in Rails
aemeredith
3
440
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
690
Transcript
ެ։ SwiftWednesdayʲiOSDC Japan 2023 લʳ 2023/08/24 @DeNA ָ͍͠ՆٳΈʂ String
Catalogs Ͱ৽͍͠ൃݟ ojun - DeNA Co., Ltd.
ࣗݾհʢPKVOʣ w ໊લPKVO w J04ΤϯδχΞ w ৽ଔೖࣾ w ࠃޠ4XJGU @ojun_9
String Catalogsͱ
String Catalogsͱ Xcode 15͔Βར༻Ͱ͖ΔϩʔΧϥΠζΛߦ͏ͨΊʹ༻͍ΒΕΔϑΝΠϧ ϑΝΠϧͷ֦ுࢠ .xcstrings Xcode 15 ͔ΒLegacyѻ͍ʹ Xcode
15 ͔Βར༻Մೳ ͜Ε·Ͱ .strings / .stringdict ϑΝΠϧ͕ར༻͞Ε͍ͯͨ
String Catalogsͱ Discover String Catalogs / https://developer.apple.com/videos/play/wwdc2023/10155/
String Catalogsͱ Discover String Catalogs / https://developer.apple.com/videos/play/wwdc2023/10155/
String Catalogsͱ ϏϧυΛߦ͏ͱՃͨ͠ Localizable.xcstringsϑΝΠϧͷ த͕ࣗಈతʹੜ͞ΕΔ
String Catalogsͱ .xcstringsϑΝΠϧͷதJSON
String Catalogs ʹ͓͚Δٙ .xcstringsϑΝΠϧΛར༻͢ΔͱϏϧυՌʢ.ipaʣʹมԽ͕ੜ͡Δͷ͔ʁ ҧ͍͋Δͷ͔ʁ Ϗϧυ Ϗϧυ
.ipa ϑΝΠϧͷมԽΛ؍͢Δ ̎ͭͷprojectΛ࡞ͯ͠ҧ͍ΛݟΔ
Legacy: .stringsϑΝΠϧͷ߹ .stringsϑΝΠϧΛ࡞͠ɺӳޠͱຊޠͷϩʔΧϥΠζΛߦ͏ ϩʔΧϥΠζΛߦ͏จݴҎԼͷ̎ͭ
New: .xcstringsͷ߹ .xcstringsϑΝΠϧΛ࡞͠ɺӳޠͱຊޠͷϩʔΧϥΠζΛߦ͏ ϩʔΧϥΠζΛߦ͏จݴઌ΄ͲͷจݴͱಉҰʹ͢Δ
.ipaϑΝΠϧͷத .stringsϑΝΠϧͷ߹ ύοέʔδͷதҎԼͷ௨Γ en.lprojͱja.lprojͷϑΥϧμ͕ೖ͍ͬͯΔ͜ͱ͕Θ͔Δ
.ipaϑΝΠϧͷத .stringsϑΝΠϧͷ߹ ֤ .lproj ϑΥϧμͷதʹ Localizable.string ϑΝΠϧ͕֨ೲ͞Ε͍ͯΔ ϑΝΠϧͷதόΠφϦܗࣜʹม͞Ε͍ͯΔ bplist00“_Hello
SwiftWednesday [Hello World $
.ipaϑΝΠϧͷத .xcstringsϑΝΠϧͷ߹ Legacyͷ߹ͱҟͳΓɺen.lprojϑΝΠϧ͕ଘࡏ͠ͳ͍͜ͱ͕Θ͔Δ ja.lproj ϑΝΠϧͷΈ͕ଘࡏ͢Δ
.ipaϑΝΠϧͷத .xcstringsϑΝΠϧͷ߹ ϑΥϧμͷதΛݟΔͱ Localizable.strings ϑΝΠϧ͕ଘࡏ͍ͯ͠Δ
.ipaϑΝΠϧͷத .xcstringsϑΝΠϧͷ߹ ϑΥϧμͷதΛݟΔͱ Localizable.strings ϑΝΠϧ͕ଘࡏ͍ͯ͠Δ .xcstrings ϑΝΠϧΛར༻ͯ͠ .ipa ʹ
.strings ϑΝΠϧ͕ଘࡏ͍ͯ͠Δ .xcstrings ϑΝΠϧͰͳ͍!
͜Ε·Ͱ .ipaϑΝΠϧΛ࡞͢Δͱɺͦͷதʹ .stringsϑΝΠϧ͕࡞ΒΕΔ .ipa ʹଘࡏ͢Δ .string ϑΝΠϧͱݩͷ .string ϑΝΠϧͷதҟͳΔ ϩʔΧϥΠζ͢Δݴޠ͚ͩੜ͞ΕΔ
։ൃத Ϗϧυ .ipa όΠφϦͱͯ͠දݱ
͜Ε͔Β .ipaϑΝΠϧΛ࡞͢Δͱɺͦͷதʹ .stringsϑΝΠϧ͕࡞ΒΕΔ .string ϑΝΠϧͷதόΠφϦ ੜ͞ΕΔϑΝΠϧ࣮ʹΑͬͯݮগ͢Δ Ϗϧυ ։ൃத .ipa όΠφϦͱͯ͠දݱ
͜Ε͔Β .ipaΛ࡞ΔաఔͰ .xcstringsϑΝΠϧΛ .stringsϑΝΠϧʹม͍ͯ͠Δ ม ։ൃத Ϗϧυ ipa
͜Ε͔Β .ipaΛ࡞ΔաఔͰ .xcstringsϑΝΠϧΛ .stringsϑΝΠϧʹม͍ͯ͠Δ ม ։ൃத Ϗϧυ ipa xcstringstool
xcstringstoolΛ୳Δ
xcstringstool ֓ཁ w 5PPM͕ଘࡏ͢Δॴ w 9DPEFBQQ$POUFOUT%FWFMPQFSVTSCJO w FYFDϑΝΠϧ w YDTUSJOHTϑΝΠϧͷૢ࡞Λߦ͏
w 9DPEF͔ΒՃ͞Εͨ
xcstringstool ֓ཁ
xcstringstool ֓ཁ w αϒίϚϯυΛೖΕ࣮ͯߦ͢Δ w αϒίϚϯυ̏ͭ w QSJOU w DPNQJMF
w TZOD
αϒίϚϯυ print ʹ͍ͭͯ ֓ཁ: xcstringsϑΝΠϧʹදࣔ͞ΕΔͯ͢ͷ จࣈྻΩʔΛදࣔ͢Δ xcstringstool print <input-
fi le> ͍ํ Ҿ <input- fi le> දࣔ͢Δ.xcstringsϑΝΠϧͷύε Φϓγϣϯ -h —help ϔϧϓใΛදࣔ
printͷ༻ྫ $ ./xcstringstool print ~/Desktop/Localizable.xcstrings Hello SwiftWednesday Hello World ίϚϯυΛར༻͢Δͱ
.xcstrings ϑΝΠϧʹଘࡏ͍ͯ͠Δ Key ͕ग़ྗ͞Ε͍ͯΔ ͜ͱ͕Θ͔Δ
αϒίϚϯυ compile ʹ͍ͭͯ ֓ཁ: .xcstringsϑΝΠϧͷϏϧυՌʢίϯύΠϧ݁ՌʣΛੜ͢Δ ͍ํ xcstringstool compile <input-
fi le> \ --output-directory <output-directory> \ --format <format> ɹ \ --language <language> … \ --serialization-format <serialization-format> \ --dry-run option Ҿ <input- fi le> ίϯύΠϧ͢Δ.xcstringsϑΝΠϧͷύε
αϒίϚϯυ compile ʹ͍ͭͯ -o --output-directory ग़ྗϑΝΠϧΛஔ͢ΔσΟϨΫτϦ -f --format <format> ίϯύΠϧͷग़ྗܗࣜ
ɹɹɹɹɹɹɹɹɹɹɹ ɹɹ σϑΥϧτ: stringsAndStringsdict -l --language <language> ίϯύΠϧ͢ΔಛఆݴޠΛࢦఆ ͜ͷΦϓγϣϯෳճར༻Մೳ --serialization-format <serialization-format> ҟͳΔදݱ͕ՄೳͳݸʑͷϑΝΠϧͷग़ྗܗࣜ ɹɹɹɹɹɹɹɹɹɹ σϑΥϧτ: text --dry-run ίϯύΠϧʹΑΓੜ͞ΕΔग़ྗύεͷվߦ۠ΓͷϦετΛग़ྗ͢Δ͕ ࣮ࡍʹԿίϯύΠϧ͠ͳ͍
compile ͷ༻ྫ $./xcstringstool compile ~/Desktop/Localizable.xcstrings -- output-directory ~/Desktop ίϚϯυΛ༻͢Δͱ.stringsϑΝΠϧ
͕ੜ͞ΕΔ தͳ͔ͥ dictionary ܗࣜʹͳ͍ͬͯΔ
compile ͷ༻ྫ $./xcstringstool compile ~/Desktop/Localizable.xcstrings -- output-directory ~/Desktop --
serialization-format binary FormatʹbinaryΛࢦఆ͢Δ͜ͱͰbinaryܗࣜͰͷੜ͕Ͱ͖Δ ipaϑΝΠϧͷܗࣜͱҰக͢ΔͷͰ Xcodeύοέʔδ࡞࣌ʹ͜ͷίϚϯυΛ ୟ͍ͯͦ͏
αϒίϚϯυ sync ʹ͍ͭͯ ֓ཁ: .stringsdataϑΝΠϧʹଘࡏ͢Δจࣈྻʹج͖ͮ .xcstringsϑΝΠϧΛߋ৽͢Δ ͍ํ xcstringstool sync
<xcstrings> ... --stringsdata <stringsdata> ... --skip-marking-strings-stale option Ҿ <xcstrings> Ϛʔδઌͷ.xcstringsϑΝΠϧ
αϒίϚϯυ sync ʹ͍ͭͯ --stringsdata <stringsdata> ιʔε͔Β༻͞ΕΔจࣈྻΛࢦఆ͢Δ .stringsdataϑΝΠϧ --skip-marking-strings-stale .stringsdataʹଘࡏ͠ͳ͍߹ʹ
จࣈྻΛݹ͍ͷͱͯ͠ϚʔΫͨ͠Γ .xcstrings͔ΒͦΕΒΛআͨ͠Γ͢ΔͷΛ͙ .stringsdataϑΝΠϧΛ࡞Ͱ͖ͣίϚϯυΛࢼͤͳ͔ͬͨ ϚΠάϨʔγϣϯΛߦ͏ࡍʹར༻͞ΕΔՄೳੑ͕͋Δ
LT·ͱΊ
·ͱΊ 1. Xcode 15 ͔ΒଟݴޠରԠΛߦ͏ࡍʹ .xcstrings Λར༻͢Δ͜ͱ͕Ͱ͖Δ 2. .xcstrings ϑΝΠϧΛར༻ͯ͠
.ipa ϑΝΠϧʹ ͜Ε·Ͱ௨Γ .strings ϑΝΠϧ͕ੜ͞ΕΔ 3. .xcstrings ϑΝΠϧ͔Β .strings ϑΝΠϧͷม Xcode 15 ͔ΒՃ͞Εͨ xcstringstool ͕ར༻͞Ε͍ͯΔՄೳੑ͕ߴ͍ 1. xcstringstool ͷ compile ίϚϯυΛར༻͠όΠφϦͷੜΛߦͬͯΔ 2. option ͱͯ͠ --serialization-format binary ͕ࢦఆ͞Ε͍ͯΔ
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ