V3.6.2b - extracted more strings for translation

This commit is contained in:
Graham Jones
2020-12-18 13:32:41 +00:00
parent c4094b25dd
commit fc982d37ce
10 changed files with 67 additions and 42 deletions

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="uk.org.openseizuredetector"
android:versionCode="83"
android:versionName="3.6.2a">
android:versionCode="84"
android:versionName="3.6.2b">
<!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -136,7 +136,7 @@ public class MainActivity extends AppCompatActivity {
if ((mConnection.mSdServer.mSmsTimer != null)
&& (mConnection.mSdServer.mSmsTimer.mTimeLeft > 0 )){
Log.v(TAG, "acceptAlarmButton.onClick() - Stopping SMS Timer");
mUtil.showToast("SMS Alarm Cancelled");
mUtil.showToast(getString(R.string.SMSAlarmCancelledMsg));
mConnection.mSdServer.stopSmsTimer();
}
else {
@@ -357,7 +357,7 @@ public class MainActivity extends AppCompatActivity {
Log.v(TAG, "Changing menu icons");
MenuItem menuItem = mOptionsMenu.findItem(R.id.action_start_stop);
menuItem.setIcon(R.drawable.stop_server);
menuItem.setTitle("Stop Server");
menuItem.setTitle(R.string.StopServerTitle);
} else {
Log.v(TAG, "mOptionsMenu is null - not changing icons!");
}
@@ -371,7 +371,7 @@ public class MainActivity extends AppCompatActivity {
if (mOptionsMenu != null) {
Log.v(TAG, "Changing action bar icons");
mOptionsMenu.findItem(R.id.action_start_stop).setIcon(R.drawable.start_server);
mOptionsMenu.findItem(R.id.action_start_stop).setTitle("Start Server");
mOptionsMenu.findItem(R.id.action_start_stop).setTitle(R.string.StartServerTitle);
} else {
Log.v(TAG, "mOptionsMenu is null, not changing icons!");
}

View File

@@ -143,7 +143,7 @@ public class OsdUtil implements ActivityCompat.OnRequestPermissionsResultCallbac
} catch (Exception ex) {
Log.v(TAG, "updatePrefs() - Problem parsing preferences!");
showToast("Problem Parsing Preferences - Something won't work - Please go back to Settings and correct it!");
showToast(mContext.getString(R.string.ParsePreferenceWarning));
}
}
@@ -401,7 +401,7 @@ public class OsdUtil implements ActivityCompat.OnRequestPermissionsResultCallbac
for (int i = 0; i < (ex.getStackTrace().length); i++) {
Log.e(TAG, "writeToLogFile - error " + ex.getStackTrace()[i]);
}
showToast("ERROR Writing to Log File" + ex.toString());
showToast(mContext.getString(R.string.ErrorWritingLogFileWarning) + ex.toString());
}
} else {
Log.e(TAG, "ERROR - Can not Write to External Folder");
@@ -530,7 +530,7 @@ public class OsdUtil implements ActivityCompat.OnRequestPermissionsResultCallbac
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
Log.i(TAG, "onRequestPermissionsResult - Permission" + permissions + " = " + grantResults);
showToast("Permissions Changed - restarting server");
showToast(mContext.getString(R.string.RestartingServerMsg));
stopServer();
// Wait 0.1 second to give the server chance to shutdown, then re-start it
mHandler.postDelayed(new Runnable() {

View File

@@ -23,27 +23,10 @@
*/
package uk.org.openseizuredetector;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.text.format.Time;
import android.util.Log;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.jtransforms.fft.DoubleFFT_1D;
import java.util.Arrays;
import java.util.Timer;
import java.util.TimerTask;
import static java.lang.Long.parseLong;
/**

View File

@@ -256,11 +256,11 @@ public class SdServer extends Service implements SdDataReceiver {
mSdDataSource = new SdDataSourcePhone(this.getApplicationContext(), mHandler, this);
break;
default:
Log.e(TAG, "Datasource " + mSdDataSourceName + " not recognised - Defaulting to Pebble");
mUtil.writeToSysLogFile("SdServer.onStartCommand() - Datasource " + mSdDataSourceName + " not recognised - exiting");
mUtil.showToast("Datasource " + mSdDataSourceName + " not recognised - Defaulting to Pebble");
mUtil.writeToSysLogFile("SdServer.onStartCommand() - creating SdDataSourcePebble");
mSdDataSource = new SdDataSourcePebble(this.getApplicationContext(), mHandler, this);
Log.e(TAG, "Datasource " + mSdDataSourceName + " not recognised - Defaulting to Phone");
//mUtil.writeToSysLogFile("SdServer.onStartCommand() - Datasource " + mSdDataSourceName + " not recognised - exiting");
mUtil.showToast(getString(R.string.DatasourceTitle) + " " + mSdDataSourceName + getString(R.string.DefaultingToPhoneMsg));
mUtil.writeToSysLogFile("SdServer.onStartCommand() - creating SdDataSourcePhone");
mSdDataSource = new SdDataSourcePhone(this.getApplicationContext(), mHandler, this);
}
if (mSMSAlarm) {
@@ -349,7 +349,7 @@ public class SdServer extends Service implements SdDataReceiver {
} catch (Exception e) {
Log.e(TAG, "Error Releasing Wakelock - " + e.toString());
mUtil.writeToSysLogFile("SdServer.onDestroy() - Error releasing wakelock.");
mUtil.showToast("Error Releasing Wakelock");
mUtil.showToast(getString(R.string.ErrorReleasingWakelockMsg));
}
} else {
Log.d(TAG, "mmm...mWakeLock is null, so not releasing lock. This shouldn't happen!");
@@ -589,11 +589,11 @@ public class SdServer extends Service implements SdDataReceiver {
sendPhoneAlarm();
mSMSTime = tnow;
} else {
mUtil.showToast("SMS Alarm already sent - not re-sending");
mUtil.showToast(getString(R.string.SMSAlarmAlreadySentMsg));
Log.v(TAG, "SMS Alarm already sent - not re-sending");
}
} else {
mUtil.showToast("mSMSAlarm is false - not sending");
mUtil.showToast(getString(R.string.SMSAlarmDisabledNotSendingMsg));
Log.v(TAG, "mSMSAlarm is false - not sending");
}
@@ -625,7 +625,7 @@ public class SdServer extends Service implements SdDataReceiver {
sendSMSAlarm();
mSMSTime = tnow;
} else {
mUtil.showToast("SMS Alarm already sent - not re-sending");
mUtil.showToast(getString(R.string.SMSAlarmAlreadySentMsg));
Log.v(TAG, "SMS Alarm already sent - not re-sending");
}
} else {
@@ -663,7 +663,7 @@ public class SdServer extends Service implements SdDataReceiver {
Log.v(TAG, "SMS Alarm already sent - not re-sending");
}
} else {
mUtil.showToast("mSMSAlarm is false - not sending");
mUtil.showToast(getString(R.string.SMSAlarmDisabledNotSendingMsg));
Log.v(TAG, "mSMSAlarm is false - not sending");
}
@@ -724,7 +724,7 @@ public class SdServer extends Service implements SdDataReceiver {
mToneGenerator.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, duration);
Log.v(TAG, "beep()");
} else {
mUtil.showToast("Warning mToneGenerator is null - not beeping!!!");
mUtil.showToast(getString(R.string.PleaseForceStopOSDorRebootMsg));
Log.v(TAG, "beep() - Warming mToneGenerator is null - not beeping!!!");
mUtil.writeToSysLogFile("SdServer.beep() - mToneGenerator is null???");
}
@@ -806,7 +806,7 @@ public class SdServer extends Service implements SdDataReceiver {
if (mSMSAlarm) {
if (!mCancelAudible) {
if (!mUtil.areSMSPermissionsOK()) {
mUtil.showToast("ERROR - Permission for SMS or Location Denied - Not Sending SMS");
mUtil.showToast(getString(R.string.SMSPermissionsDeniedMsg));
Log.e(TAG, "ERROR - Permission for SMS or Location Denied - Not Sending SMS");
} else {
//mSMSAlertDialog = new AlertDialog.Builder(this);
@@ -1100,7 +1100,7 @@ public class SdServer extends Service implements SdDataReceiver {
} catch (Exception ex) {
Log.v(TAG, "updatePrefs() - Problem with LatchAlarmTimerPeriod preference!");
mUtil.writeToSysLogFile( "updatePrefs() - Problem with LatchAlarmTimerPeriod preference!");
mUtil.showToast("Problem Parsing LatchAlarmTimerPeriod Preference");
mUtil.showToast(getString(R.string.problem_parsing_preferences));
}
mAudibleFaultWarning = SP.getBoolean("AudibleFaultWarning", true);
Log.v(TAG, "updatePrefs() - mAuidbleFaultWarning = " + mAudibleFaultWarning);
@@ -1114,7 +1114,7 @@ public class SdServer extends Service implements SdDataReceiver {
} catch (Exception ex) {
Log.v(TAG, "updatePrefs() - Problem with FaultTimerPeriod preference!");
mUtil.writeToSysLogFile("updatePrefs() - Problem with FaultTimerPeriod preference!");
mUtil.showToast("Problem Parsing FaultTimerPeriod Preference");
mUtil.showToast(getString(R.string.problem_parsing_preferences));
}
mAudibleAlarm = SP.getBoolean("AudibleAlarm", true);

View File

@@ -122,13 +122,13 @@
android:id="@+id/acceptAlarmButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Accept Alarm" />
android:text="@string/AcceptAlarmBtnTxt" />
<Button
android:id="@+id/cancelAudibleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel Audible (temporarily)" />
android:text="@string/CancelAudibleButtonTxt" />
</LinearLayout>
<com.github.mikephil.charting.charts.BarChart

View File

@@ -29,7 +29,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Starting......"
android:text="@string/StartingTitle"
android:id="@+id/dataSourceTextView"
android:layout_gravity="center_horizontal" />

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="datasource_list">
<item>"Garmin Watch"</item>
<item>"Bluetooth Device"</item>
<item>"Pebble Watch"</item>
<item>"Phone Sensor (for testing)"</item>
<item>"Network (for Wifi Alerts)"</item>
</string-array>
</resources>

View File

@@ -255,4 +255,20 @@
<string name="data_update_period_summary">Częstość wyświetlania informacji w milisekundach</string>
<string name="select_datasource_title">Wybierz źródło danych</string>
<string name="select_datasource_summary">Wybierz które źródło danych wykrywania ataków chcesz używać</string>
<string name="ParsePreferenceWarning">Problem Parsing Preferences - Something won\'t work - Please go back to Settings and correct it!</string>
<string name="ErrorWritingLogFileWarning">ERROR Writing to Log File</string>
<string name="RestartingServerMsg">Permissions Changed - restarting server</string>
<string name="ErrorReleasingWakelockMsg">Error Releasing Wakelock</string>
<string name="SMSAlarmAlreadySentMsg">SMS Alarm already sent - not re-sending</string>
<string name="SMSAlarmDisabledNotSendingMsg">SMS Alarms Disabled - not sending SMS Alert</string>
<string name="PleaseForceStopOSDorRebootMsg">ERROR - OpenSizureDetector did not restart properly - please Force Stop OpenSeizureDetector or re-boot phone.</string>
<string name="SMSPermissionsDeniedMsg">ERROR - Permission for SMS or Location Denied - Not Sending SMS</string>
<string name="DatasourceTitle">\"Datasource\"</string>
<string name="DefaultingToPhoneMsg">\" not recognised - Defaulting to Phone\"</string>
<string name="SMSAlarmCancelledMsg">SMS Alarm Cancelled</string>
<string name="StopServerTitle">Stop Server</string>
<string name="StartServerTitle">Start Server</string>
<string name="StartingTitle">Starting......</string>
<string name="AcceptAlarmBtnTxt">Accept Alarm</string>
<string name="CancelAudibleButtonTxt">Cancel Audible (temporarily)</string>
</resources>

View File

@@ -256,4 +256,20 @@
<string name="display_spectrum_mode_summary">Set Display Spectrum mode on or off.</string>
<string name="analysis_prefs_title">Analysis</string>
<string name="watch_comms_settings_title">Watch Communications Settings</string>
<string name="ParsePreferenceWarning">Problem Parsing Preferences - Something won\'t work - Please go back to Settings and correct it!</string>
<string name="ErrorWritingLogFileWarning">ERROR Writing to Log File</string>
<string name="RestartingServerMsg">Permissions Changed - restarting server</string>
<string name="ErrorReleasingWakelockMsg">Error Releasing Wakelock</string>
<string name="SMSAlarmAlreadySentMsg">SMS Alarm already sent - not re-sending</string>
<string name="SMSAlarmDisabledNotSendingMsg">SMS Alarms Disabled - not sending SMS Alert</string>
<string name="PleaseForceStopOSDorRebootMsg">ERROR - OpenSizureDetector did not restart properly - please Force Stop OpenSeizureDetector or re-boot phone.</string>
<string name="SMSPermissionsDeniedMsg">ERROR - Permission for SMS or Location Denied - Not Sending SMS</string>
<string name="DatasourceTitle">\"Datasource\"</string>
<string name="DefaultingToPhoneMsg">\" not recognised - Defaulting to Phone\"</string>
<string name="SMSAlarmCancelledMsg">SMS Alarm Cancelled</string>
<string name="StopServerTitle">Stop Server</string>
<string name="StartServerTitle">Start Server</string>
<string name="StartingTitle">Starting......</string>
<string name="AcceptAlarmBtnTxt">Accept Alarm</string>
<string name="CancelAudibleButtonTxt">Cancel Audible (temporarily)</string>
</resources>