Fixed complication localization

This commit is contained in:
Dirk Hermanns 2024-01-10 21:40:20 +01:00
parent 47a0f82937
commit b6797efab6
11 changed files with 27 additions and 43 deletions

View File

@ -16,13 +16,16 @@ struct AccessoryCornerGaugeView : View {
var body: some View {
Text("\(entry.sgv)")
Text("\(entry.lastBGValues.first?.value ?? "??")")
.font(.system(size: 20))
.foregroundColor(
Color(entry.sgvColor))
Color(UIColorChanger.getBgColor(entry.lastBGValues.first?.value ?? "999")))
.widgetLabel {
ProgressView(value: (Double(calculateAgeInMinutes(from: entry.time)) ?? 100) / 60)
.tint(Color(UIColorChanger.getTimeLabelColor(entry.time)))
ProgressView(value:
(Double(calculateAgeInMinutes(fromDouble: entry.lastBGValues.first?.timestamp ?? Date.now.timeIntervalSinceNow - 3600)) ?? 60) / 60)
.tint(
Color(UIColorChanger.getTimeLabelColor(
fromDouble: entry.lastBGValues.first?.timestamp ?? Date().timeIntervalSinceNow - 3600)))
}
.widgetAccentable(true)
.unredacted()

View File

@ -15,14 +15,13 @@ struct AccessoryCornerView : View {
@State var entry: NightscoutDataEntry
var body: some View {
Text("\(entry.bgdeltaArrow)")
Text("\(calculateAgeInMinutes(from: entry.time))m")
.font(.system(size: 20))
.foregroundColor(
Color(entry.bgdeltaColor))
.widgetLabel {
Text("\(entry.sgv)" +
"\(entry.bgdeltaString) " +
"\(calculateAgeInMinutes(from: entry.time))m")
"\(entry.bgdeltaString)")
.foregroundColor(
Color(entry.sgvColor))
}

View File

@ -1,4 +1,3 @@
"gpCwrM" = "Konfiguration";
"tVvJ9c" = "Complication Konfiguration";

View File

@ -1,4 +1,3 @@
"gpCwrM" = "Configuration";
"tVvJ9c" = "Complication Configuration";

View File

@ -21,7 +21,7 @@ struct NightguardWidgetsBundle: WidgetBundle {
struct NightguardDefaultWidgets: Widget {
var provider = NightguardTimelineProvider(displayName:
NSLocalizedString("BG Text C", comment: "Text Widget Display Name"))
NSLocalizedString("BG Text", comment: "Text Widget Display Name"))
var body: some WidgetConfiguration {
StaticConfiguration(
@ -31,7 +31,7 @@ struct NightguardDefaultWidgets: Widget {
NightguardEntryView(entry: entry)
}
.configurationDisplayName(
NSLocalizedString("BG Values as Text C", comment: "Widget Configuration Display Name"))
NSLocalizedString("BG Values as Text", comment: "Widget Configuration Display Name"))
.description(provider.displayName)
.supportedFamilies([
.accessoryInline,
@ -45,7 +45,7 @@ struct NightguardDefaultWidgets: Widget {
struct NightguardGaugeWidgets: Widget {
var provider = NightguardTimelineProvider(displayName:
NSLocalizedString("BG Gauge C", comment: "Gauge Widget Display Name"))
NSLocalizedString("BG Gauge", comment: "Gauge Widget Display Name"))
var body: some WidgetConfiguration {
@ -56,7 +56,7 @@ struct NightguardGaugeWidgets: Widget {
NightguardGaugeEntryView(entry: entry)
}
.configurationDisplayName(
NSLocalizedString("BG Values as Gauge c", comment: "Gauge Widget Configuration Display Name"))
NSLocalizedString("BG Values as Gauge", comment: "Gauge Widget Configuration Display Name"))
.description(provider.displayName)
.supportedFamilies([
.accessoryCorner,

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>890</string>
<string>893</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>NSAppTransportSecurity</key>

View File

@ -117,24 +117,6 @@ struct NightguardTimelineProvider: TimelineProvider {
completion(entry)
}
/*let entry = NightscoutDataEntry(
date: Date(),
sgv: "0",
sgvColor: UIColor.blue,
bgdeltaString: "0",
bgdeltaColor: UIColor.blue,
bgdeltaArrow: "-",
bgdelta: 0,
time: 0,
battery: "",
iob: "",
cob: "",
snoozedUntilTimestamp:
0,
lastBGValues: [],
configuration: ConfigurationIntent())
completion(entry)*/
}
private func updateDataWith(_ reducedEntries : [BgEntry], _ data: NightscoutData) -> NightscoutData{

View File

@ -132,6 +132,7 @@
4349823B2534E07200CF0014 /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 434982342534DE4F00CF0014 /* DictionaryExtension.swift */; };
434982412534E07300CF0014 /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 434982342534DE4F00CF0014 /* DictionaryExtension.swift */; };
434982422534E07400CF0014 /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 434982342534DE4F00CF0014 /* DictionaryExtension.swift */; };
43505F812B4F375D00896705 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 28B03A3523F9CD8E000939E6 /* Localizable.strings */; };
4351E6AE1D2ADFBE001E4AE4 /* StatsPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4351E6AD1D2ADFBE001E4AE4 /* StatsPrefsViewController.swift */; };
4351E6B01D2EFA8C001E4AE4 /* StatisticsRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4351E6AF1D2EFA8C001E4AE4 /* StatisticsRepository.swift */; };
4351E6B21D2EFDFE001E4AE4 /* TimeServiceTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4351E6B11D2EFDFE001E4AE4 /* TimeServiceTest.swift */; };
@ -1582,6 +1583,7 @@
buildActionMask = 2147483647;
files = (
43D005D729DC9BFC003BCE92 /* Assets.xcassets in Resources */,
43505F812B4F375D00896705 /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2509,7 +2511,7 @@
CODE_SIGN_ENTITLEMENTS = "nightguard WatchKit App/nightguard.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
INFOPLIST_FILE = "nightguard WatchKit App/Info.plist";
@ -2541,7 +2543,7 @@
CODE_SIGN_ENTITLEMENTS = "nightguard WatchKit App/nightguard.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
INFOPLIST_FILE = "nightguard WatchKit App/Info.plist";
@ -2571,7 +2573,7 @@
CODE_SIGN_ENTITLEMENTS = nightguard/scoutwatch.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
ENABLE_BITCODE = NO;
@ -2603,7 +2605,7 @@
CODE_SIGN_ENTITLEMENTS = nightguard/scoutwatch.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BSAVUVP8PV;
ENABLE_BITCODE = NO;
@ -2726,7 +2728,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEVELOPMENT_TEAM = BSAVUVP8PV;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@ -2768,7 +2770,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEVELOPMENT_TEAM = BSAVUVP8PV;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@ -2807,7 +2809,7 @@
CODE_SIGN_ENTITLEMENTS = "nightguard ComplicationExtension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEVELOPMENT_TEAM = BSAVUVP8PV;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@ -2851,7 +2853,7 @@
CODE_SIGN_ENTITLEMENTS = "nightguard ComplicationExtension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 890;
CURRENT_PROJECT_VERSION = 893;
DEVELOPMENT_TEAM = BSAVUVP8PV;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;

View File

@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>890</string>
<string>893</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>

View File

@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>890</string>
<string>893</string>
</dict>
</plist>

View File

@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>890</string>
<string>893</string>
</dict>
</plist>