Upgrade to Pro — share decks privately, control downloads, hide ads and more …

楽しい夏休み!String Catalogs で新しい発見

ojun
August 24, 2023

楽しい夏休み!String Catalogs で新しい発見

ojun

August 24, 2023
Tweet

More Decks by ojun

Other Decks in Programming

Transcript

  1. αϒίϚϯυ print ʹ͍ͭͯ ֓ཁ: xcstringsϑΝΠϧʹදࣔ͞ΕΔ͢΂ͯͷ 
 จࣈྻΩʔΛදࣔ͢Δ xcstringstool print <input-

    fi le> ࢖͍ํ Ҿ਺ <input- fi le> දࣔ͢Δ.xcstringsϑΝΠϧ΁ͷύε Φϓγϣϯ -h —help ϔϧϓ৘ใΛදࣔ
  2. αϒίϚϯυ 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ϑΝΠϧ΁ͷύε
  3. αϒίϚϯυ compile ʹ͍ͭͯ -o --output-directory ग़ྗϑΝΠϧΛ഑ஔ͢ΔσΟϨΫτϦ -f --format <format> ίϯύΠϧͷग़ྗܗࣜ

    
 ɹɹɹɹɹɹɹɹɹɹɹ ɹɹ σϑΥϧτ: stringsAndStringsdict -l --language <language> ίϯύΠϧ͢ΔಛఆݴޠΛࢦఆ 
 ͜ͷΦϓγϣϯ͸ෳ਺ճར༻Մೳ --serialization-format <serialization-format> ҟͳΔදݱ͕ՄೳͳݸʑͷϑΝΠϧͷग़ྗܗࣜ 
 ɹɹɹɹɹɹɹɹɹɹ σϑΥϧτ: text --dry-run ίϯύΠϧʹΑΓੜ੒͞ΕΔग़ྗύεͷվߦ۠੾ΓͷϦετΛग़ྗ͢Δ͕ 
 ࣮ࡍʹ͸Կ΋ίϯύΠϧ͠ͳ͍
  4. compile ͷ࢖༻ྫ $./xcstringstool compile ~/Desktop/Localizable.xcstrings 
 -- output-directory ~/Desktop --

    serialization-format binary FormatʹbinaryΛࢦఆ͢Δ͜ͱͰbinaryܗࣜͰͷੜ੒͕Ͱ͖Δ ipaϑΝΠϧ಺ͷܗࣜͱҰக͢ΔͷͰ 
 Xcode͸ύοέʔδ࡞੒࣌ʹ͜ͷίϚϯυΛ 
 ୟ͍ͯͦ͏
  5. αϒίϚϯυ sync ʹ͍ͭͯ ֓ཁ: .stringsdataϑΝΠϧʹଘࡏ͢Δจࣈྻʹج͖ͮ 
 .xcstringsϑΝΠϧΛߋ৽͢Δ ࢖͍ํ xcstringstool sync

    <xcstrings> ... 
 --stringsdata <stringsdata> ... 
 --skip-marking-strings-stale option Ҿ਺ <xcstrings> Ϛʔδઌͷ.xcstringsϑΝΠϧ
  6. αϒίϚϯυ sync ʹ͍ͭͯ --stringsdata <stringsdata> ιʔε͔Β࢖༻͞ΕΔจࣈྻΛࢦఆ͢Δ 
 .stringsdataϑΝΠϧ --skip-marking-strings-stale .stringsdataʹଘࡏ͠ͳ͍৔߹ʹ

    
 จࣈྻΛݹ͍΋ͷͱͯ͠ϚʔΫͨ͠Γ 
 .xcstrings͔ΒͦΕΒΛ࡟আͨ͠Γ͢ΔͷΛ๷͙ .stringsdataϑΝΠϧΛ࡞੒Ͱ͖ͣίϚϯυΛࢼͤͳ͔ͬͨ ϚΠάϨʔγϣϯΛߦ͏ࡍʹར༻͞ΕΔՄೳੑ͕͋Δ
  7. ·ͱΊ 1. Xcode 15 ͔Β͸ଟݴޠରԠΛߦ͏ࡍʹ .xcstrings Λར༻͢Δ͜ͱ͕Ͱ͖Δ 2. .xcstrings ϑΝΠϧΛར༻ͯ͠΋

    .ipa ϑΝΠϧʹ͸ 
 ͜Ε·Ͱ௨Γ .strings ϑΝΠϧ͕ੜ੒͞ΕΔ 3. .xcstrings ϑΝΠϧ͔Β .strings ϑΝΠϧ΁ͷม׵͸ Xcode 15 ͔Β௥Ճ͞Εͨ 
 xcstringstool ͕ར༻͞Ε͍ͯΔՄೳੑ͕ߴ͍ 1. xcstringstool ͷ compile ίϚϯυΛར༻͠όΠφϦͷੜ੒ΛߦͬͯΔ 2. option ͱͯ͠ --serialization-format binary ͕ࢦఆ͞Ε͍ͯΔ