Skip to content

Commit 5d81ea9

Browse files
committed
Further localization
1 parent 92afc37 commit 5d81ea9

33 files changed

+425
-66
lines changed

OneKDay.xcodeproj/project.pbxproj

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/* Begin PBXBuildFile section */
1010
3E0016A9292485CF0050C817 /* OneKDayUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E0016A8292485CF0050C817 /* OneKDayUITests.swift */; };
11-
3E0016AB292485CF0050C817 /* OneKDayUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E0016AA292485CF0050C817 /* OneKDayUITestsLaunchTests.swift */; };
1211
3E0016B2292486C40050C817 /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E0016B1292486C40050C817 /* SnapshotHelper.swift */; };
1312
3E21D0DD291E1996000298CB /* AppIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E21D0DC291E1996000298CB /* AppIcon.swift */; };
1413
3E21D0E0291E30B1000298CB /* ChangeIconViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E21D0DF291E30B1000298CB /* ChangeIconViewModel.swift */; };
@@ -74,7 +73,6 @@
7473
/* Begin PBXFileReference section */
7574
3E0016A6292485CF0050C817 /* OneKDayUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OneKDayUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7675
3E0016A8292485CF0050C817 /* OneKDayUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OneKDayUITests.swift; sourceTree = "<group>"; };
77-
3E0016AA292485CF0050C817 /* OneKDayUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OneKDayUITestsLaunchTests.swift; sourceTree = "<group>"; };
7876
3E0016B1292486C40050C817 /* SnapshotHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnapshotHelper.swift; sourceTree = "<group>"; };
7977
3E21D0DC291E1996000298CB /* AppIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIcon.swift; sourceTree = "<group>"; };
8078
3E21D0DF291E30B1000298CB /* ChangeIconViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeIconViewModel.swift; sourceTree = "<group>"; };
@@ -99,6 +97,10 @@
9997
3E6B9FDB291C8D43000A8808 /* WidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WidgetExtension.entitlements; sourceTree = "<group>"; };
10098
3E9D1A19292BFAA500594281 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
10199
3E9D1A1B292BFAF000594281 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
100+
3E9D1A1C292C1F9300594281 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
101+
3E9D1A1D292C1F9900594281 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
102+
3E9D1A1E292C1F9D00594281 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
103+
3E9D1A1F292C24D200594281 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
102104
3EABCC6B291C92BB00EB680B /* WidgetBaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetBaseView.swift; sourceTree = "<group>"; };
103105
3EABCC72291C94BD00EB680B /* SmallWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmallWidget.swift; sourceTree = "<group>"; };
104106
3EABCC74291C94C800EB680B /* FullWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullWidget.swift; sourceTree = "<group>"; };
@@ -138,7 +140,6 @@
138140
children = (
139141
3E0016B1292486C40050C817 /* SnapshotHelper.swift */,
140142
3E0016A8292485CF0050C817 /* OneKDayUITests.swift */,
141-
3E0016AA292485CF0050C817 /* OneKDayUITestsLaunchTests.swift */,
142143
);
143144
path = OneKDayUITests;
144145
sourceTree = "<group>";
@@ -337,6 +338,10 @@
337338
en,
338339
Base,
339340
es,
341+
fr,
342+
it,
343+
de,
344+
nl,
340345
);
341346
mainGroup = 3E45C5F9291B5B100002B1C5;
342347
productRefGroup = 3E45C603291B5B100002B1C5 /* Products */;
@@ -383,7 +388,6 @@
383388
isa = PBXSourcesBuildPhase;
384389
buildActionMask = 2147483647;
385390
files = (
386-
3E0016AB292485CF0050C817 /* OneKDayUITestsLaunchTests.swift in Sources */,
387391
3E0016A9292485CF0050C817 /* OneKDayUITests.swift in Sources */,
388392
3E0016B2292486C40050C817 /* SnapshotHelper.swift in Sources */,
389393
);
@@ -445,6 +449,10 @@
445449
children = (
446450
3E9D1A19292BFAA500594281 /* en */,
447451
3E9D1A1B292BFAF000594281 /* es */,
452+
3E9D1A1C292C1F9300594281 /* fr */,
453+
3E9D1A1D292C1F9900594281 /* it */,
454+
3E9D1A1E292C1F9D00594281 /* de */,
455+
3E9D1A1F292C24D200594281 /* nl */,
448456
);
449457
name = Localizable.strings;
450458
sourceTree = "<group>";
@@ -501,7 +509,7 @@
501509
isa = XCBuildConfiguration;
502510
buildSettings = {
503511
ALWAYS_SEARCH_USER_PATHS = NO;
504-
BUILD_NUMBER = 8;
512+
BUILD_NUMBER = 10;
505513
BUILD_VERSION = 1.1.0;
506514
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
507515
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
@@ -569,7 +577,7 @@
569577
isa = XCBuildConfiguration;
570578
buildSettings = {
571579
ALWAYS_SEARCH_USER_PATHS = NO;
572-
BUILD_NUMBER = 8;
580+
BUILD_NUMBER = 10;
573581
BUILD_VERSION = 1.1.0;
574582
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
575583
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;

OneKDay/Views/ContentView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ struct ContentView: View {
5656
getUnitSuffix(
5757
for: preferredUnit(
5858
for: metricID
59-
)
59+
),
60+
with: $0.metric
6061
)?.capitalized(with: Locale.current) ??
6162
NSLocalizedString(
6263
"unknown-measurement-unit",

OneKDayUITests/OneKDayUITests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import XCTest
99

10-
class WhatsNextUITests: XCTestCase {
10+
class OneKDayUITests: XCTestCase {
1111

1212
override func setUpWithError() throws {
1313
super.setUp()
@@ -27,8 +27,6 @@ class WhatsNextUITests: XCTestCase {
2727
UserDefaults.standard.set(lang, forKey: "app_lang")
2828

2929
snapshot("1Main")
30-
31-
XCTAssertGreaterThan(app.cells.count, 0)
3230
}
3331
// swiftlint:enable function_body_length
3432

OneKDayUITests/OneKDayUITestsLaunchTests.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

Shared/HealthData/HealthKitSupport+Strings.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func formattedValue(_ value: Double, typeIdentifier: HKQuantityTypeIdentifier) -
1818
guard
1919
let unit = preferredUnit(for: typeIdentifier),
2020
let roundedValue = getRoundedValue(for: value, with: unit),
21-
let unitSuffix = getUnitSuffix(for: unit)
21+
let unitSuffix = getUnitSuffix(for: unit, with: value)
2222
else {
2323
return nil
2424
}
@@ -48,7 +48,6 @@ private func getRoundedValue(for value: Double, with unit: HKUnit) -> String? {
4848
}
4949

5050
// MARK: - Units
51-
5251
func preferredUnit(for identifier: HKQuantityTypeIdentifier) -> HKUnit? {
5352
switch identifier {
5453
case .stepCount:
@@ -60,17 +59,23 @@ func preferredUnit(for identifier: HKQuantityTypeIdentifier) -> HKUnit? {
6059
}
6160
}
6261

63-
func getUnitSuffix(for unit: HKUnit?) -> String? {
62+
func getUnitSuffix(for unit: HKUnit?, with count: Double) -> String? {
6463
if unit == nil {
6564
return nil
6665
}
6766
switch unit! {
6867
case .count():
69-
return NSLocalizedString("steps-unit-of-measure", comment: "UOM for steps")
68+
return count == 1
69+
? NSLocalizedString("steps-unit-of-measure", comment: "UOM for steps")
70+
: NSLocalizedString("steps-unit-of-measure-plural", comment: "UOM for steps (plural)")
7071
case .mile():
71-
return NSLocalizedString("miles-unit-of-measure", comment: "UOM for miles")
72+
return count >= 1 && count < 2
73+
? NSLocalizedString("miles-unit-of-measure", comment: "UOM for miles")
74+
: NSLocalizedString("miles-unit-of-measure-plural", comment: "UOM for miles (plural)")
7275
case .meter():
73-
return NSLocalizedString("meters-unit-of-measure", comment: "UOM for meters")
76+
return count >= 1 && count < 2
77+
? NSLocalizedString("meters-unit-of-measure", comment: "UOM for meters")
78+
: NSLocalizedString("meters-unit-of-measure-plural", comment: "UOM for meters (plural)")
7479
default:
7580
return nil
7681
}

Shared/de.lproj/Localizable.strings

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Localizable.strings
3+
* OneKDay
4+
*
5+
* Created by Hundter Biede on 11/21/22.
6+
*/
7+
8+
// MARK: Main Screen
9+
/* Button to enable health data access */
10+
"enable-health-button-text" = "Aktivieren Sie den Zugriff auf Gesundheitsdaten";
11+
/* Text to prevent iPads from erroring */
12+
"ipad-warning" = "Diese App unterstützt kein iPad. Bitte von einem iPhone installieren";
13+
/* Warning text for lack of health data access */
14+
"no-access-text" = "Aktivieren Sie den Zugriff auf Gesundheitsdaten, um OneK Day zu verwenden"; // Note, Do not translate "OneK Day"
15+
16+
17+
// MARK: Content View
18+
/* A11y label for the goal line */
19+
"goal-a11y-label" = "Tor";
20+
/* Text for when the app does not have access to health data */
21+
"no-health-access" = "Aktivieren Sie den Zugriff auf Gesundheitsdaten";
22+
/* Subtitle explaining the metric count achieved this hour (e.g., '1234 steps this hour') */
23+
"this-hour-subtitle" = "%@ in dieser Stunde";
24+
/* The lael for the time axis of the graph */
25+
"time-value-label" = "Zeit";
26+
/* Default measurement unit if the real one is unknown */
27+
"unknown-measurement-unit" = "Messung";
28+
29+
// MARK: Settings View
30+
/* App Icon setting title */
31+
"app-icon-setting-title" = "App-Symbol";
32+
/* Label for the back button */
33+
"back-button-label" = "Zurück";
34+
/* The header for the settings modal */
35+
"settings-modal-title" = "Einstellungen";
36+
/* Setting title for the goal step count per hour */
37+
"step-goal-setting-title" = "Schrittziel pro Stunde";
38+
39+
// MARK: Units
40+
/* UOM for steps */
41+
"steps-unit-of-measure" = "schritt";
42+
"steps-unit-of-measure-plural" = "schritte";
43+
/* UOM for miles */
44+
"miles-unit-of-measure" = "meile";
45+
"miles-unit-of-measure-plural" = "meilen";
46+
/* UOM for meters */
47+
"meters-unit-of-measure" = "meter";
48+
"meters-unit-of-measure-plural" = "meter";
49+
50+
// MARK: Widget
51+
/* The description for the widget as viewed from the widget add screen */
52+
"widget-desc" = "Holen Sie sich Ihre Schritte für die Stunde";

Shared/en.lproj/Localizable.strings

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,14 @@
3838

3939
// MARK: Units
4040
/* UOM for steps */
41-
"steps-unit-of-measure" = "steps";
41+
"steps-unit-of-measure" = "step";
42+
"steps-unit-of-measure-plural" = "steps";
4243
/* UOM for miles */
4344
"miles-unit-of-measure" = "mi";
45+
"miles-unit-of-measure-plural" = "mi";
4446
/* UOM for meters */
4547
"meters-unit-of-measure" = "m";
48+
"meters-unit-of-measure-plural" = "m";
4649

4750
// MARK: Widget
4851
/* The description for the widget as viewed from the widget add screen */

Shared/es.lproj/Localizable.strings

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,14 @@
3838

3939
// MARK: Units
4040
/* UOM for steps */
41-
"steps-unit-of-measure" = "pasos";
41+
"steps-unit-of-measure" = "paso";
42+
"steps-unit-of-measure-plural" = "pasos";
4243
/* UOM for miles */
4344
"miles-unit-of-measure" = "mi";
45+
"miles-unit-of-measure-plural" = "mi";
4446
/* UOM for meters */
4547
"meters-unit-of-measure" = "m";
48+
"meters-unit-of-measure-plural" = "m";
4649

4750
// MARK: Widget
4851
/* The description for the widget as viewed from the widget add screen */

Shared/fr.lproj/Localizable.strings

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Localizable.strings
3+
* OneKDay
4+
*
5+
* Created by Hundter Biede on 11/21/22.
6+
*/
7+
8+
// MARK: Main Screen
9+
/* Button to enable health data access */
10+
"enable-health-button-text" = "Activer L'Accès aux Données de Santé";
11+
/* Text to prevent iPads from erroring */
12+
"ipad-warning" = "Cette application ne prend pas en charge l'iPad. Veuillez installer à partir d'un iPhone";
13+
/* Warning text for lack of health data access */
14+
"no-access-text" = "Activer l'accès aux données de santé pour utiliser OneK Day"; // Note, Do not translate "OneK Day"
15+
16+
17+
// MARK: Content View
18+
/* A11y label for the goal line */
19+
"goal-a11y-label" = "Objectif";
20+
/* Text for when the app does not have access to health data */
21+
"no-health-access" = "Activer l'accès aux données de Santé";
22+
/* Subtitle explaining the metric count achieved this hour (e.g., '1234 steps this hour') */
23+
"this-hour-subtitle" = "%@ cette heure";
24+
/* The lael for the time axis of the graph */
25+
"time-value-label" = "Temps";
26+
/* Default measurement unit if the real one is unknown */
27+
"unknown-measurement-unit" = "La Mesure";
28+
29+
// MARK: Settings View
30+
/* App Icon setting title */
31+
"app-icon-setting-title" = "Icône de L'Application";
32+
/* Label for the back button */
33+
"back-button-label" = "Retour";
34+
/* The header for the settings modal */
35+
"settings-modal-title" = "Réglages";
36+
/* Setting title for the goal step count per hour */
37+
"step-goal-setting-title" = "Objectif de Pas par Heure";
38+
39+
// MARK: Units
40+
/* UOM for steps */
41+
"steps-unit-of-measure" = "pas";
42+
"steps-unit-of-measure-plural" = "pas";
43+
/* UOM for miles */
44+
"miles-unit-of-measure" = "mi";
45+
"miles-unit-of-measure-plural" = "mi";
46+
/* UOM for meters */
47+
"meters-unit-of-measure" = "m";
48+
"meters-unit-of-measure-plural" = "m";
49+
50+
// MARK: Widget
51+
/* The description for the widget as viewed from the widget add screen */
52+
"widget-desc" = "Faites vos pas pour l'heure";

Shared/it.lproj/Localizable.strings

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Localizable.strings
3+
* OneKDay
4+
*
5+
* Created by Hundter Biede on 11/21/22.
6+
*/
7+
8+
// MARK: Main Screen
9+
/* Button to enable health data access */
10+
"enable-health-button-text" = "Abilita L'Accesso ai Dati dalla Salute";
11+
/* Text to prevent iPads from erroring */
12+
"ipad-warning" = "Questa app non supporta iPad. Si prega di installare da un iPhone";
13+
/* Warning text for lack of health data access */
14+
"no-access-text" = "Abilita l'accesso ai dati da Health per utilizzare OneK Day"; // Note, Do not translate "OneK Day"
15+
16+
17+
// MARK: Content View
18+
/* A11y label for the goal line */
19+
"goal-a11y-label" = "Obiettivo";
20+
/* Text for when the app does not have access to health data */
21+
"no-health-access" = "Abilita l'accesso ai dati dalla Salute";
22+
/* Subtitle explaining the metric count achieved this hour (e.g., '1234 steps this hour') */
23+
"this-hour-subtitle" = "%@ quest'ora";
24+
/* The lael for the time axis of the graph */
25+
"time-value-label" = "Volta";
26+
/* Default measurement unit if the real one is unknown */
27+
"unknown-measurement-unit" = "Misurazione";
28+
29+
// MARK: Settings View
30+
/* App Icon setting title */
31+
"app-icon-setting-title" = "Icona dell'app";
32+
/* Label for the back button */
33+
"back-button-label" = "Indietro";
34+
/* The header for the settings modal */
35+
"settings-modal-title" = "Impostazioni";
36+
/* Setting title for the goal step count per hour */
37+
"step-goal-setting-title" = "Obiettivo di passi all'ora";
38+
39+
// MARK: Units
40+
/* UOM for steps */
41+
"steps-unit-of-measure" = "passo";
42+
"steps-unit-of-measure-plural" = "passi";
43+
/* UOM for miles */
44+
"miles-unit-of-measure" = "mi";
45+
"miles-unit-of-measure-plural" = "mi";
46+
/* UOM for meters */
47+
"meters-unit-of-measure" = "m";
48+
"meters-unit-of-measure-plural" = "m";
49+
50+
// MARK: Widget
51+
/* The description for the widget as viewed from the widget add screen */
52+
"widget-desc" = "Fai i tuoi passi per un'ora";

0 commit comments

Comments
 (0)