iOS版グローバル対応の罠と技

 iOS版グローバル対応の罠と技

potatotips #12で発表した資料の加筆修正版です。

Androidバージョン
http://www.slideshare.net/tomoakiimai2/us-localization

86aef9515e5986c096bc398c8990992e?s=128

Shinichiro Oba

December 17, 2014
Tweet

Transcript

  1. J04൛ άϩʔόϧରԠͷ᠘ͱٕ גࣜձࣾϝϧΧϦ େఉ৻Ұ࿠

  2. େఉ৻Ұ࿠ ϑϦϚΞϓϦʮϝϧΧϦʯ J04ΤϯδχΞ PPCBCSJDLMJGF

  3. ϝϧΧϦ ೥݄+1൛ϦϦʔε ೥݄64൛ϦϦʔε

  4. άϩʔόϧରԠ

  5. άϩʔόϧରԠͷํ਑ w ·ͣ͸64ɺͦͷ͋ͱϤʔϩούͳͲ΋ࢹ໺ʹ w ւ֎औҾېࢭɻࠃ͝ͱʹ%#΍αʔόΛΘ͚Δ w ݴޠɺ௨՟ɺ೔࣌ɺܾࡁɺ഑ૹͷҧ͍Λٵऩ

  6. ΍ͬͨ͜ͱ w ผόΠφϦԽ w λʔήοτͱYDDPOpH w Ϧʔδϣϯ؅ཧ w ຋༁ʢ"(JOʣ w

    ຋༁ʢ5SBOTJGFYʣ w ύοέʔδ௚઀ฤू w ೔࣌ͱ௨՟ͷॻࣜ w ςΩετೖྗઃఆ
  7. ̍όΠφϦ WT ผόΠφϦ

  8. ผόΠφϦΛ࠾༻ w ىಈ௚ޙ͔Βͦͷࠃ͝ͱͷઃఆͰಈ͚ΔΑ͏ʹ w ୺຤ͷ*1ΞυϨε΍஍Ҭઃఆ͸ࢀߟʹ͠ͳ͍ w 64൛ʹ͸೔ຊޠϦιʔεΛؚΊͳ͍ʢͦͷٯ΋ʣ w ഑෍͢ΔετΞ΋ߜΔ w

    ̍ϓϩδΣΫτͰλʔήοτΛ૿΍ͯ͠ରԠ
  9. λʔήοτ w ࠃº؀ڥͷ਺͚ͩλʔήοτΛ࡞੒ w λʔήοτͷ਺͚ͩYDDPOpHΛ࡞੒

  10. YDDPOpH

  11. ͋ͱͰࠃΛ੾Γସ͑Ͱ͖Δ Α͏ʹͨ͘͠ͳΔ͔΋ʜ

  12. ϦʔδϣϯΫϥεͷಋೖ w "1*΍)5.-ͷ63-ɺܾࡁํ๏΍഑ૹํ๏ɺ௨՟΍೔ ࣌ͷϑΥʔϚολɺ֤छ*%ͳͲΛಁաతʹ؅ཧ w ʮͲͷࠃ͔ʁʯͰ͸ͳ͘ʮίϯϏχܾࡁΛ࢖͑Δ͔ʁʯ ͳͲҙຯతʹ൑அ͢Δ͜ͱͰJGͷటপԽΛճආ w ࣮૷্͸ϦʔδϣϯΛಈతʹ੾Γସ͑ΒΕΔΑ͏ʹ͠ ͓͍ͯͯɺϏϧυ࣌ʹ̍ͭͷϦʔδϣϯ͚ͩ༗ޮʹ

    [[Region currentRegion] canUseCvs]
  13. ຋༁

  14. ຋༁ w ೔ຊޠͰ࡞͍ͬͯͨ΋ͷΛӳޠʹ຋༁ w ͳΔ΂͘ඪ४ͷ࢓૊ΈͰ຋༁͍ͨ͠ w ౰ॳλʔήοτ͕J04ͩͬͨͷͰํ๏͕ݶΒΕΔ "(JOͱ5SBOTJGFY͕׆༂

  15. "(JO w IUUQTHJUIVCDPNBOHFMPMMPRVJ"(JO w πʔϧͱϥΠϒϥϦͷηοτ w YJCɺTUPSZCPBSEɺN͔Β຋༁ର৅Λ͔͖ूΊͯҰ ͭͷ-PDBMJ[BCMFTUSJOHʹͯ͘͠ΕΔ w 6*-BCFM΍6*#VUUPOͳͲͷBXBLF'SPN/JCΛϑο

    Ϋͯ͠຋༁Λ൓өͯ͘͠ΕΔ
  16. 5SBOTJGFY w IUUQTXXXUSBOTJGFYDPN w "(JOͰҰͭʹͳͬͨ-PDBMJ[BCMFTUSJOHΛ͜Ε Ͱ؅ཧɾ຋༁͢Δ w KBͷ-PDBMJ[BCMFTUSJOHΛ5SBOTJGFYʹQVTI w 5SBOTJGFY্Ͱ຋༁ޙFOͷ-PDBMJ[BCMFTUSJOHΛQVMM

    w ຋༁୲౰ऀ͕8FC্Ͱ຋༁͢Δ͚ͩ
  17. 5SBOTJGFYͷ᠘ w ͋ΔϒϥϯνͰQVTIͨ͠຋༁ର৅͕ɺଞͷϒϥϯ ν͔ΒͷQVTIͰফ͑ͨΓ͢Δ w NBTUFSͰQVTIˍQVMM͢Δ͜ͱʹͯ͠ղܾ w ݱࡏ͸-PDBMJ[BCMFTUSJOH͚ͩผϦϙδτϦͰ؅ཧ ͢Δ͜ͱʹͨ͠ ৄ͘͠͸ฐࣾ"OESPJEΤϯδχΞͷࢿྉΛࢀর

    IUUQTTTTMJEFDPNXXXTMJEFTIBSFOFUUPNPBLJJNBJVTMPDBMJ[BUJPO
  18. όϯυϧ͢ΔϦιʔε͸ɺ +1൛͸೔ຊޠ͚ͩɺ 64൛͸ӳޠ͚ͩʹ͍ͨ͠

  19. 8IZʁ w ΞϓϦͷαΠζΛখ͍ͨ͘͞͠ w 64͚ͩʹ͔͠ͳ͍ը໘Λ೔ຊޠԽͨ͘͠ͳ͍ w Ϣʔβಉ࢜҆৺ͯ͠΍ΓͱΓͯ͠΋Β͏ͨΊɺ ͦͷࠃͷެ༻ޠΛ࢖͑Δਓ͚ͩʹ࢖ͬͯ΋Β͍ ͍ͨ

  20. Ͱ΋ʜ ϩʔΧϥΠζ͞ΕͨϦιʔε୯ҐͰͷ όϯυϧ੍ޚ͸Ͱ͖ͳ͍

  21. ύοέʔδΛ௚઀ૢ࡞ w #VJME1IBTFTͰ$PQZ#VOEMF3FTPVSDFTͷ͋ͱ ʹඞཁͷͳ͍ϦιʔεΛফͯ͠͠·͑͹͍͍ w ྫ͑͹3VO4DSJQUͰҎԼΛ࣮ߦ rm -Rf "$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/en.lproj" ࢀߟ

    IUUQTEFWFMPQFSBQQMFDPNMJCSBSZNBDEPDVNFOUBUJPO%FWFMPQFS5PPMT3FGFSFODF 9DPEF#VJME4FUUJOH3FG#VJME@4FUUJOH@3FGFSFODFCVJME@TFUUJOH@SFGIUNM
  22. ॻࣜ

  23. ॻࣜ͸᠘͕͍ͬͺ͍

  24. ೔࣌ͷॻࣜ w ࣌ؒදهͷ0/0''΍੢ྐྵ࿨ྐྵͰ΍΍ϋϚΔ w Ͱ΋ͦΜͳʹେม͡Όͳ͍ ϑΥʔϚοτ ग़ྗ +1 yyyy/MM/dd HH:mm

     64 MM/dd/yyyy KK:mm aa 1.
  25. ௨՟ͷॻࣜ w Ұํɺ௨՟ͷॻࣜ͸᠘ͩΒ͚ w ௨՟୯ҐͷҐஔɺখ਺఺ɺܻ۠੾ΓɺϚΠφεදه w 2"ʹʮJ04ͰϚΠφεදه͕࢓༷Ͳ͓Γ͡Όͳ͍ʯ ͱόάѻ͍͞ΕͨΓ͠·͢ ࢀߟ IUUQIPNFQBHFOJGUZDPNUBCPUBCPDDDTZPTVIUN

  26. ௨՟ͷॻࣜ w ྫ͑͹ɺ஍ҬΛΞϝϦΧ߹ऺࠃʹͯ͠ɺݴޠΛӳޠ ͱΠλϦΞޠͰ੾Γସ͑ͨ৔߹ w ܻ۠੾Γ͕ϐϦΦυͰɺখ਺఺͕ΧϯϚͰɺ௨՟୯ Ґ͕ޙΖʹ͘Δʜʂ

  27. ௨՟ͷॻࣜ w %FDJNBM1BEͷখ਺఺΋มΘΔΑʂ

  28. 64Ͱ͸ηϯτΛখ਺఺ҎԼ ͷ਺஋ͱͯ͠ೖྗ͍ͤͨ͞ w ಺෦తʹ͸ηϯτͰѻ͍ͬͯΔʢʹʣ w ͔͠͠ɺখ਺఺͕ϐϦΦυͰ͋Δ͜ͱΛલఏʹೖྗ ͞ΕͨจࣈྻΛղੳ͢ΔͱɺॻࣜઃఆʹΑͬͯ͸ਖ਼ ͘͠ղੳͰ͖ͳ͍ w ॳظWFSͰ͜ΕΛ΍ͬͯ͠·͍͓໰͍߹Θͤଟ਺PS[

  29. /4/VNCFS'PSNBUUFS͕ ॿ͚ͯ͘Ε·͢ • ݱࡏͷॻࣜͰ࢖ΘΕ͍ͯΔখ਺఺΍ܻ۠੾Γͷจࣈ Λڭ͑ͯ͘ΕΔ @property (copy) NSString *decimalSeparator; @property

    (copy) NSString *currencyDecimalSeparator; @property (copy) NSString *groupingSeparator; ࢀߟ IUUQTEFWFMPQFSBQQMFDPNMJCSBSZJPTEPDVNFOUBUJPO$PDPB3FGFSFODF'PVOEBUJPO$MBTTFT /4/VNCFS'PSNBUUFS@$MBTTJOEFYIUNMBQQMF@SFGPDDJOTUQ/4/VNCFS'PSNBUUFS DVSSFODZ%FDJNBM4FQBSBUPS
  30. ӳޠݍͷςΩετೖྗͷઃఆ w ࣗಈେจࣈೖྗ͸͍͍ͨͯ0/ʹ͍ͯ͠Δ w ࣗಈमਖ਼΋͍͍ͨͯ0/ʹͯ͠Δ w εϖϧνΣοΫ΋͍͍ͨͯ0/ʹ͍ͯ͠Δ w ೔ຊޠݍͩͱશ෦0''ʹ͕ͪ͠

  31. ςΩετೖྗܥ6*ͷઃఆΛ ͖ͪΜͱ͠Α͏ w ࣗಈେจࣈमਖ਼΍ࣗಈमਖ਼ɺεϖϧνΣοΫ͸ೖྗ 6*͝ͱʹ0/0''Ͱ͖Δ w ৔ॴʹΑͬͯ୯ޠ΍จষͷઌ಄͕େจࣈʹͳΔΑ͏ ʹ͠Α͏ʢ8PSETPS4FOUFODFTʣ w ϝʔϧΞυϨε΍ύεϫʔυ͸શ෦0''ʹ͠Α͏

    w ಈ࡞ݕূத͸ઃఆͰࣗಈमਖ਼ܥΛશ෦0/ʹ͠Α͏
  32. ࣗಈमਖ਼ܥͷઃఆ

  33. ͦͷ΄͔ w ෳ਺ܗରԠ w େจࣈɺηϯλϦϯάɺࣼମͷηϯε w ίϛϡχέʔγϣϯ w ͳͲͳͲ

  34. ͓ΘΓ Կ͔͋Ε͹ؾܰʹ!PPCB·Ͱ ΤϯδχΞืूதʂ