Skip to content

Commit

Permalink
Update labeling of market periods
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed May 28, 2024
1 parent 35bf15c commit 6510487
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ extension MarketEtfViewModel {

var title: String {
switch self {
case let .period(timePeriod): return timePeriod.title
case let .period(timePeriod): return "market.time_period.\(timePeriod.rawValue)".localized
case .all: return "market.etf.period.all".localized
}
}

var shortTitle: String {
switch self {
case let .period(timePeriod): return timePeriod.shortTitle
case let .period(timePeriod): return "market.time_period.\(timePeriod.rawValue).short".localized
case .all: return "market.etf.period.all".localized
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ extension MarketModule {

var title: String {
switch self {
case .day: return "market.advanced_search.day".localized
case .week: return "market.advanced_search.week".localized
case .week2: return "market.advanced_search.week2".localized
case .month: return "market.advanced_search.month".localized
case .month6: return "market.advanced_search.month6".localized
case .year: return "market.advanced_search.year".localized
case .day: return "market.time_period.24h".localized
case .week: return "market.time_period.1w".localized
case .week2: return "market.time_period.2w".localized
case .month: return "market.time_period.1m".localized
case .month6: return "market.time_period.6m".localized
case .year: return "market.time_period.1y".localized
}
}

Expand Down Expand Up @@ -533,21 +533,33 @@ extension MarketModule { // ViewModel Items

extension HsTimePeriod {
var title: String {
"market.time_period.\(rawValue)".localized
switch self {
case .day1: return "market.time_period.24h".localized
default: return "market.time_period.\(rawValue)".localized
}
}

var shortTitle: String {
"market.time_period.\(rawValue).short".localized
switch self {
case .day1: return "market.time_period.24h.short".localized
default: return "market.time_period.\(rawValue).short".localized
}
}
}

extension WatchlistTimePeriod {
var title: String {
"market.time_period.\(rawValue)".localized
switch self {
case .day1: return "market.time_period.24h".localized
default: return "market.time_period.\(rawValue)".localized
}
}

var shortTitle: String {
"market.time_period.\(rawValue).short".localized
switch self {
case .day1: return "market.time_period.24h.short".localized
default: return "market.time_period.\(rawValue).short".localized
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@
"market.top_coins" = "Top %@";

"market.time_period.title" = "Period";
"market.time_period.24h" = "24 Hours";
"market.time_period.1d" = "1 Day";
"market.time_period.1w" = "1 Week";
"market.time_period.2w" = "2 Weeks";
Expand All @@ -733,7 +734,8 @@
"market.time_period.1y" = "1 Year";
"market.time_period.2y" = "2 Years";
"market.time_period.5y" = "5 Years";
"market.time_period.1d.short" = "24H";
"market.time_period.24h.short" = "24H";
"market.time_period.1d.short" = "1D";
"market.time_period.1w.short" = "1W";
"market.time_period.2w.short" = "2W";
"market.time_period.1m.short" = "1M";
Expand Down

0 comments on commit 6510487

Please sign in to comment.