How to make your app international

How to make your app international

In Japanese

562e29ba057361b2b944bd7bbd274887?s=128

Yusei Nishiyama

November 18, 2016
Tweet

Transcript

  1. J04ΞϓϦέʔγϣϯͷ ւ֎ల։ ΫοΫύουגࣜձࣾւ֎ࣄۀ෦ ੢ࢁ༐ੈ!ZVTFJOJTIJZBNB

  2. 8IPBN* w :VTFJ/JTIJZBNB !ZVTFJOJTIJZBNB  w J04EFWFMPQFS ZFBST w *OUFSOBUJPOBMHSPVQ

  3. એ఻ དྷ೥࢝ʹٕज़ධ࿦ࣾͷ8&# %# 13&44QMVTγϦʔζ͔Β ʰ4XJGU࣮ફೖ໳ʱΛग़൛͠·͢

  4. "HFOEB wϨγϐͱݴޠ wϢʔβʔͷݴޠͷܾఆ w35-ରԠ wϫʔΫϑϩʔ wϩʔΧϥΠζͷ5JQT

  5. Ϩγϐͱݴޠ

  6. ૝ఆ͍ͯ͠ͳ͍Ϣʔεέʔε wϢʔβʔ͕ࣗ෼ͷࠃҎ֎ͷ
 ϨγϐΛӾཡ͢Δ wࣗಈ຋༁ͰཧղͰ͖ͳ͍ݴޠͷ
 Ϩγϐ΋ӾཡͰ͖ΔΑ͏ʹ͢Δ

  7. ίϯςϯπͷύʔιφϥΠζ wϢʔβʔ͕ཧղͰ͖ΔݴޠͰϨγϐ͕
 هड़͞Ε͍ͯΕ͹ྑ͍Θ͚Ͱ͸ͳ͍ w৯ࡐʹϦʔνͰ͖Δ؀ڥʹ͍ͳ͚Ε͹
 ϨγϐΛ࠶ݱͰ͖ͳ͍ wΞΧ΢ϯτͱݴޠ͸ର wਓͷϢʔβʔ͕ෳ਺ͷݴޠΛލ͍Ͱ࢖༻͢ Δ͜ͱΛ૝ఆ͍ͯ͠ͳ͍

  8. Ϣʔβʔͷݴޠͷܾఆ

  9. σόΠεͷݴޠઃఆ͸
 ৴༻Ͱ͖Δʁ wӳޠઃఆ͕໨ཱͭ w୺຤ͷྲྀ௨ܦ࿏͸༷ʑ wݴޠɺϩέʔϧͷม͑ํ Λ஌͍ͬͯΔͱ͸ݶΒͳ͍

  10. ໌ࣔతͳݴޠબ୒ wݴޠ͝ͱʹίϯςϯπ͕
 ҟͳΔ wཧղͰ͖ΔݴޠͰ͸ͳ͘ɺ ͲͷݴޠʮݍʯͷϨγϐΛ Ӿཡ͍͔ͨ͠Λબ୒͢Δ

  11. Ϣʔβʔͷݴޠͷ༧ଌ w4*.ͷ৘ใ wσόΠεͷݴޠ wϩέʔϧ

  12. struct CountryCodePredictor { static func inferredISOCountryCode() -> String? { return

    countryCodeFromNetwork() ?? countryCodeFromLocale() ?? nil } private static func countryCodeFromNetwork() -> String? { return NetworkInfoUtils.isoCountryCode() } private static func countryCodeFromLocale() -> String? { let locale = NSLocale.currentLocale() return locale.objectForKey(NSLocaleCountryCode) as? String } } class NetworkInfoUtils { // Check MCC class func isoCountryCode() -> String? { let networkInfo = CTTelephonyNetworkInfo() let carrier = networkInfo.subscriberCellularProvider if let carrier = carrier { return carrier.isoCountryCode // ISO 3166-1 } else { return nil } } }
  13. ίϯςϯπͷݴޠͱ
 6*ͷݴޠ wίϯςϯπͷݴޠͱ6*ͷݴޠΛ Ұக͍ͤͨ͞ wσόΠεͷݴޠઃఆ͸৴༻
 Ͱ͖ͳ͍ લड़

  14. 6*ͷݴޠΛಈతʹ੾Γସ͑Δ

  15. ϦιʔεϑΝΠϧ΁
 ௚઀ΞΫηε͢Δ private func LocalizedString(key: String, tableName: String? = nil,

    bundle: NSBundle = NSBundle.mainBundle(), value: String = "", language: Language) -> String { if let path = NSBundle.mainBundle().pathForResource(language.ISO639_1, ofType: "lproj"), bundle = NSBundle(path: path) { return bundle.localizedStringForKey(key, value: value, table: tableName) } else { ʢলུʣ } }
  16. ஫ҙ఺ wϦιʔεϑΝΠϧ΁ͷύεͷ
 ૊Έཱͯ͸ඇਪ঑ wγεςϜ͕දࣔ͢Δจݴ͸
 σόΠεͷݴޠʹґଘͨ͠··

  17. 35-ରԠ

  18. "VUP-BZPVUͷ৔߹

  19. "VUP-BZPVUʹ
 པΒͳ͍35-ʜ w-FBEJOHɺ5SBJMJOHͷํ޲͸
 ʮσόΠεͷݴޠઃఆʯͰܾ·Δ wΞϓϦ಺ͰݴޠઃఆΛ࣋ͬͯ͠·ͬͯ
 ͍ΔͷͰɺ͜ΕʹཔΔ͜ͱ͕Ͱ͖ͳ͍ w୺຤ͷݴޠઃఆ͕ӳޠͰɺϢʔβʔ͕
 બ୒ͨ͠ݴޠ͕"SBCJDͱ͍͏͜ͱ͕
 ͋ΓಘΔ

  20. 7JFXͷ൓స 
 transform = CGAffineTransformMakeScale(-1, 1)


  21. 3PPUWJFXͷ൓స override func viewDidLoad() { super.viewDidLoad() view.flipIfNeeded() }

  22. ํ޲Λ࣋ͬͨཁૉͷ൓స private var titleLabel: Label = { let label =

    Label.newAutoLayoutView() label.textColor = UIColor.cgu_greenColor() label.flipIfNeeded() return label }()
  23. ໰୊఺ wख࡞ۀ wϛε͕ൃੜ͠΍͍͢ wଞͷํ๏ʢϝιουஔ׵ͳͲʣ ΋ߟ͕͑ͨɺίϯτϩʔϧ͕
 ೉͘͠ɺ෭࡞༻͕ා͍

  24. ϫʔΫϑϩʔ

  25. wӳޠͷจݴ͚ͩΛ௥Ճ w຋༁࡞ۀ͕ϒϩοΫʹͳΒͳ͍Α͏ʹ͜ͷ ஈ֊Ͱ͸ଞͷݴޠʹ͸ରԠ͠ͳ͍ w຋༁Λޙճ͠ʹ͢ΔͨΊ(JU)VCqPXͰ͸ ৗʹNBTUFSΛϦϦʔεՄೳʹͰ͖ͳ͍ export upload translate download import

    develop feature RC
  26. export upload translate download import develop feature RC desc "Export

    xliff file of base locale." task :export do sh "xcodebuild -exportLocalizations -localizationPath . -project Global.xcodeproj" sh "mv #{BASE_LOCALE}#{EXT} #{SOURCE_FILE}" end desc "Upload xliff file of base locale to OneSky platform." task :upload do resp = project.upload_file(file: "#{SOURCE_FILE}", file_format: 'XLIFF', is_keeping_all_strings: false) p resp.code end wYMJGGܗࣜͷϑΝΠϧʹϕʔεݴޠ ӳޠ ͷ
 จݴΛΤΫεϙʔτ w0OF4LZ ޙड़ ʹΞοϓϩʔυ
  27. export upload translate download import develop feature RC w0OF4LZΛར༻ w֤ࠃͷϝϯόʔ͕຋༁࡞ۀ

    w୯ͳΔ௚༁Ͱͳ͘αʔϏεͷ
 ࢥ૝Λ൓өͨ͠ҙ༁
  28. 0OF4LZ

  29. export upload translate download import develop feature RC desc "Download

    translations from OneSky platform." task :download => TMP_DIR do ACTIVE_LOCALES.each { |locale| file_name = file_name(locale) resp = project.export_translation(source_file_name: SOURCE_FILE, locale: locale, export_file_name: file_name) File.open(file_name, 'w') { |file| file.write(resp) } } end desc "Import translated xliffs." task :import do ACTIVE_LOCALES.each { |locale| sh "xcodebuild -importLocalizations -localizationPath #{file_name(locale)} -project Global.xcodeproj" } end w֤ݴޠຖͷYMJGGܗࣜͷϑΝΠϧΛ0OF4LZ͔Β μ΢ϯϩʔυ wμ΢ϯϩʔυͨ͠ϑΝΠϧΛ9DPEFʹΠϯϙʔτ
  30. ະղܾͷ໰୊ wจݴͷίϯςΩετͷڞ༗͕೉͍͠ wಉ͡จݴͰ΋ϓϥοτϑΥʔϜ͝ͱ ʹ຋༁͢Δඞཁ͕͋Δ w຋༁ϛε͕໨ཱͭ

  31. ϩʔΧϥΠζͷ5JQT

  32. /4-PDBMJ[FE4USJOHͷ Ωʔ஋ wίϯςΩετ͕Θ͔Δ໋໊ wಉ͡จݴͰ΋ෳ਺ͷՕॴͰ
 ࢖͍·Θ͞ͳ͍ "new" = "new"; "home.feed.new" =

    "new";
  33. ม਺ͷॱং ม਺ͷॱং͕ݴޠؒͰಉ͡ͱ͸
 ݶΒͳ͍ "Copy %@’s %@" = "%@ von %@

    kopieren"; "Copy %@’s %@" = "%$2@ von %$1@ kopieren"; "Copy %@’s %@" = "Copying %@’s %@";
  34. %PVCMF-FOHUI 1TFVEPMBOHVBHF

  35. 3JHIUUP-FGU 1TFVEPMBOHVBHF

  36. /44IPX/PO-PDBMJ[FE4USJOHT

  37. ετΞͰͷ"SBCJDରԠ wJ5VOFT$POOFDU͸"SBCJDʹ
 ରԠ͍ͯ͠ͳ͍ wӳޠͷϝλσʔλʹซه͢Δͷ͕
 Ұൠతͳ໛༷

  38. ͋Γ͕ͱ͏͍͟͝·ͨ͠