Skip to content

Feature/favorite foods translation #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LoopKitUI/CarbKit/AbsorptionTimePickerRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct AbsorptionTimePickerRow: View {
public var body: some View {
VStack(alignment: .leading, spacing: 0) {
HStack {
Text("Absorption Time")
Text(LocalizedString("Absorption Time", comment: "Label Absorption Time in CarbKit"))
.foregroundColor(.primary)

if showHowAbsorptionTimeWorks != nil {
Expand Down
10 changes: 3 additions & 7 deletions LoopKitUI/CarbKit/CarbQuantityRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public struct CarbQuantityRow: View {
private let formatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.maximumIntegerDigits = 3
formatter.maximumFractionDigits = 1
return formatter
}()
Expand Down Expand Up @@ -76,13 +77,8 @@ public struct CarbQuantityRow: View {

// Update quantity based on text field input
private func updateQuantity(with input: String) {
let filtered = input.filter { "0123456789.".contains($0) }
if filtered != input {
self.carbInput = filtered
}

if let doubleValue = Double(filtered) {
quantity = doubleValue
if let number = formatter.number(from: input) {
quantity = number.doubleValue
} else {
quantity = nil
}
Expand Down
2 changes: 1 addition & 1 deletion LoopKitUI/CarbKit/DatePickerRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public struct DatePickerRow: View {
public var body: some View {
VStack(alignment: .leading, spacing: 0) {
HStack {
Text("Time")
Text(LocalizedString("Time", comment: "Label Time in CarbKit"))
.foregroundColor(.primary)

Spacer()
Expand Down
2 changes: 1 addition & 1 deletion LoopKitUI/CarbKit/FoodTypeRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct FoodTypeRow: View {
public var body: some View {
HStack {
Text("Food Type")
.foregroundColor(.primary)
.foregroundColor(.primary)

Spacer()

Expand Down
3 changes: 2 additions & 1 deletion LoopKitUI/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@
Information about workout range relative to correction range */
"This will typically be" = "Ist in der Regel ";

/* Label for offset from midnight picker */
/* Label for offset from midnight picker
Label Time in CarbKit */
"Time" = "Zeit";

/* The schedule table view header describing the configured time zone difference from the default time zone. The substitution parameters are: (1: time zone name)(2: +/-)(3: time interval) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ public final class OverrideSelectionViewController: UICollectionViewController,
return originalIndexPath
}

return proposedIndexPath == indexPathOfCustomOverride()
let customPresetRow = self.collectionView(collectionView, numberOfItemsInSection: proposedIndexPath.section) - 2
return proposedIndexPath.row >= customPresetRow
? originalIndexPath
: proposedIndexPath

Expand Down
4 changes: 2 additions & 2 deletions LoopKitUI/Views/CheckmarkListItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public struct CheckmarkListItem: View {
.foregroundColor(.accentColor)
} else {
Circle()
.stroke()
.foregroundColor(Color(.systemGray4))
.stroke(lineWidth: 2)
.foregroundColor(Color(.systemGray))
}
}

Expand Down