@@ -390,15 +390,15 @@ private boolean verifyThreshold(double threshold, boolean allDay, int startTime,
390390 List <AlertType > highAlerts = AlertType .getAll (true );
391391
392392 if (threshold < MIN_ALERT || threshold > MAX_ALERT ) {
393- Toast .makeText (getApplicationContext (), "Threshold must be between " + unitsConvert2Disp (doMgdl , MIN_ALERT ) + " and " + unitsConvert2Disp (doMgdl , MAX_ALERT ) + "." , Toast .LENGTH_LONG ).show ();
393+ Toast .makeText (getApplicationContext (), getString ( R . string . threshold_has_to_be_between , unitsConvert2Disp (doMgdl , MIN_ALERT ), unitsConvert2Disp (doMgdl , MAX_ALERT )), Toast .LENGTH_LONG ).show ();
394394 return false ;
395395 }
396396 // We want to make sure that for each threashold there is only one alert. Otherwise, which file should we play.
397397 for (AlertType lowAlert : lowAlerts ) {
398398 if (lowAlert .threshold == threshold && overlapping (lowAlert , allDay , startTime , endTime ) && lowAlert .active ) {
399399 if (uuid == null || ! uuid .equals (lowAlert .uuid )){ //new alert or not myself
400400 Toast .makeText (getApplicationContext (),
401- "Each alert needs a unique threshold. Please choose a different one." ,Toast .LENGTH_LONG ).show ();
401+ getString ( R . string . alert_threshold_already_in_use ) ,Toast .LENGTH_LONG ).show ();
402402 return false ;
403403 }
404404 }
@@ -407,7 +407,7 @@ private boolean verifyThreshold(double threshold, boolean allDay, int startTime,
407407 if (highAlert .threshold == threshold && overlapping (highAlert , allDay , startTime , endTime ) && highAlert .active ) {
408408 if (uuid == null || ! uuid .equals (highAlert .uuid )){ //new alert or not myself
409409 Toast .makeText (getApplicationContext (),
410- "Each alert needs a unique threshold. Please choose a different one." ,Toast .LENGTH_LONG ).show ();
410+ getString ( R . string . alert_threshold_already_in_use ) ,Toast .LENGTH_LONG ).show ();
411411 return false ;
412412 }
413413 }
@@ -418,7 +418,7 @@ private boolean verifyThreshold(double threshold, boolean allDay, int startTime,
418418 for (AlertType lowAlert : lowAlerts ) {
419419 if (threshold < lowAlert .threshold && overlapping (lowAlert , allDay , startTime , endTime ) && lowAlert .active ) {
420420 Toast .makeText (getApplicationContext (),
421- "High alerts must be set above all low alerts. Please adjust the threshold." ,Toast .LENGTH_LONG ).show ();
421+ getString ( R . string . high_alert_threshold_error ) ,Toast .LENGTH_LONG ).show ();
422422 return false ;
423423 }
424424 }
@@ -427,7 +427,7 @@ private boolean verifyThreshold(double threshold, boolean allDay, int startTime,
427427 for (AlertType highAlert : highAlerts ) {
428428 if (threshold > highAlert .threshold && overlapping (highAlert , allDay , startTime , endTime ) && highAlert .active ) {
429429 Toast .makeText (getApplicationContext (),
430- "Low alerts must be set below all high alerts. Please adjust the threshold." ,Toast .LENGTH_LONG ).show ();
430+ getString ( R . string . low_alert_threshold_error ) ,Toast .LENGTH_LONG ).show ();
431431 return false ;
432432 }
433433 }
@@ -513,10 +513,10 @@ public void onClick(View v) {
513513 int defaultSnooze = safeGetDefaultSnooze ();
514514
515515 if (alertReraise < 1 ) {
516- Toast .makeText (getApplicationContext (), "Reraise Value must be 1 minute or greater" , Toast .LENGTH_LONG ).show ();
516+ Toast .makeText (getApplicationContext (), getString ( R . string . alert_reraise_value_too_small ) , Toast .LENGTH_LONG ).show ();
517517 return ;
518518 } else if (alertReraise >= defaultSnooze ) {
519- Toast .makeText (getApplicationContext (), "Reraise Value must be less than snooze length" , Toast .LENGTH_LONG ).show ();
519+ Toast .makeText (getApplicationContext (), getString ( R . string . alert_reraise_value_too_big ) , Toast .LENGTH_LONG ).show ();
520520 return ;
521521 }
522522
@@ -536,7 +536,7 @@ public void onClick(View v) {
536536 allDay = true ;
537537 }
538538 if (timeStart == timeEnd && (allDay ==false )) {
539- Toast .makeText (getApplicationContext (), "Alert start and end times cannot be equal." , Toast .LENGTH_LONG ).show ();
539+ Toast .makeText (getApplicationContext (), getString ( R . string . start_and_end_time_same ), Toast .LENGTH_LONG ).show ();
540540 return ;
541541 }
542542 boolean disabled = checkboxDisabled .isChecked ();
@@ -592,7 +592,7 @@ public void onClick(View v) {
592592 buttonalertMp3 .setOnClickListener (new View .OnClickListener () {
593593 public void onClick (View v ) {
594594 AlertDialog .Builder builder = new AlertDialog .Builder (mContext );
595- builder .setTitle ("What type of sound?" )
595+ builder .setTitle (getString ( R . string . what_type_of_alert ) )
596596 .setItems (R .array .alertType , new DialogInterface .OnClickListener () {
597597 public void onClick (DialogInterface dialog , int which ) {
598598 if (which == 0 ) {
@@ -857,7 +857,7 @@ public void onClick(View v) {
857857 d .setContentView (R .layout .snooze_picker );
858858 Button b1 = (Button ) d .findViewById (R .id .button1 );
859859 Button b2 = (Button ) d .findViewById (R .id .button2 );
860- b1 .setText ("pre-Snooze" );
860+ b1 .setText (getString ( R . string . pre_snooze ) );
861861
862862 final NumberPicker snoozeValue = (NumberPicker ) d .findViewById (R .id .numberPicker1 );
863863
@@ -928,7 +928,7 @@ public void testAlert() {
928928 allDay = true ;
929929 }
930930 if (timeStart == timeEnd && (!allDay )) {
931- Toast .makeText (getApplicationContext (), "Alert start and end times cannot be equal." , Toast .LENGTH_LONG ).show ();
931+ Toast .makeText (getApplicationContext (), getString ( R . string . start_and_end_time_same ), Toast .LENGTH_LONG ).show ();
932932 return ;
933933 }
934934 if (!verifyThreshold (threshold , allDay , timeStart , timeEnd )) {
@@ -942,11 +942,11 @@ public void testAlert() {
942942 int defaultSnooze = safeGetDefaultSnooze ();
943943
944944 if (Pref .getBooleanDefaultFalse ("start_snoozed" )) {
945- JoH .static_toast_long ("Start Snoozed setting means alert would normally start silent" );
945+ JoH .static_toast_long (getString ( R . string . start_snoozed_enabled ) );
946946 } else if (Pref .getStringDefaultBlank ("bg_alert_profile" ).equals ("ascending" ) && Pref .getBoolean ("delay_ascending_3min" , true )) {
947- JoH .static_toast_long ("Ascending Volume Profile + delayed ascending means it will start silent" );
947+ JoH .static_toast_long (getString ( R . string . volume_profile_set_to_ascending_with_delay ) );
948948 } else if (Pref .getStringDefaultBlank ("bg_alert_profile" ).equals ("Silent" )) {
949- JoH .static_toast_long ("Volume Profile is set to silent!" );
949+ JoH .static_toast_long (getString ( R . string . volume_profile_set_to_silent ) );
950950 }
951951
952952 AlertType .testAlert (alertText .getText ().toString (), above , threshold , allDay , 1 , mp3_file , timeStart , timeEnd , overrideSilentMode , forceSpeaker , defaultSnooze , vibrate , mContext );
0 commit comments