diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java index f590c6a4c..2fda8ca7a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/amazfitbip/AmazfitBipSupport.java @@ -31,6 +31,7 @@ import java.util.Locale; import java.util.SimpleTimeZone; import java.util.UUID; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiFWHelper; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiWeatherConditions; import nodomain.freeyourgadget.gadgetbridge.devices.huami.amazfitbip.AmazfitBipFWHelper; @@ -229,15 +230,28 @@ public class AmazfitBipSupport extends MiBand2Support { LOG.info("Setting watch language, phone language = " + language + " country = " + country); byte[] command; - if (language.equals("zh")) { - if (country.equals("TW") || country.equals("HK") || country.equals("MO")) { // Taiwan, Hong Kong, Macao - command = AmazfitBipService.COMMAND_SET_LANGUAGE_TRADITIONAL_CHINESE; - } else { + switch (GBApplication.getPrefs().getInt("amazfitbip_language", -1)) { + case 0: command = AmazfitBipService.COMMAND_SET_LANGUAGE_SIMPLIFIED_CHINESE; - } - } else { - command = AmazfitBipService.COMMAND_SET_LANGUAGE_ENGLISH; + break; + case 1: + command = AmazfitBipService.COMMAND_SET_LANGUAGE_TRADITIONAL_CHINESE; + break; + case 2: + command = AmazfitBipService.COMMAND_SET_LANGUAGE_ENGLISH; + break; + default: + if (language.equals("zh")) { + if (country.equals("TW") || country.equals("HK") || country.equals("MO")) { // Taiwan, Hong Kong, Macao + command = AmazfitBipService.COMMAND_SET_LANGUAGE_TRADITIONAL_CHINESE; + } else { + command = AmazfitBipService.COMMAND_SET_LANGUAGE_SIMPLIFIED_CHINESE; + } + } else { + command = AmazfitBipService.COMMAND_SET_LANGUAGE_ENGLISH; + } } + builder.write(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION), command); return this; } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index f6583a398..f3b5ce6c5 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -202,4 +202,18 @@ @string/p_call_privacy_mode_complete + + @string/automatic + @string/simplified_chinese + @string/traditional_chinese + @string/english + + + + -1 + 0 + 1 + 2 + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9e4126dbe..f8ec29953 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -226,6 +226,7 @@ No MAC address passed, cannot pair. Device specific settings Mi Band / Amazfit settings + Amazfit Bip settings Male Female Other @@ -386,6 +387,12 @@ Disable the inactivity warnings for a time interval Start time End time + + Automatic + Simplified Chinese + Traditional Chinese + English + About to transfer data since %1$s Waiting for reconnect diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index d27e22388..b0d543b75 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -178,6 +178,17 @@ android:icon="@drawable/ic_device_miband" android:key="pref_key_miband" android:title="@string/preferences_miband_settings" /> + + +