From 1f1fef31b6b89a4769020e9f23efc6bf077e6912 Mon Sep 17 00:00:00 2001 From: Navid Date: Thu, 15 Feb 2024 12:28:56 -0500 Subject: [PATCH 1/4] Native mode logs --- .../eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java index d0e607342..74f30b7ce 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java @@ -953,7 +953,7 @@ public static boolean doGetData(Ob1G5CollectionService parent, RxBleConnection c switch (hex) { case "2E01": - UserError.Log.e(TAG, "Invalid settings, attempting to restore defaults"); + UserError.Log.e(TAG, "Invalid settings, attempting to restore Dex defaults, Native mode, no plugin"); setG6Defaults(); break; } @@ -1707,11 +1707,12 @@ public static void evaluateG6Settings() { if (FirmwareCapability.isTransmitterG6(getTransmitterID())) { if (!usingG6()) { setG6Defaults(); - JoH.showNotification("Enabled G6", "G6 Features and default settings automatically enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); + JoH.showNotification("Enabled defaults", "Default settings automatically enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } else if (!onlyUsingNativeMode() && !Home.get_engineering_mode()) { // TODO revisit this now that there is scaling setG6Defaults(); - JoH.showNotification("Enabled G6", "G6 Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); + UserError.Log.e(TAG, "Dex Native mode enabled. For your device, non-native mode is either not possible or not recommended."); + JoH.showNotification("Enabled Native", "Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } } } From 1848db9b56dd031bab9d798e55387a9f1cf543b1 Mon Sep 17 00:00:00 2001 From: Navid Date: Thu, 15 Feb 2024 19:02:56 -0500 Subject: [PATCH 2/4] uel log --- .../com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java index 74f30b7ce..9374069db 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/g5model/Ob1G5StateMachine.java @@ -1711,7 +1711,7 @@ public static void evaluateG6Settings() { } else if (!onlyUsingNativeMode() && !Home.get_engineering_mode()) { // TODO revisit this now that there is scaling setG6Defaults(); - UserError.Log.e(TAG, "Dex Native mode enabled. For your device, non-native mode is either not possible or not recommended."); + UserError.Log.uel(TAG, "Dex Native mode enabled. For your device, non-native mode is either not possible or not recommended."); JoH.showNotification("Enabled Native", "Native mode enabled", null, Constants.G6_DEFAULTS_MESSAGE, false, true, false); } } From 7a4f00a36510fc3ce87c2e15aec6d3a9612b8919 Mon Sep 17 00:00:00 2001 From: olorinmaia Date: Sun, 18 Feb 2024 02:36:36 +0100 Subject: [PATCH 3/4] Increase max text length for AAPS statusline to make sure all languages get all info through to xDrip+ without being cut short. --- .../dexdrip/wearintegration/ExternalStatusService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/wearintegration/ExternalStatusService.java b/app/src/main/java/com/eveningoutpost/dexdrip/wearintegration/ExternalStatusService.java index 3999fb9a9..da06596e8 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/wearintegration/ExternalStatusService.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/wearintegration/ExternalStatusService.java @@ -27,7 +27,7 @@ public class ExternalStatusService extends IntentService { private static final String EXTRA_STATUSLINE = "com.eveningoutpost.dexdrip.Extras.Statusline"; public static final String ACTION_NEW_EXTERNAL_STATUSLINE = "com.eveningoutpost.dexdrip.ExternalStatusline"; //public static final String RECEIVER_PERMISSION = "com.eveningoutpost.dexdrip.permissions.RECEIVE_EXTERNAL_STATUSLINE"; - private static final int MAX_LEN = 40; + private static final int MAX_LEN = 70; private final static String TAG = ExternalStatusService.class.getSimpleName(); public ExternalStatusService() { From 35e90c09aded571d7956e0f09534c52a8ae420ed Mon Sep 17 00:00:00 2001 From: olorinmaia Date: Mon, 19 Feb 2024 00:10:50 +0100 Subject: [PATCH 4/4] Remove duplicate Norwegian language and make legacy settings update moving users from "no" to "nb" --- .../dexdrip/utilitymodels/IdempotentMigrations.java | 9 ++++++++- app/src/main/res/values/locales.xml | 4 +--- .../com/eveningoutpost/dexdrip/ui/TranslationTest.java | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java index 8be3ad481..9344057bc 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/IdempotentMigrations.java @@ -59,6 +59,7 @@ public void performAll() { legacySettingsFix(); IncompatibleApps.notifyAboutIncompatibleApps(); CompatibleApps.notifyAboutCompatibleApps(); + legacySettingsMoveLanguageFromNoToNb(); } @@ -149,5 +150,11 @@ private static void legacySettingsFix() { Pref.setBoolean("always_unbond_G5", false); Pref.setBoolean("always_get_new_keys", true); } - + private static void legacySettingsMoveLanguageFromNoToNb() { + // Check if the user's language preference is set to "no" + if ("no".equals(Pref.getString("forced_language", ""))) { + // Update the language preference to "nb" + Pref.setString("forced_language", "nb"); + } + } } diff --git a/app/src/main/res/values/locales.xml b/app/src/main/res/values/locales.xml index ef1d2e706..79150137c 100644 --- a/app/src/main/res/values/locales.xml +++ b/app/src/main/res/values/locales.xml @@ -1,7 +1,6 @@ - Bokmal български език čeština Deutsch @@ -26,7 +25,6 @@ Українська - nb bg cs de @@ -38,7 +36,7 @@ it hu nl - no + nb pl pt ro diff --git a/app/src/test/java/com/eveningoutpost/dexdrip/ui/TranslationTest.java b/app/src/test/java/com/eveningoutpost/dexdrip/ui/TranslationTest.java index c47827f51..60489a894 100644 --- a/app/src/test/java/com/eveningoutpost/dexdrip/ui/TranslationTest.java +++ b/app/src/test/java/com/eveningoutpost/dexdrip/ui/TranslationTest.java @@ -38,7 +38,7 @@ public class TranslationTest extends RobolectricTestWithConfig { public void testFormatStrings() throws IOException { val config = xdrip.getAppContext().getResources().getConfiguration(); val internal = xdrip.getAppContext().getResources().getStringArray(R.array.LocaleChoicesValues); - val extra = new String[]{"ar", "cs", "de", "el", "en", "es", "fi", "fr", "he", "hr", "it", "iw", "ja", "ko", "nb", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "tr", "zh"}; + val extra = new String[]{"ar", "cs", "de", "el", "en", "es", "fi", "fr", "he", "hr", "it", "iw", "ja", "ko", "nb", "nl", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "tr", "zh"}; val inset = "^values-"; Set locales = new TreeSet<>(Arrays.asList(internal)); class ResourceLocaleParser implements FileVisitor {