Giter Club home page Giter Club logo

translate's Introduction

Translate

Simulator Screen Recording - iPhone 13 Pro - 2023-03-06 at 19 03 28

๐Ÿงฉ ๊ฐœ์š”

  • ๋„ค์ด๋ฒ„ ํŒŒํŒŒ๊ณ  api๋กœ ์œ ์ €๊ฐ€ ์ž…๋ ฅํ•œ ํ…์ŠคํŠธ ๋ฒˆ์—ญํ•˜๊ธฐ
  • ๋ฒˆ์—ญ๋œ ํ…์ŠคํŠธ ์ฆ๊ฒจ์ฐพ๊ธฐ (์ฆ๊ฒจ์ฐพ๊ธฐ๊ฐ’ UserDefaults์— ์ €์žฅ)

๐Ÿค” ๋ฐฐ์šด ๋‚ด์šฉ

โœ”๏ธ Localization ํ•˜๊ธฐ

  1. ํ”„๋กœ์ ํŠธ ๋‚ด์— Strings File์„ ์ƒ์„ฑ
  2. ์ƒ์„ฑ๋œ Strings File ์šฐ์ธกํƒญ์— ํŒŒ๋ž€์ƒ‰ Localize ๋ฒ„ํŠผ ํด๋ฆญ
  3. ๋ฃจํŠธ ํ”„๋กœ์ ํŠธ ์„ค์ •์—์„œ Localizations ํƒญ์—์„œ ์–ธ์–ด ์ถ”๊ฐ€ (+๋ฒ„ํŠผ)

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2023-03-06 แ„‹แ…ฉแ„’แ…ฎ 8 02 59

  1. โ€œํ‚ค๊ฐ’โ€ = โ€œํ‘œ์‹œ๋  ์–ธ์–ด์˜ ๊ฐ’โ€ ํ˜•์‹์œผ๋กœ ์ž‘์„ฑ
  2. NSLocalizedString(โ€œํ‚ค๊ฐ’โ€, comment: โ€œํ‘œ์‹œ๋  ์–ธ์–ด์˜ ๊ฐ’โ€) ํ˜•์‹์œผ๋กœ ์ฝ”๋“œ์—์„œ ์‚ฌ์šฉ

โœ”๏ธ UICollectionViewCell ์…€ํ”„ ์‚ฌ์ด์ง•

CollectionViewCell์€ inset์ด ์„ค์ • ๋˜์–ด ์žˆ๋Š” UIStackView๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค. UIStackView์— ์˜ํ•ด ์…€ํฌ๊ธฐ๋ฅผ ์…€ํ”„ ์‚ฌ์ด์ง• ํ•œ๋‹ค.

image

โœ”๏ธ UIStackView์— Inset ์ ์šฉํ•˜๊ธฐ

UIStackView๋Š” ๋‹ค๋ฅธ UI์™€ ๋‹ฌ๋ฆฌ inset์„ ์ง€์ •ํ•ด์ค˜๋„ ๋ฐ”๋กœ ์ ์šฉ๋˜์ง€ ์•Š๋Š”๋‹ค.

isLayoutMarginsRelativeArrangement ์†์„ฑ์„ true๋กœ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค.

stackView.layoutMargins = UIEdgeInsets(top: 16.0, left: 16.0, bottom: 16.0, right: 16.0)
stackView.isLayoutMarginsRelativeArrangement = true

โœ”๏ธ Enum ํƒ€์ž…์—์„œ forEach ์‚ฌ์šฉํ•˜๊ธฐ

Enum ํƒ€์ž…์—์„œ CaseIterable์„ ์ฑ„ํƒํ•˜์—ฌ case ๊ฐ’๋“ค์„ ๋ฐ˜๋ณต๋ฌธ์œผ๋กœ ์ˆœํšŒ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค.

enum์„ allCases ํƒ€์ž… ํ”„๋กœํผํ‹ฐ๋กœ ์ ‘๊ทผํ•˜๋ฉด enum์—์„œ array ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 
 enum Language: String, CaseIterable, Codable {
  // ์ดํ•˜ ์ƒ๋žต
 }
 
 Language.allCases.forEach { lang in
  // ์ดํ•˜ ์ƒ๋žต
 }

translate's People

Contributors

ijs1103 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.