Skip to content

Latest commit

ย 

History

History
150 lines (83 loc) ยท 4.75 KB

Creating-Great-Localized-Experiences-with-Xcode11.md

File metadata and controls

150 lines (83 loc) ยท 4.75 KB

Creating Great Localized Experiences with Xcode 11

๐Ÿ“… 2019.11.15 (๊ธˆ)

WWDC 2019 | Session : 403 | Category : Localization

๐Ÿ”— Creating Great Localized Experiences with Xcode 11 - WWDC 2019 - Videos - Apple Developer

New localization feature

๐Ÿ†• Launch to Settings

Setting์—์„œ ์•ฑ ๋งˆ๋‹ค ์–ธ์–ด ์„ค์ •์„ ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • ์ฝ”๋“œ๋กœ ์–ธ์–ด๋ฅผ ๋ฐ”๊พธ๋Š”๊ฑด ์ง€์›ํ•˜์ง€ ์•Š๋Š”๋‹ค.

  • ์•ฑ์—์„œ language option์„ ์ถ”๊ฐ€ ํ•˜๊ณ  ์‹ถ์œผ๋ฉด Setting์„ Launch

    UIApplication.shared.open(URL(string: UIApplication.openSettingURLString)!)

ViewController State Restoration

  • Setting์„ ํ†ตํ•ด language๋ฅผ ๋ฐ”๊พธ๋ฉด ์•ฑ์€ relaunch๋œ๋‹ค.

  • AppDelegate ์—์„œ ์ƒํƒœ ๊ฐ’์„ ๋ณต๊ตฌ ํ•  ์ˆ˜ ์žˆ๋‹ค.

    application(:shouldSaveApplicationState:) application(:shouldRestoreApplicationState:)

launguage๊ฐ€ ๋Š๊น€ ์—†์ด ์ „ํ™˜ ๋  ์ˆ˜ ์žˆ๋„๋ก controller์—์„œ restorationIdentifier ์„ ์„ธํŒ…ํ•ด๋ผ.

๐Ÿ†• Scene State Restoration

iOS13์—์„œ Scene Delegate ์—์„œ ์ƒํƒœ๊ฐ’์„ restoration ํ•  ์ˆ˜ ์žˆ๋Š” API๊ฐ€ ์ถ”๊ฐ€ ๋˜์—ˆ๋‹ค.

    stateRestorationActivity(for scene:)

scene state๋ฅผ encode ํ•ด์ฃผ๋Š” NSUserActivity ๊ฐ์ฒด๋ฅผ returnํ•œ๋‹ค.

Bundle and Local APIs

  • ์•ฑ ๋‚ด์˜ ๋ชจ๋“  ์ฝ˜ํ…์ธ ๋Š” ํ•˜๋‚˜์˜ ์–ธ์–ด๋กœ ์ผ์น˜ํ•ด์•ผ ํ•œ๋‹ค.

  • custom ์ด๋‚˜ server-side resource ๋กœ๋”ฉ์„ ์œ„ํ•ด Locale ์ด๋‚˜ Bundle API ๋ฅผ ์‚ฌ์šฉํ•ด๋ผ.

    Local.preferredLanguages Bundle.main.preferredLocalizations Bundle.preferredLocalizations(from: availableLanguages)

Locale APIs for Language Preference

Setting์˜ ์œ ์ €์˜ ์–ธ์–ด์™€ ์ง€์—ญ ์„ค์ •์„ ๋ถˆ๋Ÿฌ์˜จ๋‹ค.

Locale.preferredLanguages ๋ฅผ ํ•˜๋ฉด user preference ์–ธ์–ด ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.

(ex. ["pa-IN", "en-IN", "hi-IN", ...]

Bundle APIs for Language Matching

ํ˜„์žฌ ์‹คํ–‰ ๋˜๊ณ  ์žˆ๋Š” ์•ฑ์˜ ์–ธ์–ด๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.

Bundle.main.preferredLocalizations.first

์™ธ๋ถ€ language ์„ค์ •์ด ์žˆ๋‹ค๋ฉด, ๊ทธ ์ค‘์—์„œ ์„ธํŒ…์„ ํ•ด์ค€๋‹ค.

    let availableLanguages = Server.requestAvailableLanguages()
    Bundle.preferredLocalizations(from: availableLanguages).first

Localization Enhancements in Xcode

Performance

localization์„ ์œ„ํ•œ Interface Builder export๊ฐ€ 15๋ฐฐ ๋นจ๋ผ์กŒ๋‹ค.

Device-Specific Strings

์ฝ”๋“œ์—์„œ ํ•˜๋‚˜์˜ NSLocalizedString() ๋ฅผ ํ˜ธ์ถœ ํ•  ์ˆ˜ ์žˆ๋‹ค

Deivce-specific string์€ .stringdict๋กœ ์ •์˜๋˜์–ด ์žˆ๋‹ค.

์—ฌ๋Ÿฌ๊ฐœ์˜ ๋‹ค์–‘ํ•œ width rule๋กœ ์กฐํ•ฉ ๋  ์ˆ˜ ์žˆ๋‹ค.

Assets

Image sets, Watch complications, Apple TV image stacks, Sprite atlases, Game Center dashboards and leaderboards, Symbol sets

โ†’ ๋‹ค Localization ๊ฐ€๋Šฅ ํ•ด์กŒ๋‹ค!

Symbols

SF system symbols, Custom symbols Localized ๊ฐ€๋Šฅ!

Localized screenshots with XCTest

Localization Testing

Clipping, Truncation, Layout overlapping, Right-to-Left languages

์—ฌ๋Ÿฌ ๊ฐœ์˜ ์–ธ์–ด๋ฅผ ์ง€์› ํ•œ๋‹ค๋ฉด, ํ…Œ์Šคํ„ฐ๊ฐ€ ์–ธ์–ด ๋ณ„๋กœ, ๋””๋ฐ”์ด์Šค ๋ณ„๋กœ ๋„ˆ๋ฌด ๋งŽ์€ ์‹œ๋‚˜๋ฆฌ์˜ค์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๊ฐ€ ํ•„์š”ํ•˜๋‹ค. ๊ทธ๋ž˜์„œ QA์—์„œ ์ˆ˜๋™์œผ๋กœ ํ•˜๋Š” ์ž‘์—…์„ ์œ„ํ•ด ํ”„๋กœ์ ํŠธ์— ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์€ ๊ต‰์žฅํžˆ ์ค‘์š”ํ•˜๋‹ค.

Xcode11์—์„œ๋Š” ์ด๋Ÿฐ ํ…Œ์ŠคํŠธ๋ฅผ XCTESTPLAN๋ฅผ ํ†ตํ•ด ์‰ฝ๊ฒŒ ์ž๋™ํ™” ํ•  ์ˆ˜ ์žˆ๋‹ค.

Test Plan

Multiple tests, Multiple configurations


Set up Tests for Localization

Accessibility Identifier ์€ ๊ณ ์œ ํ•˜๊ณ , ์•ˆ์ •๋˜๊ณ , ์–ด๋–ค language์—์„œ๋„ ํ…Œ์ŠคํŠธ ํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ๋ณด์žฅ ํ•  ์ˆ˜ ์žˆ๋‹ค.

    myCell.accessibilityIdentifier = "myCell"
    
    app.tabs.cells["myCell"].tap()

Generate Localized Screenshots

Multiple Configuration ์ƒ์„ฑ ํ•  ์ˆ˜ ์žˆ๊ณ , ๊ฐ๊ฐ์˜ configuration ๋งˆ๋‹ค ๋‹ค๋ฅธ language๊ณผ region์„ ์„ค์ • ํ•  ์ˆ˜ ์žˆ๋‹ค.

UI Testing ์„น์…˜์˜ ์„ค์ •์œผ๋กœ ์Šคํฌ๋ฆฐ์ƒท์„ ์ง€์† ํ•  ์ˆ˜ ์žˆ๋‹ค.

์Šคํ‚ด ๋งค๋‹ˆ์ €๋ฅผ ํ†ตํ•ด ์„ค์ • ํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

Xcode Localization Catalog

Xcode Localization Catalog๋Š” String๊ณผ String์ด ์•„๋‹Œ ๊ฒƒ๋“ค ๋ชจ๋‘ ํ•œ ๊ณณ์—์„œ Localizing ์ฒ˜๋ฆฌ ํ•˜๋Š” ์ผ๋ฐ˜์ ์ธ ๋ฐฉ์‹์ด๋‹ค.

๐Ÿ†•Screenshot์„ Xcode Localization Catalog์— ์ž๋™์œผ๋กœ ํฌํ•จ๋  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์˜€๋‹ค.

Localization export ์‹œInclude screenshots ์ฒดํฌ ํ•˜๋ฉด ๋จ