Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Health read: fix HealthReadTest window case; iPhone Apple Health prompts in all 18 languages

Duarte Santos6a560ffbd208
diff --git a/docs/MOBILE.md b/docs/MOBILE.md
index 69ca30e0e..7b0f83132 100644
--- a/docs/MOBILE.md
+++ b/docs/MOBILE.md
@@ -253,7 +253,9 @@ default, each independent of writing and of the other:
- **iPhone:** `AppleHealthPlugin.swift` `readHeartRate` / `readWeights` through `HKSampleQuery`;
the plain-value conversion is `WatchCore/Sources/WatchCore/HealthReadCore.swift` (compiled into
the app, tested by `swift test`). Apple Health never says whether reading was allowed, so a
- refusal reads nothing. The usage string (`NSHealthShareUsageDescription`) says what is read.
+ refusal reads nothing. The usage strings (`NSHealthShareUsageDescription`,
+ `NSHealthUpdateUsageDescription`) say what is read and written, in all 18 languages:
+ `ios/App/App/<lang>.lproj/InfoPlist.strings`, written by `ios/ci/watch-strings.mjs`.
- **Synced fields:** `set.hr`, `set.restHr`, `w.hr`, `bodyweight[].src` are plain optional fields;
the server keeps them through every writer (`api/test/sync-hr.test.js`).
- **Emulator check:** Google's Health Connect Toolbox can insert heart-rate and weight records on an
diff --git a/frontend/android/app/src/test/java/ch/duartesantos/opengym/HealthReadTest.java b/frontend/android/app/src/test/java/ch/duartesantos/opengym/HealthReadTest.java
index 19ec62aa5..acad3aef6 100644
--- a/frontend/android/app/src/test/java/ch/duartesantos/opengym/HealthReadTest.java
+++ b/frontend/android/app/src/test/java/ch/duartesantos/opengym/HealthReadTest.java
@@ -31,9 +31,10 @@ public class HealthReadTest {
HeartRateRecord a = hr(10_000, 20_000, new long[][] { { 10_000, 120 }, { 15_000, 130 }, { 20_000, 140 } });
HeartRateRecord b = hr(0, 9_000, new long[][] { { 0, 90 }, { 9_000, 100 } });
List<long[]> out = HealthRead.samples(Arrays.asList(a, b), 5_000, 15_000);
- assertEquals(2, out.size());
+ assertEquals(3, out.size());
assertArrayEquals(new long[] { 9_000, 100 }, out.get(0));
- assertArrayEquals(new long[] { 15_000, 130 }, out.get(1));
+ assertArrayEquals(new long[] { 10_000, 120 }, out.get(1));
+ assertArrayEquals(new long[] { 15_000, 130 }, out.get(2));
}
@Test
diff --git a/frontend/ios/App/App.xcodeproj/project.pbxproj b/frontend/ios/App/App.xcodeproj/project.pbxproj
index 5424fe67f..8034ff94b 100644
--- a/frontend/ios/App/App.xcodeproj/project.pbxproj
+++ b/frontend/ios/App/App.xcodeproj/project.pbxproj
@@ -12,6 +12,7 @@
504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; };
AA0000000000000000000002 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0000000000000000000001 /* SceneDelegate.swift */; };
504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; };
+ AA0900000000000000000002 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA0900000000000000000001 /* InfoPlist.strings */; };
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
@@ -45,6 +46,24 @@
504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+ AA0900000000000000000100 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000101 /* bn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bn; path = bn.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000102 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000103 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000104 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000105 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000106 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000107 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000108 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000109 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000110 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = pt-BR.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000111 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = pt-PT.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000112 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000113 /* th */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = th; path = th.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000114 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000115 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000116 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = zh-Hans.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ AA0900000000000000000117 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = zh-Hant.lproj/InfoPlist.strings; sourceTree = "<group>"; };
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -132,6 +151,7 @@
AA0600000000000000000003 /* HealthReadCore.swift */,
AA0200000000000000000007 /* PrivacyInfo.xcprivacy */,
504EC30B1FED79650016851F /* Main.storyboard */,
+ AA0900000000000000000001 /* InfoPlist.strings */,
504EC30E1FED79650016851F /* Assets.xcassets */,
504EC3101FED79650016851F /* LaunchScreen.storyboard */,
504EC3131FED79650016851F /* Info.plist */,
@@ -195,6 +215,24 @@
knownRegions = (
en,
Base,
+ ar,
+ bn,
+ de,
+ es,
+ fr,
+ hi,
+ hu,
+ it,
+ ko,
+ pl,
+ "pt-BR",
+ "pt-PT",
+ ru,
+ th,
+ tr,
+ uk,
+ "zh-Hans",
+ "zh-Hant",
);
mainGroup = 504EC2FB1FED79650016851F;
packageReferences = (
@@ -218,6 +256,7 @@
504EC30F1FED79650016851F /* Assets.xcassets in Resources */,
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */,
504EC30D1FED79650016851F /* Main.storyboard in Resources */,
+ AA0900000000000000000002 /* InfoPlist.strings in Resources */,
2FAD9763203C412B000D30F8 /* config.xml in Resources */,
AA0200000000000000000008 /* PrivacyInfo.xcprivacy in Resources */,
);
@@ -306,6 +345,31 @@
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
+ AA0900000000000000000001 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ AA0900000000000000000100 /* ar */,
+ AA0900000000000000000101 /* bn */,
+ AA0900000000000000000102 /* de */,
+ AA0900000000000000000103 /* es */,
+ AA0900000000000000000104 /* fr */,
+ AA0900000000000000000105 /* hi */,
+ AA0900000000000000000106 /* hu */,
+ AA0900000000000000000107 /* it */,
+ AA0900000000000000000108 /* ko */,
+ AA0900000000000000000109 /* pl */,
+ AA0900000000000000000110 /* pt-BR */,
+ AA0900000000000000000111 /* pt-PT */,
+ AA0900000000000000000112 /* ru */,
+ AA0900000000000000000113 /* th */,
+ AA0900000000000000000114 /* tr */,
+ AA0900000000000000000115 /* uk */,
+ AA0900000000000000000116 /* zh-Hans */,
+ AA0900000000000000000117 /* zh-Hant */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
diff --git a/frontend/ios/App/App/ar.lproj/InfoPlist.strings b/frontend/ios/App/App/ar.lproj/InfoPlist.strings
new file mode 100644
index 000000000..3d79a1e3d
--- /dev/null
+++ b/frontend/ios/App/App/ar.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, ar: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "يعرض openGym نبضك على Apple Watch أثناء التمرين، وإذا فعّلت ذلك يضيف إلى سجلك النبض الذي حفظته ساعتك وقياسات الوزن من تطبيقات أخرى.";
+"NSHealthUpdateUsageDescription" = "يحفظ openGym تمارينك وقياسات وزنك في Apple صحتي إذا فعّلت ذلك.";
diff --git a/frontend/ios/App/App/bn.lproj/InfoPlist.strings b/frontend/ios/App/App/bn.lproj/InfoPlist.strings
new file mode 100644
index 000000000..ea9187560
--- /dev/null
+++ b/frontend/ios/App/App/bn.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, bn: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym ট্রেনিংয়ের সময় Apple Watch-এ আপনার হার্ট রেট দেখায়, আর চালু করলে আপনার ঘড়ির সেভ করা হার্ট রেট ও অন্য অ্যাপের ওজন আপনার লগে যোগ করে।";
+"NSHealthUpdateUsageDescription" = "চালু করলে openGym আপনার ওয়ার্কআউট আর ওজন Apple Health-এ সেভ করে।";
diff --git a/frontend/ios/App/App/de.lproj/InfoPlist.strings b/frontend/ios/App/App/de.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b24445ea3
--- /dev/null
+++ b/frontend/ios/App/App/de.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, de: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym zeigt deinen Puls auf der Apple Watch beim Training und trägt, wenn du es einschaltest, den Puls deiner Uhr und Wiegungen aus anderen Apps in dein Protokoll ein.";
+"NSHealthUpdateUsageDescription" = "openGym speichert deine Trainings und Wiegungen in Apple Health, wenn du das einschaltest.";
diff --git a/frontend/ios/App/App/es.lproj/InfoPlist.strings b/frontend/ios/App/App/es.lproj/InfoPlist.strings
new file mode 100644
index 000000000..258c1b29c
--- /dev/null
+++ b/frontend/ios/App/App/es.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, es: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym muestra tu pulso en el Apple Watch mientras entrenas y, si lo activas, añade a tu registro el pulso que guardó tu reloj y los pesajes de otras apps.";
+"NSHealthUpdateUsageDescription" = "openGym guarda tus entrenos y pesajes en Apple Salud si lo activas.";
diff --git a/frontend/ios/App/App/fr.lproj/InfoPlist.strings b/frontend/ios/App/App/fr.lproj/InfoPlist.strings
new file mode 100644
index 000000000..7ea82b4b8
--- /dev/null
+++ b/frontend/ios/App/App/fr.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, fr: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym affiche ton pouls sur l’Apple Watch pendant la séance et, si tu l’actives, ajoute à ton journal le pouls enregistré par ta montre et les pesées d’autres apps.";
+"NSHealthUpdateUsageDescription" = "openGym enregistre tes séances et tes pesées dans Apple Santé si tu l’actives.";
diff --git a/frontend/ios/App/App/hi.lproj/InfoPlist.strings b/frontend/ios/App/App/hi.lproj/InfoPlist.strings
new file mode 100644
index 000000000..4de9b8a7e
--- /dev/null
+++ b/frontend/ios/App/App/hi.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, hi: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym ट्रेनिंग के दौरान Apple Watch पर आपकी धड़कन दिखाता है, और चालू करने पर आपकी घड़ी की सहेजी धड़कन और दूसरे ऐप्स का वज़न आपके लॉग में जोड़ता है।";
+"NSHealthUpdateUsageDescription" = "चालू करने पर openGym आपके वर्कआउट और वज़न Apple Health में सहेजता है।";
diff --git a/frontend/ios/App/App/hu.lproj/InfoPlist.strings b/frontend/ios/App/App/hu.lproj/InfoPlist.strings
new file mode 100644
index 000000000..cad9208be
--- /dev/null
+++ b/frontend/ios/App/App/hu.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, hu: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "Az openGym edzés közben mutatja a pulzusodat az Apple Watchon, és ha bekapcsolod, a naplódba írja az órád által mentett pulzust és más appok mérlegeléseit.";
+"NSHealthUpdateUsageDescription" = "Az openGym az Apple Egészség appba menti az edzéseidet és mérlegeléseidet, ha bekapcsolod.";
diff --git a/frontend/ios/App/App/it.lproj/InfoPlist.strings b/frontend/ios/App/App/it.lproj/InfoPlist.strings
new file mode 100644
index 000000000..97e811a7c
--- /dev/null
+++ b/frontend/ios/App/App/it.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, it: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym mostra il tuo battito su Apple Watch mentre ti alleni e, se lo attivi, aggiunge al tuo diario il battito salvato dall’orologio e le pesate di altre app.";
+"NSHealthUpdateUsageDescription" = "openGym salva i tuoi allenamenti e le tue pesate in Apple Salute se lo attivi.";
diff --git a/frontend/ios/App/App/ko.lproj/InfoPlist.strings b/frontend/ios/App/App/ko.lproj/InfoPlist.strings
new file mode 100644
index 000000000..f1c674d94
--- /dev/null
+++ b/frontend/ios/App/App/ko.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, ko: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym은 운동하는 동안 Apple Watch에 심박수를 보여주고, 켜면 워치가 저장한 심박수와 다른 앱의 체중 기록을 내 기록에 더해요.";
+"NSHealthUpdateUsageDescription" = "켜면 openGym이 운동과 체중 기록을 Apple 건강에 저장해요.";
diff --git a/frontend/ios/App/App/pl.lproj/InfoPlist.strings b/frontend/ios/App/App/pl.lproj/InfoPlist.strings
new file mode 100644
index 000000000..1e7da4e57
--- /dev/null
+++ b/frontend/ios/App/App/pl.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, pl: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym pokazuje tętno na Apple Watch podczas treningu, a jeśli to włączysz, dodaje do dziennika tętno zapisane przez zegarek i pomiary wagi z innych aplikacji.";
+"NSHealthUpdateUsageDescription" = "openGym zapisuje treningi i pomiary wagi w Apple Zdrowie, jeśli to włączysz.";
diff --git a/frontend/ios/App/App/pt-BR.lproj/InfoPlist.strings b/frontend/ios/App/App/pt-BR.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8d2a92bee
--- /dev/null
+++ b/frontend/ios/App/App/pt-BR.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, pt-BR: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "O openGym mostra sua frequência cardíaca no Apple Watch enquanto você treina e, se você ativar, adiciona ao seu registro a frequência cardíaca que o relógio salvou e pesagens de outros aplicativos.";
+"NSHealthUpdateUsageDescription" = "O openGym salva seus treinos e pesagens no Apple Saúde se você ativar.";
diff --git a/frontend/ios/App/App/pt-PT.lproj/InfoPlist.strings b/frontend/ios/App/App/pt-PT.lproj/InfoPlist.strings
new file mode 100644
index 000000000..f97bb1dfa
--- /dev/null
+++ b/frontend/ios/App/App/pt-PT.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, pt-PT: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "O openGym mostra a tua frequência cardíaca no Apple Watch enquanto treinas e, se o ativares, junta ao teu registo a frequência cardíaca que o relógio guardou e pesagens de outras apps.";
+"NSHealthUpdateUsageDescription" = "O openGym guarda os teus treinos e pesagens no Apple Saúde se o ativares.";
diff --git a/frontend/ios/App/App/ru.lproj/InfoPlist.strings b/frontend/ios/App/App/ru.lproj/InfoPlist.strings
new file mode 100644
index 000000000..c3d28eb3b
--- /dev/null
+++ b/frontend/ios/App/App/ru.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, ru: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym показывает пульс на Apple Watch во время тренировки, а если вы это включите, добавляет в журнал пульс, сохранённый часами, и взвешивания из других приложений.";
+"NSHealthUpdateUsageDescription" = "openGym сохраняет тренировки и взвешивания в Apple Здоровье, если вы это включите.";
diff --git a/frontend/ios/App/App/th.lproj/InfoPlist.strings b/frontend/ios/App/App/th.lproj/InfoPlist.strings
new file mode 100644
index 000000000..4b1f042cd
--- /dev/null
+++ b/frontend/ios/App/App/th.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, th: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym แสดงอัตราการเต้นของหัวใจบน Apple Watch ระหว่างฝึก และเมื่อคุณเปิดใช้ จะเพิ่มอัตราการเต้นของหัวใจที่นาฬิกาบันทึกไว้และน้ำหนักจากแอปอื่นลงในบันทึกของคุณ";
+"NSHealthUpdateUsageDescription" = "openGym บันทึกการฝึกและน้ำหนักของคุณลงใน Apple Health เมื่อคุณเปิดใช้";
diff --git a/frontend/ios/App/App/tr.lproj/InfoPlist.strings b/frontend/ios/App/App/tr.lproj/InfoPlist.strings
new file mode 100644
index 000000000..9cf96c35e
--- /dev/null
+++ b/frontend/ios/App/App/tr.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, tr: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym antrenman sırasında nabzını Apple Watch’ta gösterir ve açarsan saatinin kaydettiği nabzı ve diğer uygulamalardaki tartılmaları kaydına ekler.";
+"NSHealthUpdateUsageDescription" = "Açarsan openGym antrenmanlarını ve tartılmalarını Apple Sağlık’a kaydeder.";
diff --git a/frontend/ios/App/App/uk.lproj/InfoPlist.strings b/frontend/ios/App/App/uk.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b495ce48b
--- /dev/null
+++ b/frontend/ios/App/App/uk.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, uk: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym показує пульс на Apple Watch під час тренування, а якщо ти це ввімкнеш, додає до журналу пульс, збережений годинником, і зважування з інших застосунків.";
+"NSHealthUpdateUsageDescription" = "openGym зберігає тренування та зважування в Apple Здоров’я, якщо ти це ввімкнеш.";
diff --git a/frontend/ios/App/App/zh-Hans.lproj/InfoPlist.strings b/frontend/ios/App/App/zh-Hans.lproj/InfoPlist.strings
new file mode 100644
index 000000000..7fbe5ba82
--- /dev/null
+++ b/frontend/ios/App/App/zh-Hans.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, zh-Hans: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym 会在训练时于 Apple Watch 上显示你的心率;打开后,还会把手表保存的心率和其他应用的称重加入你的记录。";
+"NSHealthUpdateUsageDescription" = "打开后,openGym 会把训练和称重保存到 Apple 健康。";
diff --git a/frontend/ios/App/App/zh-Hant.lproj/InfoPlist.strings b/frontend/ios/App/App/zh-Hant.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8211ce263
--- /dev/null
+++ b/frontend/ios/App/App/zh-Hant.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* openGym on the iPhone, zh-Hant: Info.plist. Written by ios/ci/watch-strings.mjs. */
+
+"NSHealthShareUsageDescription" = "openGym 會在訓練時於 Apple Watch 上顯示你的心率;開啟後,還會把手錶儲存的心率和其他 App 的體重紀錄加入你的紀錄。";
+"NSHealthUpdateUsageDescription" = "開啟後,openGym 會把訓練和體重紀錄儲存到 Apple 健康。";
diff --git a/frontend/ios/ci/watch-strings.mjs b/frontend/ios/ci/watch-strings.mjs
index 7d5a568c1..009b55e45 100644
--- a/frontend/ios/ci/watch-strings.mjs
+++ b/frontend/ios/ci/watch-strings.mjs
@@ -12,6 +12,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url'
const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..')
const out = join(root, 'ios', 'App', 'Watch')
const widgets = join(root, 'ios', 'App', 'WatchWidgets')
+const phone = join(root, 'ios', 'App', 'App')
// app pack → watch .lproj
const LANGS = {
@@ -184,6 +185,51 @@ const PLIST = {
},
}
+// The iPhone app's Info.plist (its Apple Health prompts, which since v1.4.3 also cover reading the
+// heart rate and weigh-ins back), into ios/App/App/<lang>.lproj/InfoPlist.strings.
+const PHONE_PLIST = {
+ NSHealthShareUsageDescription: {
+ de: 'openGym zeigt deinen Puls auf der Apple Watch beim Training und trägt, wenn du es einschaltest, den Puls deiner Uhr und Wiegungen aus anderen Apps in dein Protokoll ein.',
+ fr: 'openGym affiche ton pouls sur l’Apple Watch pendant la séance et, si tu l’actives, ajoute à ton journal le pouls enregistré par ta montre et les pesées d’autres apps.',
+ es: 'openGym muestra tu pulso en el Apple Watch mientras entrenas y, si lo activas, añade a tu registro el pulso que guardó tu reloj y los pesajes de otras apps.',
+ it: 'openGym mostra il tuo battito su Apple Watch mentre ti alleni e, se lo attivi, aggiunge al tuo diario il battito salvato dall’orologio e le pesate di altre app.',
+ 'pt-PT': 'O openGym mostra a tua frequência cardíaca no Apple Watch enquanto treinas e, se o ativares, junta ao teu registo a frequência cardíaca que o relógio guardou e pesagens de outras apps.',
+ 'pt-BR': 'O openGym mostra sua frequência cardíaca no Apple Watch enquanto você treina e, se você ativar, adiciona ao seu registro a frequência cardíaca que o relógio salvou e pesagens de outros aplicativos.',
+ pl: 'openGym pokazuje tętno na Apple Watch podczas treningu, a jeśli to włączysz, dodaje do dziennika tętno zapisane przez zegarek i pomiary wagi z innych aplikacji.',
+ hu: 'Az openGym edzés közben mutatja a pulzusodat az Apple Watchon, és ha bekapcsolod, a naplódba írja az órád által mentett pulzust és más appok mérlegeléseit.',
+ tr: 'openGym antrenman sırasında nabzını Apple Watch’ta gösterir ve açarsan saatinin kaydettiği nabzı ve diğer uygulamalardaki tartılmaları kaydına ekler.',
+ ru: 'openGym показывает пульс на Apple Watch во время тренировки, а если вы это включите, добавляет в журнал пульс, сохранённый часами, и взвешивания из других приложений.',
+ uk: 'openGym показує пульс на Apple Watch під час тренування, а якщо ти це ввімкнеш, додає до журналу пульс, збережений годинником, і зважування з інших застосунків.',
+ ar: 'يعرض openGym نبضك على Apple Watch أثناء التمرين، وإذا فعّلت ذلك يضيف إلى سجلك النبض الذي حفظته ساعتك وقياسات الوزن من تطبيقات أخرى.',
+ hi: 'openGym ट्रेनिंग के दौरान Apple Watch पर आपकी धड़कन दिखाता है, और चालू करने पर आपकी घड़ी की सहेजी धड़कन और दूसरे ऐप्स का वज़न आपके लॉग में जोड़ता है।',
+ bn: 'openGym ট্রেনিংয়ের সময় Apple Watch-এ আপনার হার্ট রেট দেখায়, আর চালু করলে আপনার ঘড়ির সেভ করা হার্ট রেট ও অন্য অ্যাপের ওজন আপনার লগে যোগ করে।',
+ th: 'openGym แสดงอัตราการเต้นของหัวใจบน Apple Watch ระหว่างฝึก และเมื่อคุณเปิดใช้ จะเพิ่มอัตราการเต้นของหัวใจที่นาฬิกาบันทึกไว้และน้ำหนักจากแอปอื่นลงในบันทึกของคุณ',
+ ko: 'openGym은 운동하는 동안 Apple Watch에 심박수를 보여주고, 켜면 워치가 저장한 심박수와 다른 앱의 체중 기록을 내 기록에 더해요.',
+ 'zh-Hans': 'openGym 会在训练时于 Apple Watch 上显示你的心率;打开后,还会把手表保存的心率和其他应用的称重加入你的记录。',
+ 'zh-Hant': 'openGym 會在訓練時於 Apple Watch 上顯示你的心率;開啟後,還會把手錶儲存的心率和其他 App 的體重紀錄加入你的紀錄。',
+ },
+ NSHealthUpdateUsageDescription: {
+ de: 'openGym speichert deine Trainings und Wiegungen in Apple Health, wenn du das einschaltest.',
+ fr: 'openGym enregistre tes séances et tes pesées dans Apple Santé si tu l’actives.',
+ es: 'openGym guarda tus entrenos y pesajes en Apple Salud si lo activas.',
+ it: 'openGym salva i tuoi allenamenti e le tue pesate in Apple Salute se lo attivi.',
+ 'pt-PT': 'O openGym guarda os teus treinos e pesagens no Apple Saúde se o ativares.',
+ 'pt-BR': 'O openGym salva seus treinos e pesagens no Apple Saúde se você ativar.',
+ pl: 'openGym zapisuje treningi i pomiary wagi w Apple Zdrowie, jeśli to włączysz.',
+ hu: 'Az openGym az Apple Egészség appba menti az edzéseidet és mérlegeléseidet, ha bekapcsolod.',
+ tr: 'Açarsan openGym antrenmanlarını ve tartılmalarını Apple Sağlık’a kaydeder.',
+ ru: 'openGym сохраняет тренировки и взвешивания в Apple Здоровье, если вы это включите.',
+ uk: 'openGym зберігає тренування та зважування в Apple Здоров’я, якщо ти це ввімкнеш.',
+ ar: 'يحفظ openGym تمارينك وقياسات وزنك في Apple صحتي إذا فعّلت ذلك.',
+ hi: 'चालू करने पर openGym आपके वर्कआउट और वज़न Apple Health में सहेजता है।',
+ bn: 'চালু করলে openGym আপনার ওয়ার্কআউট আর ওজন Apple Health-এ সেভ করে।',
+ th: 'openGym บันทึกการฝึกและน้ำหนักของคุณลงใน Apple Health เมื่อคุณเปิดใช้',
+ ko: '켜면 openGym이 운동과 체중 기록을 Apple 건강에 저장해요.',
+ 'zh-Hans': '打开后,openGym 会把训练和称重保存到 Apple 健康。',
+ 'zh-Hant': '開啟後,openGym 會把訓練和體重紀錄儲存到 Apple 健康。',
+ },
+}
+
const esc = s => String(s).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n')
let problems = 0
for (const [pack, lproj] of Object.entries(LANGS)) {
@@ -208,6 +254,13 @@ for (const [pack, lproj] of Object.entries(LANGS)) {
plist.push(`"${k}" = "${esc(tr[lproj])}";`)
}
writeFileSync(join(out, `${lproj}.lproj`, 'InfoPlist.strings'), plist.join('\n') + '\n')
+ const phonePlist = [`/* openGym on the iPhone, ${lproj}: Info.plist. Written by ios/ci/watch-strings.mjs. */`, '']
+ for (const [k, tr] of Object.entries(PHONE_PLIST)) {
+ if (!tr[lproj] || /—/.test(tr[lproj])) { console.error(`${lproj}: iPhone ${k} missing or with an em dash`); problems++; continue }
+ phonePlist.push(`"${k}" = "${esc(tr[lproj])}";`)
+ }
+ mkdirSync(join(phone, `${lproj}.lproj`), { recursive: true })
+ writeFileSync(join(phone, `${lproj}.lproj`, 'InfoPlist.strings'), phonePlist.join('\n') + '\n')
}
// English: every key as itself. Without an en.lproj a watch set to another language could show
// that language's words to an app in English.