Prepare home screen for localization

This commit is contained in:
nielsandriesse 2020-05-25 15:46:53 +10:00
parent 13943f75ef
commit e585d94892
6 changed files with 39 additions and 26 deletions

View File

@ -25,7 +25,7 @@
android:textSize="@dimen/very_large_font_size" android:textSize="@dimen/very_large_font_size"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text" android:textColor="@color/text"
android:text="Meet your recovery phrase" /> android:text="@string/activity_seed_title_2" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -35,7 +35,7 @@
android:layout_marginRight="@dimen/very_large_spacing" android:layout_marginRight="@dimen/very_large_spacing"
android:textSize="@dimen/medium_font_size" android:textSize="@dimen/medium_font_size"
android:textColor="@color/text" android:textColor="@color/text"
android:text="Your recovery phrase is the master key to your Session ID — you can use it to restore your Session ID if you lose access to your device. Store your recovery phrase in a safe place, and dont give it to anyone. To restore your Session ID, launch Session and tap Continue your Session." /> android:text="@string/activity_seed_explanation" />
<TextView <TextView
style="@style/SessionIDTextView" style="@style/SessionIDTextView"
@ -59,7 +59,7 @@
android:textSize="@dimen/medium_font_size" android:textSize="@dimen/medium_font_size"
android:textColor="@color/text" android:textColor="@color/text"
android:alpha="0.6" android:alpha="0.6"
android:text="Hold to reveal" /> android:text="@string/activity_seed_reveal_button_title" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
@ -72,6 +72,6 @@
android:layout_width="196dp" android:layout_width="196dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_marginBottom="@dimen/medium_spacing" android:layout_marginBottom="@dimen/medium_spacing"
android:text="Copy" /> android:text="@string/copy" />
</LinearLayout> </LinearLayout>

View File

@ -87,7 +87,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/medium_font_size" android:textSize="@dimen/medium_font_size"
android:textColor="@color/text" android:textColor="@color/text"
android:text="You don't have any contacts yet" /> android:text="@string/activity_home_empty_state_message" />
<Button <Button
style="@style/MediumProminentOutlineButton" style="@style/MediumProminentOutlineButton"
@ -95,7 +95,7 @@
android:layout_width="196dp" android:layout_width="196dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_marginTop="@dimen/medium_spacing" android:layout_marginTop="@dimen/medium_spacing"
android:text="Start a Session" /> android:text="@string/activity_home_empty_state_button_title" />
</LinearLayout> </LinearLayout>

View File

@ -25,7 +25,7 @@
android:textSize="19sp" android:textSize="19sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text" android:textColor="@color/text"
android:text="Meet your recovery phrase" /> android:text="@string/activity_seed_title_2" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -35,7 +35,7 @@
android:layout_marginRight="@dimen/very_large_spacing" android:layout_marginRight="@dimen/very_large_spacing"
android:textSize="14sp" android:textSize="14sp"
android:textColor="@color/text" android:textColor="@color/text"
android:text="Your recovery phrase is the master key to your Session ID — you can use it to restore your Session ID if you lose access to your device. Store your recovery phrase in a safe place, and dont give it to anyone. To restore your Session ID, launch Session and tap Continue your Session." /> android:text="@string/activity_seed_explanation" />
<TextView <TextView
style="@style/SessionIDTextView" style="@style/SessionIDTextView"
@ -59,7 +59,7 @@
android:textSize="14sp" android:textSize="14sp"
android:textColor="@color/text" android:textColor="@color/text"
android:alpha="0.6" android:alpha="0.6"
android:text="Hold to reveal" /> android:text="@string/activity_seed_reveal_button_title" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
@ -72,6 +72,6 @@
android:layout_width="196dp" android:layout_width="196dp"
android:layout_height="@dimen/medium_button_height" android:layout_height="@dimen/medium_button_height"
android:layout_marginBottom="@dimen/medium_spacing" android:layout_marginBottom="@dimen/medium_spacing"
android:text="Copy" /> android:text="@string/copy" />
</LinearLayout> </LinearLayout>

View File

@ -1719,30 +1719,43 @@
<string name="activity_pn_mode_title">Push Notifications</string> <string name="activity_pn_mode_title">Push Notifications</string>
<string name="activity_pn_mode_explanation">There are two ways Session can handle push notifications. Make sure to read the descriptions carefully before you choose.</string> <string name="activity_pn_mode_explanation">There are two ways Session can handle push notifications. Make sure to read the descriptions carefully before you choose.</string>
<string name="activity_pn_mode_fcm_option_title">Firebase Cloud Messaging</string> <string name="activity_pn_mode_fcm_option_title">Firebase Cloud Messaging</string>
<string name="activity_pn_mode_fcm_option_explanation">Session will use the Firebase Cloud Messaging service to receive push notifications. Youll be notified of new messages reliably and immediately. Using FCM means that this device will communicate directly with Googles servers to retrieve push notifications, which will expose your IP address to Google. Your messages will still be onion-routed and end-to-end encrypted, so the contents of your messages will remain completely private.</string> <string name="activity_pn_mode_fcm_option_explanation">Session will use the Firebase Cloud Messaging service to receive push notifications. You\ll be notified of new messages reliably and immediately. Using FCM means that this device will communicate directly with Google\s servers to retrieve push notifications, which will expose your IP address to Google. Your messages will still be onion-routed and end-to-end encrypted, so the contents of your messages will remain completely private.</string>
<string name="activity_pn_mode_background_polling_option_title">Background Polling</string> <string name="activity_pn_mode_background_polling_option_title">Background Polling</string>
<string name="activity_pn_mode_background_polling_option_explanation">Session will occasionally check for new messages in the background. This guarantees full privacy protection, but message notifications may be significantly delayed.</string> <string name="activity_pn_mode_background_polling_option_explanation">Session will occasionally check for new messages in the background. This guarantees full privacy protection, but message notifications may be significantly delayed.</string>
<string name="activity_pn_mode_recommended_option_tag">Recommended</string> <string name="activity_pn_mode_recommended_option_tag">Recommended</string>
<string name="activity_pn_mode_no_option_picked_dialog_title">Please Pick an Option</string> <string name="activity_pn_mode_no_option_picked_dialog_title">Please Pick an Option</string>
<string name="activity_home_empty_state_message">You don\'t have any contacts yet</string>
<string name="activity_home_empty_state_button_title">Start a Session</string>
<string name="activity_home_leave_group_dialog_message">Are you sure you want to leave this group?</string> <string name="activity_home_leave_group_dialog_message">Are you sure you want to leave this group?</string>
<string name="activity_home_leaving_group_failed_message">"Couldn\'t leave group"</string>
<string name="activity_home_delete_conversation_dialog_message">Are you sure you want to delete this conversation?</string> <string name="activity_home_delete_conversation_dialog_message">Are you sure you want to delete this conversation?</string>
<string name="activity_home_conversation_deleted_message">Conversation deleted</string> <string name="activity_home_conversation_deleted_message">Conversation deleted</string>
<string name="fragment_contact_selection_contacts_title">Contacts</string>
<string name="fragment_contact_selection_closed_groups_title">Closed Groups</string>
<string name="fragment_contact_selection_open_groups_title">Open Groups</string>
<string name="sheet_pn_mode_title">Push Notifications</string> <string name="sheet_pn_mode_title">Push Notifications</string>
<string name="sheet_pn_mode_explanation">Session now features two ways to handle push notifications. Make sure to read the descriptions carefully before you choose.</string> <string name="sheet_pn_mode_explanation">Session now features two ways to handle push notifications. Make sure to read the descriptions carefully before you choose.</string>
<string name="sheet_pn_mode_fcm_option_title">Firebase Cloud Messaging</string> <string name="sheet_pn_mode_fcm_option_title">Firebase Cloud Messaging</string>
<string name="sheet_pn_mode_fcm_option_explanation">Session will use the Firebase Cloud Messaging service to receive push notifications. Youll be notified of new messages reliably and immediately. Using FCM means that this device will communicate directly with Googles servers to retrieve push notifications, which will expose your IP address to Google. Your messages will still be onion-routed and end-to-end encrypted, so the contents of your messages will remain completely private.</string> <string name="sheet_pn_mode_fcm_option_explanation">Session will use the Firebase Cloud Messaging service to receive push notifications. You\ll be notified of new messages reliably and immediately. Using FCM means that this device will communicate directly with Google\s servers to retrieve push notifications, which will expose your IP address to Google. Your messages will still be onion-routed and end-to-end encrypted, so the contents of your messages will remain completely private.</string>
<string name="sheet_pn_mode_background_polling_option_title">Background Polling</string> <string name="sheet_pn_mode_background_polling_option_title">Background Polling</string>
<string name="sheet_pn_mode_background_polling_option_explanation">Session will occasionally check for new messages in the background. This guarantees full privacy protection, but message notifications may be significantly delayed.</string> <string name="sheet_pn_mode_background_polling_option_explanation">Session will occasionally check for new messages in the background. This guarantees full privacy protection, but message notifications may be significantly delayed.</string>
<string name="sheet_pn_mode_recommended_option_tag">Recommended</string> <string name="sheet_pn_mode_recommended_option_tag">Recommended</string>
<string name="sheet_pn_mode_no_option_picked_dialog_title">Please Pick an Option</string> <string name="sheet_pn_mode_no_option_picked_dialog_title">Please Pick an Option</string>
<string name="sheet_pn_mode_confirm_button_title">Confirm</string> <string name="sheet_pn_mode_confirm_button_title">Confirm</string>
<string name="sheet_pn_mode_skip_button_title">Skip</string> <string name="sheet_pn_mode_skip_button_title">Skip</string>
<string name="activity_seed_title">Your Recovery Phrase</string>
<string name="activity_seed_title_2">Meet your recovery phrase</string>
<string name="activity_seed_explanation">Your recovery phrase is the master key to your Session ID — you can use it to restore your Session ID if you lose access to your device. Store your recovery phrase in a safe place, and don\t give it to anyone. To restore your Session ID, launch Session and tap Continue your Session.</string>
<string name="activity_seed_reveal_button_title">Hold to reveal</string>
<string name="view_seed_reminder_subtitle_1">Secure your account by saving your recovery phrase</string>
<string name="view_seed_reminder_subtitle_2">Tap and hold the redacted words to reveal your recovery phrase, then store it safely to secure your Session ID.</string>
<string name="view_seed_reminder_subtitle_3">Make sure to store your recovery phrase in a safe place</string>
<string name="fragment_contact_selection_contacts_title">Contacts</string>
<string name="fragment_contact_selection_closed_groups_title">Closed Groups</string>
<string name="fragment_contact_selection_open_groups_title">Open Groups</string>
<string name="preferences_notifications_strategy_category_title">Notification Strategy</string> <string name="preferences_notifications_strategy_category_title">Notification Strategy</string>
<string name="preferences_notifications_use_fcm_option_title">Use FCM</string> <string name="preferences_notifications_use_fcm_option_title">Use FCM</string>
<string name="preferences_notifications_use_fcm_option_explanation">Using Firebase Cloud Messaging allows for more reliable push notifications, but exposes your IP to Google.</string> <string name="preferences_notifications_use_fcm_option_explanation">Using Firebase Cloud Messaging allows for more reliable push notifications, but exposes your IP to Google.</string>

View File

@ -105,10 +105,10 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
val isMasterDevice = (TextSecurePreferences.getMasterHexEncodedPublicKey(this) == null) val isMasterDevice = (TextSecurePreferences.getMasterHexEncodedPublicKey(this) == null)
val hasViewedSeed = TextSecurePreferences.getHasViewedSeed(this) val hasViewedSeed = TextSecurePreferences.getHasViewedSeed(this)
if (!hasViewedSeed && isMasterDevice) { if (!hasViewedSeed && isMasterDevice) {
val seedReminderViewTitle = SpannableString("You're almost finished! 80%") val seedReminderViewTitle = SpannableString("You're almost finished! 80%") // Intentionally not yet translated
seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 24, 27, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 24, 27, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
seedReminderView.title = seedReminderViewTitle seedReminderView.title = seedReminderViewTitle
seedReminderView.subtitle = "Secure your account by saving your recovery phrase" seedReminderView.subtitle = resources.getString(R.string.view_seed_reminder_subtitle_1)
seedReminderView.setProgress(80, false) seedReminderView.setProgress(80, false)
seedReminderView.delegate = this seedReminderView.delegate = this
} else { } else {
@ -313,7 +313,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
// Send a leave group message if this is an active closed group // Send a leave group message if this is an active closed group
if (isClosedGroup && DatabaseFactory.getGroupDatabase(activity).isActive(recipient.address.toGroupString())) { if (isClosedGroup && DatabaseFactory.getGroupDatabase(activity).isActive(recipient.address.toGroupString())) {
if (!ClosedGroupsProtocol.leaveGroup(activity, recipient)) { if (!ClosedGroupsProtocol.leaveGroup(activity, recipient)) {
Toast.makeText(activity, "Couldn't leave group", Toast.LENGTH_LONG).show() Toast.makeText(activity, R.string.activity_home_leaving_group_failed_message, Toast.LENGTH_LONG).show()
clearView(activity.recyclerView, viewHolder) clearView(activity.recyclerView, viewHolder)
return@setPositiveButton return@setPositiveButton
} }

View File

@ -34,11 +34,11 @@ class SeedActivity : BaseActionBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_seed) setContentView(R.layout.activity_seed)
supportActionBar!!.title = "Your Recovery Phrase" supportActionBar!!.title = resources.getString(R.string.activity_seed_title)
val seedReminderViewTitle = SpannableString("You're almost finished! 90%") val seedReminderViewTitle = SpannableString("You're almost finished! 90%") // Intentionally not yet translated
seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 24, 27, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 24, 27, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
seedReminderView.title = seedReminderViewTitle seedReminderView.title = seedReminderViewTitle
seedReminderView.subtitle = "Tap and hold the redacted words to reveal your recovery phrase, then store it safely to secure your Session ID." seedReminderView.subtitle = resources.getString(R.string.view_seed_reminder_subtitle_2)
seedReminderView.setProgress(90, false) seedReminderView.setProgress(90, false)
seedReminderView.hideContinueButton() seedReminderView.hideContinueButton()
var redactedSeed = seed var redactedSeed = seed
@ -59,10 +59,10 @@ class SeedActivity : BaseActionBarActivity() {
// region Updating // region Updating
private fun revealSeed() { private fun revealSeed() {
val seedReminderViewTitle = SpannableString("Account secured! 100%") val seedReminderViewTitle = SpannableString("Account secured! 100%") // Intentionally not yet translated
seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 17, 21, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) seedReminderViewTitle.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, theme)), 17, 21, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
seedReminderView.title = seedReminderViewTitle seedReminderView.title = seedReminderViewTitle
seedReminderView.subtitle = "Make sure to store your recovery phrase in a safe place" seedReminderView.subtitle = resources.getString(R.string.view_seed_reminder_subtitle_3)
seedReminderView.setProgress(100, true) seedReminderView.setProgress(100, true)
val seedTextViewLayoutParams = seedTextView.layoutParams as LinearLayout.LayoutParams val seedTextViewLayoutParams = seedTextView.layoutParams as LinearLayout.LayoutParams
seedTextViewLayoutParams.height = seedTextView.height seedTextViewLayoutParams.height = seedTextView.height
@ -79,7 +79,7 @@ class SeedActivity : BaseActionBarActivity() {
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("Seed", seed) val clip = ClipData.newPlainText("Seed", seed)
clipboard.primaryClip = clip clipboard.primaryClip = clip
Toast.makeText(this, R.string.activity_register_public_key_copied_message, Toast.LENGTH_SHORT).show() Toast.makeText(this, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show()
} }
// endregion // endregion
} }