From 8b3b4d088256d4adbaab69882639b55fb95a3248 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Fri, 1 May 2015 01:26:12 +0200 Subject: [PATCH] #46 make all strings localizable --- app/src/main/AndroidManifest.xml | 1 + .../BluetoothCommunicationService.java | 8 +-- .../gadgetbridge/ControlCenter.java | 10 ++-- .../gadgetbridge/DebugActivity.java | 12 ++-- .../freeyourgadget/gadgetbridge/GB.java | 3 +- .../freeyourgadget/gadgetbridge/GBDevice.java | 17 +++--- .../adapter/GBDeviceAppAdapter.java | 12 ++-- .../gadgetbridge/miband/BatteryInfo.java | 14 +++-- .../gadgetbridge/miband/DeviceInfo.java | 5 +- .../pebble/PebbleAppInstallerActivity.java | 16 +++--- .../gadgetbridge/pebble/PebbleIoThread.java | 57 ++++++++++--------- .../protocol/GBDeviceCommandVersionInfo.java | 7 ++- app/src/main/res/values/strings.xml | 29 ++++++++++ 13 files changed, 115 insertions(+), 76 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cd263dad..8de6802b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java index 46608aea..f8fdf4aa 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/BluetoothCommunicationService.java @@ -123,9 +123,9 @@ public class BluetoothCommunicationService extends Service { //Check the system status mBtAdapter = BluetoothAdapter.getDefaultAdapter(); if (mBtAdapter == null) { - Toast.makeText(this, "Bluetooth is not supported.", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.bluetooth_is_not_supported_, Toast.LENGTH_SHORT).show(); } else if (!mBtAdapter.isEnabled()) { - Toast.makeText(this, "Bluetooth is disabled.", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.bluetooth_is_disabled_, Toast.LENGTH_SHORT).show(); } else { String btDeviceAddress = intent.getStringExtra("device_address"); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); @@ -153,7 +153,7 @@ public class BluetoothCommunicationService extends Service { } } } catch (Exception e) { - Toast.makeText(this, "Cannot connect. BT address invalid?", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.cannot_connect_bt_address_invalid_, Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } @@ -206,7 +206,7 @@ public class BluetoothCommunicationService extends Service { ((PebbleIoThread) mGBDeviceIoThread).installApp(Uri.parse(uriString)); } } else if (action.equals(ACTION_START)) { - startForeground(GB.NOTIFICATION_ID, GB.createNotification("Gadgetbridge running", this)); + startForeground(GB.NOTIFICATION_ID, GB.createNotification(getString(R.string.gadgetbridge_running), this)); mStarted = true; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java index 1033bc14..fe524901 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java @@ -18,11 +18,9 @@ import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; - import java.util.ArrayList; import java.util.List; import java.util.Set; - import nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapter; public class ControlCenter extends Activity { @@ -176,9 +174,9 @@ public class ControlCenter extends Activity { BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter == null) { - Toast.makeText(this, "Bluetooth is not supported.", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.bluetooth_is_not_supported_, Toast.LENGTH_SHORT).show(); } else if (!btAdapter.isEnabled()) { - Toast.makeText(this, "Bluetooth is disabled.", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.bluetooth_is_disabled_, Toast.LENGTH_SHORT).show(); } else { Set pairedDevices = btAdapter.getBondedDevices(); for (BluetoothDevice pairedDevice : pairedDevices) { @@ -212,9 +210,9 @@ public class ControlCenter extends Activity { } if (connected) { - hintTextView.setText("tap connected device for App Mananger"); + hintTextView.setText(R.string.tap_connected_device_for_app_mananger); } else if (!deviceList.isEmpty()) { - hintTextView.setText("tap a device to connect"); + hintTextView.setText(R.string.tap_a_device_to_connect); } } mGBDeviceAdapter.notifyDataSetChanged(); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java index 057e35e0..72683402 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/DebugActivity.java @@ -51,7 +51,7 @@ public class DebugActivity extends Activity { public void onClick(View v) { Intent startIntent = new Intent(DebugActivity.this, BluetoothCommunicationService.class); startIntent.setAction(BluetoothCommunicationService.ACTION_NOTIFICATION_GENERIC); - startIntent.putExtra("notification_title", "Gadgetbridge"); + startIntent.putExtra("notification_title", R.string.gadgetbridge); startIntent.putExtra("notification_body", editContent.getText().toString()); startService(startIntent); } @@ -62,8 +62,8 @@ public class DebugActivity extends Activity { public void onClick(View v) { Intent startIntent = new Intent(DebugActivity.this, BluetoothCommunicationService.class); startIntent.setAction(BluetoothCommunicationService.ACTION_NOTIFICATION_EMAIL); - startIntent.putExtra("notification_sender", "Gadgetbridge"); - startIntent.putExtra("notification_subject", "Test"); + startIntent.putExtra("notification_sender", R.string.gadgetbridge); + startIntent.putExtra("notification_subject", R.string.test); startIntent.putExtra("notification_body", editContent.getText().toString()); startService(startIntent); } @@ -148,9 +148,9 @@ public class DebugActivity extends Activity { private void testNotification() { NotificationManager nManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); NotificationCompat.Builder ncomp = new NotificationCompat.Builder(this); - ncomp.setContentTitle("Test Notification"); - ncomp.setContentText("This is a Test Notification from Gadgetbridge"); - ncomp.setTicker("This is a Test Notification from Gadgetbridge"); + ncomp.setContentTitle(getString(R.string.test_notification)); + ncomp.setContentText(getString(R.string.this_is_a_test_notification_from_gadgetbridge)); + ncomp.setTicker(getString(R.string.this_is_a_test_notification_from_gadgetbridge)); ncomp.setSmallIcon(R.drawable.ic_notification); ncomp.setAutoCancel(true); nManager.notify((int) System.currentTimeMillis(), ncomp.build()); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GB.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GB.java index fa7a71b4..884371ee 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GB.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GB.java @@ -9,7 +9,6 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.support.v4.app.NotificationCompat; import android.util.Log; - import nodomain.freeyourgadget.gadgetbridge.externalevents.K9Receiver; import nodomain.freeyourgadget.gadgetbridge.externalevents.MusicPlaybackReceiver; import nodomain.freeyourgadget.gadgetbridge.externalevents.PhoneCallReceiver; @@ -27,7 +26,7 @@ public class GB { notificationIntent, 0); return new NotificationCompat.Builder(context) - .setContentTitle("Gadgetbridge") + .setContentTitle(context.getString(R.string.gadgetbridge)) .setTicker(text) .setContentText(text) .setSmallIcon(R.drawable.ic_notification) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBDevice.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBDevice.java index 08e47575..3c450226 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBDevice.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBDevice.java @@ -115,24 +115,23 @@ public class GBDevice implements Parcelable { String getStateString() { switch (mState) { case NOT_CONNECTED: - return "not connected"; // TODO: do not hardcode + return GBApplication.getContext().getString(R.string.not_connected); case CONNECTING: - return "connecting"; + return GBApplication.getContext().getString(R.string.connecting); case CONNECTED: - return "connected"; + return GBApplication.getContext().getString(R.string.connected); case INITIALIZED: - return "initialized"; + return GBApplication.getContext().getString(R.string.initialized); } - return "unknown state"; + return GBApplication.getContext().getString(R.string.unknown_state); } public String getInfoString() { - //FIXME: ugly if (mFirmwareVersion != null) { if (mHardwareVersion != null) { - return getStateString() + " (HW: " + mHardwareVersion + " FW: " + mFirmwareVersion + ")"; + return GBApplication.getContext().getString(R.string.connectionstate_hw_fw, getStateString(), mHardwareVersion, mFirmwareVersion); } - return getStateString() + " (FW: " + mFirmwareVersion + ")"; + return GBApplication.getContext().getString(R.string.connectionstate_fw, getStateString(), mFirmwareVersion); } else { return getStateString(); } @@ -194,7 +193,7 @@ public class GBDevice implements Parcelable { * Returns a string representation of the battery state. */ public String getBatteryState() { - return mBatteryState != null ? mBatteryState : "(unknown)"; + return mBatteryState != null ? mBatteryState : GBApplication.getContext().getString(R.string._unknown_); } public void setBatteryState(String batteryState) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAppAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAppAdapter.java index 0a52b44d..eafdf016 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAppAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAppAdapter.java @@ -1,5 +1,10 @@ package nodomain.freeyourgadget.gadgetbridge.adapter; +import nodomain.freeyourgadget.gadgetbridge.GBDeviceApp; +import nodomain.freeyourgadget.gadgetbridge.R; + +import java.util.List; + import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -8,11 +13,6 @@ import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; -import java.util.List; - -import nodomain.freeyourgadget.gadgetbridge.GBDeviceApp; -import nodomain.freeyourgadget.gadgetbridge.R; - public class GBDeviceAppAdapter extends ArrayAdapter { private final Context context; @@ -39,7 +39,7 @@ public class GBDeviceAppAdapter extends ArrayAdapter { TextView deviceNameLabel = (TextView) view.findViewById(R.id.device_name); ImageView deviceImageView = (ImageView) view.findViewById(R.id.device_image); - deviceStatusLabel.setText(deviceApp.getVersion() + " by " + deviceApp.getCreator()); + deviceStatusLabel.setText(getContext().getString(R.string.appversion_by_creator, deviceApp.getVersion(), deviceApp.getCreator())); deviceNameLabel.setText(deviceApp.getName()); switch (deviceApp.getType()) { case APP_ACTIVITYTRACKER: diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/BatteryInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/BatteryInfo.java index 065debfe..422340b9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/BatteryInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/BatteryInfo.java @@ -1,5 +1,8 @@ package nodomain.freeyourgadget.gadgetbridge.miband; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; + public class BatteryInfo extends AbstractInfo { public BatteryInfo(byte[] data) { super(data); @@ -12,21 +15,20 @@ public class BatteryInfo extends AbstractInfo { return 50; // actually unknown } - // TODO: localization public String getStatus() { if (mData.length >= 10) { int value = mData[9]; switch (value) { case 1: - return "low"; + return GBApplication.getContext().getString(R.string.battery_low); case 2: - return "medium"; + return GBApplication.getContext().getString(R.string.battery_medium); case 3: - return "full"; + return GBApplication.getContext().getString(R.string.battery_full); case 4: - return "not charging"; + return GBApplication.getContext().getString(R.string.battery_not_charging); } } - return "(unknown)"; + return GBApplication.getContext().getString(R.string._unknown_); } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/DeviceInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/DeviceInfo.java index d3f552eb..c0a8eee8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/DeviceInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/DeviceInfo.java @@ -1,5 +1,8 @@ package nodomain.freeyourgadget.gadgetbridge.miband; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; + import java.util.Locale; public class DeviceInfo extends AbstractInfo { @@ -12,6 +15,6 @@ public class DeviceInfo extends AbstractInfo { int last = 15; return String.format(Locale.US, "%d.%d.%d.%d", mData[last], mData[last - 1], mData[last - 2], mData[last - 3]); } - return "(unknown)"; // TODO: localization + return GBApplication.getContext().getString(R.string._unknown_); } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleAppInstallerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleAppInstallerActivity.java index d230473d..a9bbf558 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleAppInstallerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleAppInstallerActivity.java @@ -1,5 +1,11 @@ package nodomain.freeyourgadget.gadgetbridge.pebble; +import nodomain.freeyourgadget.gadgetbridge.BluetoothCommunicationService; +import nodomain.freeyourgadget.gadgetbridge.ControlCenter; +import nodomain.freeyourgadget.gadgetbridge.GBDevice; +import nodomain.freeyourgadget.gadgetbridge.GBDeviceApp; +import nodomain.freeyourgadget.gadgetbridge.R; + import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; @@ -14,12 +20,6 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; -import nodomain.freeyourgadget.gadgetbridge.BluetoothCommunicationService; -import nodomain.freeyourgadget.gadgetbridge.ControlCenter; -import nodomain.freeyourgadget.gadgetbridge.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.GBDeviceApp; -import nodomain.freeyourgadget.gadgetbridge.R; - public class PebbleAppInstallerActivity extends Activity { @@ -71,10 +71,10 @@ public class PebbleAppInstallerActivity extends Activity { GBDeviceApp app = mPBWReader.getGBDeviceApp(); if (mPBWReader.isFirmware()) { - debugTextView.setText("YOUR ARE TRYING TO INSTALL A FIRMWARE, PROCEED AT YOUR OWN RISK.\n\n\n This firmware is for HW Revision: " + mPBWReader.getHWRevision()); + debugTextView.setText(getString(R.string.firmware_install_warning, mPBWReader.getHWRevision())); } else if (app != null) { - debugTextView.setText("You are about to install the following app:\n\n\n" + app.getName() + " Version " + app.getVersion() + " by " + app.getCreator() + "\n"); + debugTextView.setText(getString(R.string.app_install_info, app.getName(), app.getVersion(), app.getCreator())); } installButton.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleIoThread.java index b5f21da0..793fa252 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/pebble/PebbleIoThread.java @@ -1,5 +1,27 @@ package nodomain.freeyourgadget.gadgetbridge.pebble; +import nodomain.freeyourgadget.gadgetbridge.AppManagerActivity; +import nodomain.freeyourgadget.gadgetbridge.GB; +import nodomain.freeyourgadget.gadgetbridge.GBCallControlReceiver; +import nodomain.freeyourgadget.gadgetbridge.GBDevice; +import nodomain.freeyourgadget.gadgetbridge.GBDeviceIoThread; +import nodomain.freeyourgadget.gadgetbridge.GBMusicControlReceiver; +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommand; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandAppInfo; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandAppManagementResult; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandCallControl; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandMusicControl; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandVersionInfo; +import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceProtocol; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.zip.ZipInputStream; + import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -16,28 +38,6 @@ import android.support.v4.app.NotificationCompat; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.zip.ZipInputStream; - -import nodomain.freeyourgadget.gadgetbridge.AppManagerActivity; -import nodomain.freeyourgadget.gadgetbridge.GB; -import nodomain.freeyourgadget.gadgetbridge.GBCallControlReceiver; -import nodomain.freeyourgadget.gadgetbridge.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.GBDeviceIoThread; -import nodomain.freeyourgadget.gadgetbridge.GBMusicControlReceiver; -import nodomain.freeyourgadget.gadgetbridge.R; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommand; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandAppInfo; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandAppManagementResult; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandCallControl; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandMusicControl; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceCommandVersionInfo; -import nodomain.freeyourgadget.gadgetbridge.protocol.GBDeviceProtocol; - public class PebbleIoThread extends GBDeviceIoThread { private static final String TAG = PebbleIoThread.class.getSimpleName(); private static final int NOTIFICATION_ID = 2; @@ -87,7 +87,7 @@ public class PebbleIoThread extends GBDeviceIoThread { notificationIntent, 0); NotificationCompat.Builder nb = new NotificationCompat.Builder(context) - .setContentTitle("Gadgetbridge") + .setContentTitle(context.getString(R.string.gadgetbridge)) .setContentText(text) .setTicker(text) @@ -115,6 +115,7 @@ public class PebbleIoThread extends GBDeviceIoThread { mBtAdapter = btAdapter; } + @Override protected boolean connect(String btDeviceAddress) { BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(btDeviceAddress); ParcelUuid uuids[] = btDevice.getUuids(); @@ -138,6 +139,7 @@ public class PebbleIoThread extends GBDeviceIoThread { return true; } + @Override public void run() { mIsConnected = connect(gbDevice.getAddress()); mQuit = !mIsConnected; // quit if not connected @@ -192,7 +194,8 @@ public class PebbleIoThread extends GBDeviceIoThread { } while (bytes < 2000); if (bytes > 0) { - updateInstallNotification("installing binary " + (mCurrentInstallableIndex + 1) + "/" + mPebbleInstallables.length, true, (int) (((float) mBytesWritten / mBinarySize) * 100), getContext()); + updateInstallNotification(getContext().getString( + R.string.installing_binary_d_d, (mCurrentInstallableIndex + 1), mPebbleInstallables.length), true, (int) (((float) mBytesWritten / mBinarySize) * 100), getContext()); writeInstallApp(mPebbleProtocol.encodeUploadChunk(mAppInstallToken, buffer, bytes)); mBytesWritten += bytes; mAppInstallToken = -1; @@ -323,6 +326,7 @@ public class PebbleIoThread extends GBDeviceIoThread { gbDevice.sendDeviceUpdateIntent(getContext()); } + @Override synchronized public void write(byte[] bytes) { // block writes if app installation in in progress if (mIsConnected && !mIsInstalling) { @@ -460,9 +464,9 @@ public class PebbleIoThread extends GBDeviceIoThread { return; } if (hadError) { - updateInstallNotification("installation failed!", false, 0, getContext()); + updateInstallNotification(getContext().getString(R.string.installation_failed_), false, 0, getContext()); } else { - updateInstallNotification("installation successful", false, 0, getContext()); + updateInstallNotification(getContext().getString(R.string.installation_successful), false, 0, getContext()); } mInstallState = PebbleAppInstallState.UNKNOWN; @@ -477,6 +481,7 @@ public class PebbleIoThread extends GBDeviceIoThread { mInstallSlot = -2; } + @Override public void quit() { mQuit = true; if (mBtSocket != null) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/protocol/GBDeviceCommandVersionInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/protocol/GBDeviceCommandVersionInfo.java index 0da8df00..061515d1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/protocol/GBDeviceCommandVersionInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/protocol/GBDeviceCommandVersionInfo.java @@ -1,8 +1,11 @@ package nodomain.freeyourgadget.gadgetbridge.protocol; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; + public class GBDeviceCommandVersionInfo extends GBDeviceCommand { - public String fwVersion = "N/A"; - public String hwVersion = "N/A"; + public String fwVersion = GBApplication.getContext().getString(R.string.n_a); + public String hwVersion = GBApplication.getContext().getString(R.string.n_a); public GBDeviceCommandVersionInfo() { commandClass = CommandClass.VERSION_INFO; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f9febebd..e211f9aa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,4 +34,33 @@ Developer Options Miband address + not connected + connecting + connected + unknown state + %1$s (HW: %2$s FW: %3$s) + %1$s (FW: %2$s) + (unknown) + Gadgetbridge + Test + Test Notification + This is a Test Notification from Gadgetbridge + Bluetooth is not supported. + Bluetooth is disabled. + tap connected device for App Mananger + tap a device to connect + Cannot connect. BT address invalid? + Gadgetbridge running + low + medium + full + not charging + installing binary %1$d/%2$d + installation failed! + installation successful + YOUR ARE TRYING TO INSTALL A FIRMWARE, PROCEED AT YOUR OWN RISK.\n\n\n This firmware is for HW Revision: %s + You are about to install the following app:\n\n\n%1$s Version %2$s by %3$s\n + N/A + initialized + %1$s by %1$s