Extract RedPhone string resources

// FREEBIE
pull/1/head
Moxie Marlinspike 9 years ago
parent b68691bf05
commit 123c7b2119

@ -124,7 +124,7 @@
android:maxLines="1" android:maxLines="1"
android:ellipsize="end" android:ellipsize="end"
android:visibility="visible" android:visibility="visible"
android:text="RedPhone Call" android:text="@string/redphone_call_card__signal_call"
/> />
<!-- Social status (currently unused) --> <!-- Social status (currently unused) -->

@ -137,7 +137,7 @@
android:layout_weight="1" android:layout_weight="1"
android:src="@drawable/redphone_ic_end_call" android:src="@drawable/redphone_ic_end_call"
android:background="@drawable/selectable_item_background" android:background="@drawable/selectable_item_background"
android:contentDescription="end call"/> android:contentDescription="@string/redphone_call_controls__end_call"/>
</LinearLayout> </LinearLayout>
<!-- android:background="?android:attr/selectableItemBackground" --> <!-- android:background="?android:attr/selectableItemBackground" -->
@ -199,7 +199,7 @@
<ToggleButton android:id="@+id/audioButton" <ToggleButton android:id="@+id/audioButton"
style="@style/InCallCompoundButton" style="@style/InCallCompoundButton"
android:background="@drawable/redphone_btn_compound_audio" android:background="@drawable/redphone_btn_compound_audio"
android:contentDescription="Audio" android:contentDescription="@string/redphone_call_controls__audio"
/> />
<View <View
@ -212,7 +212,7 @@
<ToggleButton android:id="@+id/muteButton" <ToggleButton android:id="@+id/muteButton"
style="@style/InCallCompoundButton" style="@style/InCallCompoundButton"
android:background="@drawable/redphone_btn_compound_mute" android:background="@drawable/redphone_btn_compound_mute"
android:contentDescription="Mute" android:contentDescription="@string/redphone_call_controls__mute"
/> />
<View <View

@ -127,6 +127,7 @@
<string name="ConversationActivity_are_you_sure_you_want_to_unblock_this_contact">Are you sure you want to unblock this contact?</string> <string name="ConversationActivity_are_you_sure_you_want_to_unblock_this_contact">Are you sure you want to unblock this contact?</string>
<string name="ConversationActivity_unblock">Unblock</string> <string name="ConversationActivity_unblock">Unblock</string>
<string name="ConversationActivity_attachment_exceeds_size_limits">Attachment exceeds size limits for the type of message you\'re sending.</string> <string name="ConversationActivity_attachment_exceeds_size_limits">Attachment exceeds size limits for the type of message you\'re sending.</string>
<string name="ConversationActivity_quick_camera_unavailable">Camera unavailable</string>
<!-- ConversationFragment --> <!-- ConversationFragment -->
<string name="ConversationFragment_message_details">Message details</string> <string name="ConversationFragment_message_details">Message details</string>
@ -271,6 +272,11 @@
<string name="MmsDownloader_error_connecting_to_mms_provider">Error connecting to MMS provider...</string> <string name="MmsDownloader_error_connecting_to_mms_provider">Error connecting to MMS provider...</string>
<string name="MmsDownloader_error_reading_mms_settings">Error reading wireless provider MMS settings...</string> <string name="MmsDownloader_error_reading_mms_settings">Error reading wireless provider MMS settings...</string>
<!--- NotificationBarManager -->
<string name="NotificationBarManager_signal_call_in_progress">Signal call in progress</string>
<string name="NotificationBarManager_missed_call_from_s">Missed call from %s</string>
<string name="NotificationBarManager_missed_signal_call">Missed Signal call</string>
<!-- NotificationMmsMessageRecord --> <!-- NotificationMmsMessageRecord -->
<string name="NotificationMmsMessageRecord_multimedia_message">Multimedia message</string> <string name="NotificationMmsMessageRecord_multimedia_message">Multimedia message</string>
@ -328,6 +334,28 @@
<string name="RecipientPreferenceActivity_enabled">Enabled</string> <string name="RecipientPreferenceActivity_enabled">Enabled</string>
<string name="RecipientPreferenceActivity_disabled">Disabled</string> <string name="RecipientPreferenceActivity_disabled">Disabled</string>
<!-- RedPhone -->
<string name="RedPhone_answering">Answering</string>
<string name="RedPhone_ending_call">Ending call</string>
<string name="RedPhone_dialing">Dialing</string>
<string name="RedPhone_canceling_call">Canceling call</string>
<string name="RedPhone_call_rejected">Call rejected</string>
<string name="RedPhone_ringing">Ringing</string>
<string name="RedPhone_busy">Busy</string>
<string name="RedPhone_connected">Connected</string>
<string name="RedPhone_connecting">Connecting</string>
<string name="RedPhone_handshake_failed">Handshake failed!</string>
<string name="RedPhone_recipient_unavailable">Recipient unavailable</string>
<string name="RedPhone_performing_handshake">Performing handshake</string>
<string name="RedPhone_network_failed">Server failed!</string>
<string name="RedPhone_client_failed">Client failed</string>
<string name="RedPhone_fatal_error">Fatal Error</string>
<string name="RedPhone_login_failed">Login failed!</string>
<string name="RedPhone_message_from_the_server">Message from the server</string>
<string name="RedPhone_number_not_registered">Number not registered!</string>
<string name="RedPhone_the_number_you_dialed_does_not_support_secure_voice">The number you dialed does not support secure voice!</string>
<string name="RedPhone_got_it">Got it</string>
<!-- RegistrationActivity --> <!-- RegistrationActivity -->
<string name="RegistrationActivity_connect_with_signal">Connect With Signal</string> <string name="RegistrationActivity_connect_with_signal">Connect With Signal</string>
<string name="RegistrationActivity_select_your_country">Select your country</string> <string name="RegistrationActivity_select_your_country">Select your country</string>
@ -632,6 +660,12 @@
<string name="recipient_preferences__color">Color</string> <string name="recipient_preferences__color">Color</string>
<string name="recipient_preferences__color_for_this_contact">Color for this contact</string> <string name="recipient_preferences__color_for_this_contact">Color for this contact</string>
<!--- redphone_call_controls -->
<string name="redphone_call_card__signal_call">Signal Call</string>
<string name="redphone_call_controls__end_call">end call</string>
<string name="redphone_call_controls__audio">Audio</string>
<string name="redphone_call_controls__mute">Mute</string>
<!-- registration_activity --> <!-- registration_activity -->
<string name="registration_activity__verify_your_number_to_connect_with_signal"> <string name="registration_activity__verify_your_number_to_connect_with_signal">
Verify your phone number to connect with Signal. Verify your phone number to connect with Signal.
@ -1009,8 +1043,6 @@
<!-- transport_selection_list_item --> <!-- transport_selection_list_item -->
<string name="transport_selection_list_item__transport_icon">Transport icon</string> <string name="transport_selection_list_item__transport_icon">Transport icon</string>
<!-- quick_attachment_drawer -->
<string name="quick_camera_unavailable">Camera unavailable</string>
<!-- EOF --> <!-- EOF -->

@ -158,7 +158,7 @@ public class RedPhone extends Activity {
private void handleAnswerCall() { private void handleAnswerCall() {
state = STATE_ANSWERING; state = STATE_ANSWERING;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Answering"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(org.thoughtcrime.securesms.R.string.RedPhone_answering));
Intent intent = new Intent(this, RedPhoneService.class); Intent intent = new Intent(this, RedPhoneService.class);
intent.setAction(RedPhoneService.ACTION_ANSWER_CALL); intent.setAction(RedPhoneService.ACTION_ANSWER_CALL);
@ -172,7 +172,7 @@ public class RedPhone extends Activity {
intent.setAction(RedPhoneService.ACTION_DENY_CALL); intent.setAction(RedPhoneService.ACTION_DENY_CALL);
startService(intent); startService(intent);
callScreen.setActiveCall(redPhoneService.getRecipient(), "Ending call"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(org.thoughtcrime.securesms.R.string.RedPhone_ending_call));
delayedFinish(); delayedFinish();
} }
@ -183,7 +183,7 @@ public class RedPhone extends Activity {
private void handleOutgoingCall(Recipient recipient) { private void handleOutgoingCall(Recipient recipient) {
state = STATE_DIALING; state = STATE_DIALING;
callScreen.setActiveCall(recipient, "Dialing"); callScreen.setActiveCall(recipient, getString(org.thoughtcrime.securesms.R.string.RedPhone_dialing));
} }
private void handleTerminate( int terminationType ) { private void handleTerminate( int terminationType ) {
@ -192,12 +192,12 @@ public class RedPhone extends Activity {
if( state == STATE_DIALING ) { if( state == STATE_DIALING ) {
if (terminationType == LOCAL_TERMINATE) { if (terminationType == LOCAL_TERMINATE) {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Canceling call"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(org.thoughtcrime.securesms.R.string.RedPhone_canceling_call));
} else { } else {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Call rejected"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_call_rejected));
} }
} else if (state != STATE_IDLE) { } else if (state != STATE_IDLE) {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Ending call"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_ending_call));
} }
state = STATE_IDLE; state = STATE_IDLE;
@ -205,11 +205,11 @@ public class RedPhone extends Activity {
} }
private void handleCallRinging() { private void handleCallRinging() {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Ringing"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_ringing));
} }
private void handleCallBusy() { private void handleCallBusy() {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Busy"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_busy));
state = STATE_IDLE; state = STATE_IDLE;
delayedFinish(BUSY_SIGNAL_DELAY_FINISH); delayedFinish(BUSY_SIGNAL_DELAY_FINISH);
@ -217,7 +217,7 @@ public class RedPhone extends Activity {
private void handleCallConnected(SASInfo sas) { private void handleCallConnected(SASInfo sas) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES); getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
callScreen.setActiveCall(redPhoneService.getRecipient(), "Connected", sas); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_connected), sas);
state = STATE_CONNECTED; state = STATE_CONNECTED;
redPhoneService.notifyCallConnectionUIUpdateComplete(); redPhoneService.notifyCallConnectionUIUpdateComplete();
@ -228,40 +228,40 @@ public class RedPhone extends Activity {
} }
private void handleConnectingToInitiator() { private void handleConnectingToInitiator() {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Connecting"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_connecting));
} }
private void handleHandshakeFailed() { private void handleHandshakeFailed() {
state = STATE_IDLE; state = STATE_IDLE;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Handshake failed!"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_handshake_failed));
delayedFinish(); delayedFinish();
} }
private void handleRecipientUnavailable() { private void handleRecipientUnavailable() {
state = STATE_IDLE; state = STATE_IDLE;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Recipient unavailable"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_recipient_unavailable));
delayedFinish(); delayedFinish();
} }
private void handlePerformingHandshake() { private void handlePerformingHandshake() {
callScreen.setActiveCall(redPhoneService.getRecipient(), "Performing handshake"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_performing_handshake));
} }
private void handleServerFailure() { private void handleServerFailure() {
state = STATE_IDLE; state = STATE_IDLE;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Server failed!"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_network_failed));
delayedFinish(); delayedFinish();
} }
private void handleClientFailure(String msg) { private void handleClientFailure(String msg) {
state = STATE_IDLE; state = STATE_IDLE;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Client failed"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_client_failed));
if( msg != null && !isFinishing() ) { if( msg != null && !isFinishing() ) {
AlertDialog.Builder ad = new AlertDialog.Builder(this); AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setTitle("Fatal Error"); ad.setTitle(R.string.RedPhone_fatal_error);
ad.setMessage(msg); ad.setMessage(msg);
ad.setCancelable(false); ad.setCancelable(false);
ad.setPositiveButton("Ok", new OnClickListener() { ad.setPositiveButton(android.R.string.ok, new OnClickListener() {
public void onClick(DialogInterface dialog, int arg) { public void onClick(DialogInterface dialog, int arg) {
RedPhone.this.handleTerminate(LOCAL_TERMINATE); RedPhone.this.handleTerminate(LOCAL_TERMINATE);
} }
@ -272,14 +272,14 @@ public class RedPhone extends Activity {
private void handleLoginFailed() { private void handleLoginFailed() {
state = STATE_IDLE; state = STATE_IDLE;
callScreen.setActiveCall(redPhoneService.getRecipient(), "Login failed!"); callScreen.setActiveCall(redPhoneService.getRecipient(), getString(R.string.RedPhone_login_failed));
delayedFinish(); delayedFinish();
} }
private void handleServerMessage(String message) { private void handleServerMessage(String message) {
if( isFinishing() ) return; //we're already shutting down, this might crash if( isFinishing() ) return; //we're already shutting down, this might crash
AlertDialog.Builder ad = new AlertDialog.Builder(this); AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setTitle("Message from the server"); ad.setTitle(R.string.RedPhone_message_from_the_server);
ad.setMessage(message); ad.setMessage(message);
ad.setCancelable(false); ad.setCancelable(false);
ad.setPositiveButton(android.R.string.ok, new OnClickListener() { ad.setPositiveButton(android.R.string.ok, new OnClickListener() {
@ -293,11 +293,11 @@ public class RedPhone extends Activity {
private void handleNoSuchUser(final Recipient recipient) { private void handleNoSuchUser(final Recipient recipient) {
if (isFinishing()) return; // XXX Stuart added this check above, not sure why, so I'm repeating in ignorance. - moxie if (isFinishing()) return; // XXX Stuart added this check above, not sure why, so I'm repeating in ignorance. - moxie
AlertDialogWrapper.Builder dialog = new AlertDialogWrapper.Builder(this); AlertDialogWrapper.Builder dialog = new AlertDialogWrapper.Builder(this);
dialog.setTitle("Number not registered!"); dialog.setTitle(R.string.RedPhone_number_not_registered);
dialog.setIconAttribute(R.attr.dialog_alert_icon); dialog.setIconAttribute(R.attr.dialog_alert_icon);
dialog.setMessage("The number you dialed does not support secure voice!"); dialog.setMessage(R.string.RedPhone_the_number_you_dialed_does_not_support_secure_voice);
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.setPositiveButton("Got it", new OnClickListener() { dialog.setPositiveButton(R.string.RedPhone_got_it, new OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
RedPhone.this.handleTerminate(LOCAL_TERMINATE); RedPhone.this.handleTerminate(LOCAL_TERMINATE);

@ -96,21 +96,10 @@ public class OutgoingRinger implements MediaPlayer.OnCompletionListener, MediaPl
try { try {
mediaPlayer.setDataSource(context, dataUri); mediaPlayer.setDataSource(context, dataUri);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException | SecurityException | IllegalStateException | IOException e) {
Log.w(TAG, e); Log.w(TAG, e);
// TODO Auto-generated catch block // TODO Auto-generated catch block
return; return;
} catch (SecurityException e) {
// TODO Auto-generated catch block
Log.w(TAG, e);
return;
} catch (IllegalStateException e) {
Log.w(TAG, e);
return;
} catch (IOException e) {
// TODO Auto-generated catch block
Log.w(TAG, e);
return;
} }
try { try {
mediaPlayer.prepareAsync(); mediaPlayer.prepareAsync();

@ -58,7 +58,7 @@ public class NotificationBarManager {
Intent contentIntent = new Intent(context, RedPhone.class); Intent contentIntent = new Intent(context, RedPhone.class);
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0);
String notificationText = "Signal call in progress"; String notificationText = context.getString(R.string.NotificationBarManager_signal_call_in_progress);
Notification notification = new Notification(R.drawable.redphone_stat_sys_phone_call, null, Notification notification = new Notification(R.drawable.redphone_stat_sys_phone_call, null,
System.currentTimeMillis()); System.currentTimeMillis());
@ -79,9 +79,9 @@ public class NotificationBarManager {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setSmallIcon(R.drawable.ic_call_missed_grey600_24dp); builder.setSmallIcon(R.drawable.ic_call_missed_grey600_24dp);
builder.setWhen(System.currentTimeMillis()); builder.setWhen(System.currentTimeMillis());
builder.setTicker(String.format("Missed call from %s", notifyRecipients.toShortString())); builder.setTicker(context.getString(R.string.NotificationBarManager_missed_call_from_s, notifyRecipients.toShortString()));
builder.setContentTitle("Missed Signal call"); builder.setContentTitle(context.getString(R.string.NotificationBarManager_missed_signal_call));
builder.setContentText(String.format("Missed call from %s", notifyRecipients.toShortString())); builder.setContentText(context.getString(R.string.NotificationBarManager_missed_call_from_s, notifyRecipients.toShortString()));
builder.setContentIntent(pendingIntent); builder.setContentIntent(pendingIntent);
builder.setDefaults(Notification.DEFAULT_VIBRATE); builder.setDefaults(Notification.DEFAULT_VIBRATE);
builder.setAutoCancel(true); builder.setAutoCancel(true);

@ -1323,7 +1323,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
@Override @Override
public void onCameraFail(FailureReason reason) { public void onCameraFail(FailureReason reason) {
Toast.makeText(this, R.string.quick_camera_unavailable, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.ConversationActivity_quick_camera_unavailable, Toast.LENGTH_SHORT).show();
quickAttachmentDrawer.hide(false); quickAttachmentDrawer.hide(false);
quickAttachmentToggle.disable(); quickAttachmentToggle.disable();
} }

Loading…
Cancel
Save