localize main app

This commit is contained in:
Trey t
2022-01-23 10:28:38 -06:00
parent 8648a8f834
commit 8ece03abce
12 changed files with 132 additions and 40 deletions

View File

@@ -53,9 +53,9 @@ struct AddMoodHeaderView: View {
switch savedOnboardingData.inputDay {
case .Today:
return "How is today?"
return String(localized: "add_mood_header_view_title_today")
case .Previous:
return "How was yesterday?"
return String(localized: "add_mood_header_view_title_yesterday")
}
}

View File

@@ -26,17 +26,17 @@ struct ContentView: View {
TabView {
mainView
.tabItem {
Label("Main", systemImage: "list.dash")
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
}
FilterView()
.tabItem {
Label("Filter", systemImage: "calendar.circle")
Label(String(localized: "content_view_tab_filter"), systemImage: "calendar.circle")
}
GraphView()
.tabItem {
Label("Stats", systemImage: "chart.line.uptrend.xyaxis")
Label(String(localized: "content_view_tab_stats"), systemImage: "chart.line.uptrend.xyaxis")
}
}.sheet(isPresented: $needsOnboarding, onDismiss: {

View File

@@ -51,7 +51,7 @@ struct FilterView: View {
.cornerRadius(25)
.padding([.leading, .trailing])
Text("Total: \(self.viewModel.numberOfRatings)")
Text(String(localized: "filter_view_total") + ": \(self.viewModel.numberOfRatings)")
.font(.title2)
if showFilter {
@@ -71,7 +71,7 @@ struct FilterView: View {
showFilter.toggle()
}
}, label: {
Text(showFilter ? "Close Filters" : "Show Filters")
Text(showFilter ? String(localized: "filter_view_hide_filters") : String(localized: "filter_view_show_filters"))
.frame(maxWidth: .infinity)
.frame(height: 44)
.foregroundColor(Color(UIColor.label))
@@ -117,7 +117,7 @@ struct FilterView: View {
ZStack {
Color(UIColor.secondarySystemBackground)
DatePicker(
"Start Date",
String(localized: "filter_view_begin_date"),
selection: $viewModel.entryStartDate,
displayedComponents: [.date]
).onChange(of: viewModel.entryStartDate, perform: { value in
@@ -132,7 +132,7 @@ struct FilterView: View {
ZStack {
Color(UIColor.secondarySystemBackground)
DatePicker(
"End Date",
String(localized: "filter_view_end_date"),
selection: $viewModel.entryEndDate,
displayedComponents: [.date]
).onChange(of: viewModel.entryStartDate, perform: { value in

View File

@@ -46,7 +46,7 @@ struct SettingsView: View {
Button(action: {
dismiss()
}, label: {
Text("Exit")
Text(String(localized: "settings_view_exit"))
.font(.body)
.foregroundColor(Color(UIColor.systemBlue))
})
@@ -60,7 +60,7 @@ struct SettingsView: View {
Button(action: {
}, label: {
Text("Special thanks to")
Text(String(localized: "settings_view_special_thanks_to"))
})
.padding()
}
@@ -102,7 +102,7 @@ struct SettingsView: View {
private var whyBackgroundMode: some View {
ZStack {
Color(UIColor.systemBackground)
Text("we do bg mode b/c we can")
Text(String(localized: "settings_view_why_bg_mode"))
.padding()
}
.fixedSize(horizontal: false, vertical: true)
@@ -118,7 +118,7 @@ struct SettingsView: View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Text("Change Icon")
Text(String(localized: "settings_view_change_icon"))
HStack {
Button(action: {
@@ -157,7 +157,7 @@ struct SettingsView: View {
Button(action: {
showOnboarding.toggle()
}, label: {
Text("Show Onboarding")
Text(String(localized: "settings_view_show_onboarding"))
})
.padding()
}