From a05de6e64a9952ac2a19340e7f4e0d69c18a882a Mon Sep 17 00:00:00 2001 From: Priyonto M Rahman Date: Mon, 24 Jul 2023 17:19:36 +0200 Subject: [PATCH 1/2] fix: Support offline alert #1564 --- .../Common/RuuviCloudAlert.swift | 1 + .../RuuviServiceAlertImpl.swift | 3 ++ station.localization | 2 +- station.xcodeproj/project.pbxproj | 40 +++++++++---------- station/Resources/Plists/Info.plist | 2 +- .../Strings/de.lproj/Localizable.strings | 29 +++++++++----- .../Strings/en.lproj/Localizable.strings | 11 ++++- .../Strings/fi.lproj/Localizable.strings | 33 +++++++++------ .../Strings/fr.lproj/Localizable.strings | 33 +++++++++------ .../Strings/ru.lproj/Localizable.strings | 11 ++++- .../Strings/sv.lproj/Localizable.strings | 33 +++++++++------ 11 files changed, 122 insertions(+), 76 deletions(-) diff --git a/Packages/RuuviOntology/Sources/RuuviOntology/Common/RuuviCloudAlert.swift b/Packages/RuuviOntology/Sources/RuuviOntology/Common/RuuviCloudAlert.swift index 62a404759..8af68fe40 100644 --- a/Packages/RuuviOntology/Sources/RuuviOntology/Common/RuuviCloudAlert.swift +++ b/Packages/RuuviOntology/Sources/RuuviOntology/Common/RuuviCloudAlert.swift @@ -6,6 +6,7 @@ public enum RuuviCloudAlertType: String, Codable { case pressure case signal case movement + case offline } public enum RuuviCloudAlertSettingType: String { diff --git a/Packages/RuuviService/Sources/RuuviServiceAlert/RuuviServiceAlertImpl.swift b/Packages/RuuviService/Sources/RuuviServiceAlert/RuuviServiceAlertImpl.swift index 69d19ef8a..a17179540 100644 --- a/Packages/RuuviService/Sources/RuuviServiceAlert/RuuviServiceAlertImpl.swift +++ b/Packages/RuuviService/Sources/RuuviServiceAlert/RuuviServiceAlertImpl.swift @@ -403,6 +403,9 @@ public final class RuuviServiceAlertImpl: RuuviServiceAlert { type = .signal(lower: cloudAlert.min, upper: cloudAlert.max) setSignal(description: cloudAlert.description, for: physicalSensor) + case .offline: + // Not supported on app yet. + break } if let type = type { if cloudAlert.enabled { diff --git a/station.localization b/station.localization index b960f2fd1..64b677de8 160000 --- a/station.localization +++ b/station.localization @@ -1 +1 @@ -Subproject commit b960f2fd1d1dad5f24e996f4d17dc6ea46daa26c +Subproject commit 64b677de87a06f19ed661abd0fa5550741dc955a diff --git a/station.xcodeproj/project.pbxproj b/station.xcodeproj/project.pbxproj index f873325a5..957ee0042 100644 --- a/station.xcodeproj/project.pbxproj +++ b/station.xcodeproj/project.pbxproj @@ -6363,7 +6363,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6373,7 +6373,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -D DEVELOPMENT"; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6395,7 +6395,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6405,7 +6405,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS"; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6427,7 +6427,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6440,7 +6440,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.widgets; @@ -6464,7 +6464,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6477,7 +6477,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.widgets; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6499,7 +6499,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6512,7 +6512,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.intents; @@ -6535,7 +6535,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6548,7 +6548,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.intents; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6687,7 +6687,7 @@ CODE_SIGN_ENTITLEMENTS = station/station.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6729,7 +6729,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS"; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6749,7 +6749,7 @@ CODE_SIGN_ENTITLEMENTS = station/station.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; INFOPLIST_FILE = "$(SRCROOT)/station/Resources/Plists/Info.plist"; @@ -6758,7 +6758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS"; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -6863,7 +6863,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6876,7 +6876,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.pnservice; @@ -6898,7 +6898,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 386; + CURRENT_PROJECT_VERSION = 389; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6911,7 +6911,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.ruuvi.station.pnservice; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/station/Resources/Plists/Info.plist b/station/Resources/Plists/Info.plist index eb71fcd36..86b512fc6 100644 --- a/station/Resources/Plists/Info.plist +++ b/station/Resources/Plists/Info.plist @@ -24,7 +24,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 384 + 389 FirebaseMessagingAutoInitEnabled LSApplicationQueriesSchemes diff --git a/station/Resources/Strings/de.lproj/Localizable.strings b/station/Resources/Strings/de.lproj/Localizable.strings index 518037240..f3f1260e5 100644 --- a/station/Resources/Strings/de.lproj/Localizable.strings +++ b/station/Resources/Strings/de.lproj/Localizable.strings @@ -703,16 +703,23 @@ Wenn die Beanspruchung nicht erfolgreich war oder NFC auf Ihrem Gerät nicht ver "Defaults.HideNFC.title" = "Verstecken Sie die NFC-Option vor einem erzwungenen Eigentümerwechsel"; "settings_alert_sound_default" = "Systemfehler"; "settings_alert_sound_ruuvi_speak" = "Ruuvi Alarm"; -"add_with_nfc" = "Add with NFC"; -"sensor_details" = "Sensor Details"; -"add_sensor" = "Add Sensor"; -"copy_details" = "Copy Details"; +"add_with_nfc" = "Mit NFC hinzufügen"; +"sensor_details" = "Sensordetails"; +"add_sensor" = "Sensor hinzufügen"; +"copy_details" = "Details kopieren"; "name" = "Name:"; -"mac_address" = "Mac Address:"; -"unique_id" = "Unique ID:"; +"mac_address" = "MAC-Adresse:"; +"go_to_sensor" = "Gehen Sie zur Sensorkarte"; +"unique_id" = "Eindeutige ID:"; "firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; -"unclaim_sensor" = "Unclaim sensor"; -"unclaim" = "Unclaim"; -"unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"Close" = "Schließen"; +"add_sensor_nfc_df3_error" = "Dieser Sensor kann aufgrund der alten Firmware nicht mit NFC hinzugefügt werden. Bitte fügen Sie den Sensor über Bluetooth hinzu und aktualisieren Sie die Firmware."; +"add_sensor_description" = "Auf dieser Seite werden Ruuvi-Sensoren in der Nähe angezeigt, die der App noch nicht hinzugefügt wurden. Tippen Sie auf einen Sensor, um ihn hinzuzufügen."; +"add_sensor_via_nfc" = "Alternatively, you can add a sensor using NFC by selecting Add with NFC and touching it with your phone."; +"unclaim_sensor" = "Anspruch auf Eigentum zurückziehen"; +"unclaim" = "Anspruch aufheben"; +"unclaim_sensor_description" = "Das Eigentum an diesem Sensor wurde Ihrem Ruuvi-Konto zugeordnet. Klicken Sie auf „Anspruch aufheben“, um die Einstellungen dieses Sensors und die zugehörigen Daten aus Ihrem Ruuvi-Konto zu entfernen."; +"claim_sensor_ownership" = "Beanspruchen Sie den Besitz des Sensors"; +"do_you_own_sensor" = "Besitzen Sie diesen Sensor?"; +"owners_plan" = "Ruuvi-Plan des Eigentümers"; +"rename" = "Rename"; diff --git a/station/Resources/Strings/en.lproj/Localizable.strings b/station/Resources/Strings/en.lproj/Localizable.strings index fe3a935ca..153523ebf 100644 --- a/station/Resources/Strings/en.lproj/Localizable.strings +++ b/station/Resources/Strings/en.lproj/Localizable.strings @@ -704,10 +704,17 @@ Your RuuviTag sensor is ready for use!"; "copy_details" = "Copy Details"; "name" = "Name:"; "mac_address" = "Mac Address:"; +"go_to_sensor" = "Go to sensor card"; "unique_id" = "Unique ID:"; "firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; +"Close" = "Close"; +"add_sensor_nfc_df3_error" = "This sensor cannot be added with NFC due to old firmware. Please add the sensor with Bluetooth and update firmware."; +"add_sensor_description" = "This page shows nearby Ruuvi sensors not yet added to the app. Tap a sensor to add it."; +"add_sensor_via_nfc" = "Alternatively, you can add a sensor using NFC by selecting Add with NFC and touching it with your phone."; "unclaim_sensor" = "Unclaim sensor"; "unclaim" = "Unclaim"; "unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"claim_sensor_ownership" = "Claim sensor ownership"; +"do_you_own_sensor" = "Do you own this sensor?"; +"owners_plan" = "Owner's Ruuvi Plan"; +"rename" = "Rename"; diff --git a/station/Resources/Strings/fi.lproj/Localizable.strings b/station/Resources/Strings/fi.lproj/Localizable.strings index 30bf3bab9..9b904985e 100644 --- a/station/Resources/Strings/fi.lproj/Localizable.strings +++ b/station/Resources/Strings/fi.lproj/Localizable.strings @@ -698,16 +698,23 @@ RuuviTag on valmis käyttöön!"; "Defaults.HideNFC.title" = "Piilota NFC-vaihtoehto pakotetusta omistajuudenvaihdosta"; "settings_alert_sound_default" = "Järjestelmän oletus"; "settings_alert_sound_ruuvi_speak" = "Ruuvi hälytys"; -"add_with_nfc" = "Add with NFC"; -"sensor_details" = "Sensor Details"; -"add_sensor" = "Add Sensor"; -"copy_details" = "Copy Details"; -"name" = "Name:"; -"mac_address" = "Mac Address:"; -"unique_id" = "Unique ID:"; -"firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; -"unclaim_sensor" = "Unclaim sensor"; -"unclaim" = "Unclaim"; -"unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"add_with_nfc" = "Lisää NFC:llä"; +"sensor_details" = "Anturin tiedot"; +"add_sensor" = "Lisää anturi"; +"copy_details" = "Kopioi tiedot"; +"name" = "Nimi:"; +"mac_address" = "MAC-osoite:"; +"go_to_sensor" = "Siirry anturikortille"; +"unique_id" = "Yksilöivä tunniste:"; +"firmware_version" = "Laiteohjelmistoversio:"; +"Close" = "Sulje"; +"add_sensor_nfc_df3_error" = "Vanha laiteohjelmisto ei salli anturin lisäämistä NFC:llä. Lisää anturi Bluetooth-yhteydellä ja päivitä laiteohjelmisto."; +"add_sensor_description" = "Tällä sivulla näet lähelläsi olevat Ruuvi-anturit, joita ei ole vielä lisätty sovellukseen. Lisää listattu anturi napauttamalla."; +"add_sensor_via_nfc" = "Voit vaihtoehtoisesti lisätä anturin sovellukseen NFC:llä napauttamalla Lisää NFC:llä painiketta ja koskettamalla sitä."; +"unclaim_sensor" = "Poista omistajuus"; +"unclaim" = "Poista omistajuus"; +"unclaim_sensor_description" = "Tämän anturin omistajuus on merkitty Ruuvi-tilillesi. Poista anturin asetukset ja anturin tiedot Ruuvi-tililtä valitsemalla Poista omistajuus."; +"claim_sensor_ownership" = "Vaadi anturin omistajuutta"; +"do_you_own_sensor" = "Omistatko tämän anturin?"; +"owners_plan" = "Omistajan Ruuvi-tilaus"; +"rename" = "Rename"; diff --git a/station/Resources/Strings/fr.lproj/Localizable.strings b/station/Resources/Strings/fr.lproj/Localizable.strings index 67a15fc02..ae38dd723 100644 --- a/station/Resources/Strings/fr.lproj/Localizable.strings +++ b/station/Resources/Strings/fr.lproj/Localizable.strings @@ -699,17 +699,24 @@ RuuviTag est prêt à être utilisé !"; "Defaults.HideNFC.title" = "Masquer l'option NFC du changement de propriété forcé"; "settings_alert_sound_default" = "Défaillance du système"; "settings_alert_sound_ruuvi_speak" = "Ruuvi alarme"; -"add_with_nfc" = "Add with NFC"; -"sensor_details" = "Sensor Details"; -"add_sensor" = "Add Sensor"; -"copy_details" = "Copy Details"; -"name" = "Name:"; -"mac_address" = "Mac Address:"; -"unique_id" = "Unique ID:"; -"firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; -"unclaim_sensor" = "Unclaim sensor"; -"unclaim" = "Unclaim"; -"unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"add_with_nfc" = "Ajouter avec NFC"; +"sensor_details" = "Détails du capteur"; +"add_sensor" = "Ajouter un capteur"; +"copy_details" = "Copier les détails"; +"name" = "Nom:"; +"mac_address" = "Adresse Mac:"; +"go_to_sensor" = "Aller à la carte du capteur"; +"unique_id" = "Identifiant unique:"; +"firmware_version" = "Version du firmware:"; +"Close" = "Fermer"; +"add_sensor_nfc_df3_error" = "Ce capteur ne peut pas être ajouté avec NFC en raison d'un ancien firmware. Veuillez ajouter le capteur avec Bluetooth et mettre à jour le firmware."; +"add_sensor_description" = "Cette page montre les capteurs Ruuvi à proximité qui n'ont pas encore été ajoutés à l'application. Appuyez sur un capteur pour l'ajouter."; +"add_sensor_via_nfc" = "Alternatively, you can add a sensor using NFC by selecting Add with NFC and touching it with your phone."; +"unclaim_sensor" = "Annuler la revendication du capteur"; +"unclaim" = "Annuler la réclamation"; +"unclaim_sensor_description" = "La propriété de ce capteur a été revendiquée sur votre compte Ruuvi. Appuyez sur Annuler la revendication pour supprimer les paramètres de ce capteur et les données associées de votre compte Ruuvi."; +"claim_sensor_ownership" = "Revendiquer la propriété du capteur"; +"do_you_own_sensor" = "Possédez-vous ce capteur ?"; +"owners_plan" = "Plan Ruuvi du propriétaire"; +"rename" = "Rename"; diff --git a/station/Resources/Strings/ru.lproj/Localizable.strings b/station/Resources/Strings/ru.lproj/Localizable.strings index 8257c478c..af73b3505 100644 --- a/station/Resources/Strings/ru.lproj/Localizable.strings +++ b/station/Resources/Strings/ru.lproj/Localizable.strings @@ -704,10 +704,17 @@ If you cannot see the Language option in the settings, make sure that you have a "copy_details" = "Copy Details"; "name" = "Name:"; "mac_address" = "Mac Address:"; +"go_to_sensor" = "Go to sensor card"; "unique_id" = "Unique ID:"; "firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; +"Close" = "Закрыть"; +"add_sensor_nfc_df3_error" = "This sensor cannot be added with NFC due to old firmware. Please add the sensor with Bluetooth and update firmware."; +"add_sensor_description" = "Здесь показаны датчики Ruuvi, которые еще не были добавлены в приложение. Нажмите на сенсор, чтобы добавить его."; +"add_sensor_via_nfc" = "Alternatively, you can add a sensor using NFC by selecting Add with NFC and touching it with your phone."; "unclaim_sensor" = "Unclaim sensor"; "unclaim" = "Unclaim"; "unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"claim_sensor_ownership" = "Заявить о собственности на датчик"; +"do_you_own_sensor" = "Это ваш датчик?"; +"owners_plan" = "Owner's Ruuvi Plan"; +"rename" = "Rename"; diff --git a/station/Resources/Strings/sv.lproj/Localizable.strings b/station/Resources/Strings/sv.lproj/Localizable.strings index a5c28093d..f557038f3 100644 --- a/station/Resources/Strings/sv.lproj/Localizable.strings +++ b/station/Resources/Strings/sv.lproj/Localizable.strings @@ -698,16 +698,23 @@ RuuviTag-sensorn är redo att användas!"; "Defaults.HideNFC.title" = "Dölj NFC-alternativet från påtvingat ägarbyte"; "settings_alert_sound_default" = "Systemfel"; "settings_alert_sound_ruuvi_speak" = "Ruuvi larm"; -"add_with_nfc" = "Add with NFC"; -"sensor_details" = "Sensor Details"; -"add_sensor" = "Add Sensor"; -"copy_details" = "Copy Details"; -"name" = "Name:"; -"mac_address" = "Mac Address:"; -"unique_id" = "Unique ID:"; -"firmware_version" = "Firmware Version:"; -"close" = "Close"; -"add_sensor_nfc_df3_error" = "This tag cannot be added with NFC due to old firmware. Please add the tag with Bluetooth and update firmware."; -"unclaim_sensor" = "Unclaim sensor"; -"unclaim" = "Unclaim"; -"unclaim_sensor_description" = "Ownership of this sensor has been claimed to your Ruuvi account. Press Unclaim to remove this sensor's settings and related data from your Ruuvi account."; +"add_with_nfc" = "Lägg till med NFC"; +"sensor_details" = "Sensordetaljer"; +"add_sensor" = "Lägg till sensor"; +"copy_details" = "Kopiera detaljer"; +"name" = "Namn:"; +"mac_address" = "MAC-adress:"; +"go_to_sensor" = "Gå till sensorkortet"; +"unique_id" = "Unikt ID:"; +"firmware_version" = "Firmwareversion:"; +"Close" = "Stäng"; +"add_sensor_nfc_df3_error" = "Denna sensor kan inte läggas till med NFC på grund av gammal firmware. Lägg till sensorn med Bluetooth och uppdatera firmware."; +"add_sensor_description" = "Den här sidan visar närliggande Ruuvi-sensorer som ännu inte har lagts till i appen. Tryck på en sensor för att lägga till den."; +"add_sensor_via_nfc" = "Alternatively, you can add a sensor using NFC by selecting Add with NFC and touching it with your phone."; +"unclaim_sensor" = "Ta bort äganderätten"; +"unclaim" = "Ta bort anspråk"; +"unclaim_sensor_description" = "Äganderätten till denna sensor har gjorts anspråk på ditt Ruuvi-konto. Tryck på Unclaim för att ta bort sensorns inställningar och relaterade data från ditt Ruuvi-konto."; +"claim_sensor_ownership" = "Gör anspråk på sensorägande"; +"do_you_own_sensor" = "Äger du denna sensor?"; +"owners_plan" = "Ägarens Ruuvi-plan"; +"rename" = "Rename"; From 911565a95c74cd6e95e5e7e66e2de65ed2c10901 Mon Sep 17 00:00:00 2001 From: Priyonto M Rahman Date: Tue, 25 Jul 2023 19:58:49 +0200 Subject: [PATCH 2/2] fix: Remove unit symbol for push [for now] #1544 --- pnservice/NotificationService.swift | 43 +++++++++++++++++------------ station.xcodeproj/project.pbxproj | 20 +++++++------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/pnservice/NotificationService.swift b/pnservice/NotificationService.swift index 7c9b36d35..19b4270f0 100644 --- a/pnservice/NotificationService.swift +++ b/pnservice/NotificationService.swift @@ -9,6 +9,7 @@ class NotificationService: UNNotificationServiceExtension { case pressure = "pressure" case signal = "signal" case movement = "movement" + case offline = "offline" } private enum TriggerType: String { @@ -41,20 +42,25 @@ class NotificationService: UNNotificationServiceExtension { if let contentHandler = contentHandler, let userInfo = currentRequest?.content.userInfo, - let sensorName = userInfo["name"] as? String, - let alertType = userInfo["alertType"] as? String, - let triggerType = userInfo["triggerType"] as? String, - let threshold = userInfo["thresholdValue"] as? String, - let alertUnit = userInfo["alertUnit"] as? String, - let alertMessage = userInfo["alertData"] as? String, - let bestAttemptContent = bestAttemptContent { - let title = titleForAlert(from: triggerType, - alertType: alertType, - threshold: threshold, - alertUnit: alertUnit) - bestAttemptContent.title = title - bestAttemptContent.subtitle = alertMessage - bestAttemptContent.body = sensorName + let bestAttemptContent = bestAttemptContent { + // If this value is not available on data, show formatted message. + // Otherwise don't do anything. + let showLocallyFormattedMessage = userInfo["showLocallyFormatted"] as? Bool ?? true + if showLocallyFormattedMessage { + if let sensorName = userInfo["name"] as? String, + let alertType = userInfo["alertType"] as? String, + let triggerType = userInfo["triggerType"] as? String, + let threshold = userInfo["thresholdValue"] as? String, + let alertMessage = userInfo["alertData"] as? String { + let title = titleForAlert(from: triggerType, + alertType: alertType, + threshold: threshold) + bestAttemptContent.subtitle = alertMessage + bestAttemptContent.title = title + bestAttemptContent.body = sensorName + } + } + contentHandler(bestAttemptContent) } } @@ -92,8 +98,7 @@ extension NotificationService { // swiftlint:disable:next cyclomatic_complexity private func titleForAlert(from triggerType: String, alertType: String, - threshold: String, - alertUnit: String) -> String { + threshold: String) -> String { guard let triggerType = getTriggerType(from: triggerType), let alertType = getAlertType(from: alertType) else { return "" @@ -114,6 +119,8 @@ extension NotificationService { case .movement: let format = "LocalNotificationsManager.DidMove.title" return localized(value: format) + default: + break } case .over: switch alertType { @@ -128,10 +135,12 @@ extension NotificationService { case .movement: let format = "LocalNotificationsManager.DidMove.title" return localized(value: format) + default: + break } } - return String(format: localized(value: format), threshold) + alertUnit + return String(format: localized(value: format), threshold) } private func localized(value: String) -> String { diff --git a/station.xcodeproj/project.pbxproj b/station.xcodeproj/project.pbxproj index 957ee0042..d2d0f36fc 100644 --- a/station.xcodeproj/project.pbxproj +++ b/station.xcodeproj/project.pbxproj @@ -6363,7 +6363,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6395,7 +6395,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6427,7 +6427,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6464,7 +6464,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6499,7 +6499,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6535,7 +6535,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6687,7 +6687,7 @@ CODE_SIGN_ENTITLEMENTS = station/station.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; @@ -6749,7 +6749,7 @@ CODE_SIGN_ENTITLEMENTS = station/station.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = 4MUYJ4YYH4; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; INFOPLIST_FILE = "$(SRCROOT)/station/Resources/Plists/Info.plist"; @@ -6863,7 +6863,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES; @@ -6898,7 +6898,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 389; + CURRENT_PROJECT_VERSION = 391; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4; GENERATE_INFOPLIST_FILE = YES;