Localize alerts and favourites copy

This commit is contained in:
FuelBoard Contributor
2026-10-01 15:25:08 +01:00
parent 824923b2ac
commit 13d84eb32d
3 changed files with 55 additions and 39 deletions
+8 -8
View File
@@ -106,9 +106,9 @@ struct FavouritesView: View {
Image(systemName: "star")
.font(.system(size: 40))
.foregroundStyle(.secondary)
Text("No favourites yet")
Text(String(localized: "No favourites yet", comment: "Favourites empty-state title"))
.font(.headline)
Text("Tap the star on any station in the Stations tab to pin it here. The first station in each list becomes the favourite used in single widgets — drag to put your pick first.")
Text(String(localized: "Tap the star on any station in the Stations tab to pin it here. The first station in each list becomes the favourite used in single widgets — drag to put your pick first.", comment: "Favourites empty-state explanation"))
.font(.caption)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
@@ -117,7 +117,7 @@ struct FavouritesView: View {
.padding(.vertical, 24)
}
} else {
Section("Fuel type") {
Section(String(localized: "Fuel type", comment: "Fuel type section title")) {
FuelTypeSegmentedPicker(
selection: $fuel,
fuels: availableFuels
@@ -142,21 +142,21 @@ struct FavouritesView: View {
}
.onMove(perform: moveFavourite)
} header: {
Text("\(activeFuel.displayName) favourites")
Text(String(format: String(localized: "%@ favourites", comment: "Favourites section title for fuel type"), activeFuel.displayName))
} footer: {
Text("The first station is the favourite used in single widgets. Tap Edit, then drag to reorder.")
Text(String(localized: "The first station is the favourite used in single widgets. Tap Edit, then drag to reorder.", comment: "Favourites reorder explanation"))
}
if let cheapest = cheapest {
Section {
Text("\(cheapest.name) is your cheapest \(activeFuel.displayName) favourite. Favourites are monitored automatically — switch to the Alerts tab and enable alerts to get pinged when you approach one that's the cheapest within the radius.")
Text(String(format: String(localized: "%@ is your cheapest %@ favourite. Favourites are monitored automatically — switch to the Alerts tab and enable alerts to get pinged when you approach one that's the cheapest within the radius.", comment: "Cheapest favourite explanation"), cheapest.name, activeFuel.displayName))
.font(.caption)
.foregroundStyle(.secondary)
}
}
}
}
.navigationTitle("Favourites")
.navigationTitle(String(localized: "Favourites", comment: "Favourites tab title"))
.toolbar {
if !favourites.isEmpty {
ToolbarItemGroup(placement: .topBarTrailing) {
@@ -164,7 +164,7 @@ struct FavouritesView: View {
showTrends = true
} label: {
Image(systemName: "chart.xyaxis.line")
.accessibilityLabel("Trends")
.accessibilityLabel(String(localized: "Trends", comment: "Trends button accessibility label"))
}
EditButton()
}