Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Feb 20, 2024
2 parents 50463f4 + 8e6d88c commit d52fc70
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.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);
}
}
}
Expand Down
Expand Up @@ -59,6 +59,7 @@ public void performAll() {
legacySettingsFix();
IncompatibleApps.notifyAboutIncompatibleApps();
CompatibleApps.notifyAboutCompatibleApps();
legacySettingsMoveLanguageFromNoToNb();

}

Expand Down Expand Up @@ -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");
}
}
}
Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/values/locales.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="LocaleChoices">
<item>Bokmal</item>
<item>български език</item>
<item>čeština</item>
<item>Deutsch</item>
Expand All @@ -26,7 +25,6 @@
<item>Українська</item>
</string-array>
<string-array name="LocaleChoicesValues">
<item>nb</item>
<item>bg</item>
<item>cs</item>
<item>de</item>
Expand All @@ -38,7 +36,7 @@
<item>it</item>
<item>hu</item>
<item>nl</item>
<item>no</item>
<item>nb</item>
<item>pl</item>
<item>pt</item>
<item>ro</item>
Expand Down
Expand Up @@ -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<String> locales = new TreeSet<>(Arrays.asList(internal));
class ResourceLocaleParser implements FileVisitor<Path> {
Expand Down

0 comments on commit d52fc70

Please sign in to comment.