Skip to content

[CVW-047] 코인 디테일 화면 국제화 적용(한글, 영어, 달러, 원화)#61

Merged
J0onYEong merged 7 commits intomainfrom
feature/coin-detail-i18n
May 13, 2025
Merged

[CVW-047] 코인 디테일 화면 국제화 적용(한글, 영어, 달러, 원화)#61
J0onYEong merged 7 commits intomainfrom
feature/coin-detail-i18n

Conversation

@J0onYEong
Copy link
Collaborator

변경된 점

  • 코인 디테일 화면 국제화 적용(한글, 영어, 달러, 원화)
  • 가격 소수점 표현 방식 수정

코인 디테일 화면 국제화 적용(한글, 영어, 달러, 원화)

코인 디테일 화면에 국제화 표현을 적용했습니다.
메인화면과 같이 설정에 따라 동적으로 언어 및 화폐가 변경됩니다.

영어, 달러 한국어, 원화

가격 소수점 표현 방식 수정

코인 가격을 원화로 환산할 때,
예: USDT 가격 × 환율 결과가 3213.12312312원처럼 지나치게 많은 소수점 자릿수를 포함하는 경우가 발생합니다.

단순히 고정된 소수점 자리수를 적용할 경우 다음과 같은 문제가 있습니다:

  • 정보 손실: $ 0.001 → $ 0.00 (정확도 저하)
  • 시각적 과잉: ₩ 3213.12312312 (가독성 저하)

이에 따라 최소 자리수(min)와 최대 자리수(max)를 설정하고,
최소 자리수부터 시작해 유의미한 숫자가 나타날 때까지 자리수를 늘려가며 표현하는 방식을 선택했습니다.

예: 최소 표현2, 최대 표현 자리수가 4인 경우
1 = 1.00
0.1 = 0.10
0.01 = 0.01
0.001 = 0.001
0.0001 = 0.0001
0.00001 = 0.0000

현재 최소 소수점 자릿수는 2자리 최대 소수점 자리수는 8자리로 설정했습니다.
설정 사유

  • 대부분의 법정 화폐 단위(예: KRW, USD)는 소수점 둘째 자리까지 가격 표현이 일반적입니다.
  • 암호화폐 시장에서는 소수점 6~8자리까지 거래되는 코인이 많은 것으로 확인됬습니다.

@J0onYEong J0onYEong requested a review from Copilot May 13, 2025 13:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies internationalization to the coin detail screen by updating UI texts based on language and currency settings and refines the price decimal display logic. Key changes include:

  • Updating view models and UI components to use new render objects (e.g. TickerInfoRO) and localized column titles.
  • Integrating exchange rate retrieval and formatting into ticker, orderbook, and coin trade computations.
  • Adjusting dependency injections and test cases to support the new I18N and exchange rate features.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Projects/Features/CoinDetail/Testing/Testing.swift Removal of an unused test file.
Projects/Features/CoinDetail/Testing/FakeExchangeRateRepository.swift Addition of a fake repository for exchange rates.
Projects/Features/CoinDetail/Project.swift Updating dependencies to include the I18N module.
Projects/Features/CoinDetail/Feature/Sources/Views/TickerChangeInfoView.swift Changing the binding type to the new TickerInfoRO.
Projects/Features/CoinDetail/Feature/Sources/Views/RecentTradeTableView.swift Updating header texts to use dynamic localized values.
Projects/Features/CoinDetail/Feature/Sources/Views/CoinDetailPageView.swift Integrating localized column titles and binding changes in the view.
Projects/Features/CoinDetail/Feature/Sources/Model/TickerInfoRO.swift, OrderbookTableColumnTitleRO.swift, CoinTradeTableColumnTitleRO.swift, ExchangeRateInfo.swift Introducing new render objects to support internationalization and precise price formatting.
Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift Major changes for internationalization, async exchange rate fetching, and updated actions/reduce logic.
Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageBuilder.swift Adding I18NManager dependency to the view model construction.
DI and Domain files Updating dependency injector and use case interfaces to support exchange rate functionality.
Comments suppressed due to low confidence (2)

Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift:441

  • [nitpick] The property name 'priceChagePercentInfo' appears to be misspelled; consider renaming it to 'priceChangePercentInfo' for clarity.
var priceChagePercentInfo: PriceChangePercentRO?

Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift:420

  • [nitpick] Consider caching the DateFormatter instance instead of reinitializing it in 'createCoinTradeRO', as DateFormatter creation can be expensive when the function is called frequently.
let dateFormatter = DateFormatter()

@J0onYEong J0onYEong merged commit 82ecbc2 into main May 13, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants