diff --git a/res/layout/activity_settings.xml b/res/layout/activity_settings.xml
index a575aeb636..73a6fe5668 100644
--- a/res/layout/activity_settings.xml
+++ b/res/layout/activity_settings.xml
@@ -43,7 +43,7 @@
android:id="@+id/titleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Settings"
+ android:text="@string/activity_settings_title"
android:textColor="@color/text"
android:textSize="@dimen/very_large_font_size"
android:fontFamily="sans-serif-medium" />
@@ -94,7 +94,7 @@
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:visibility="invisible"
- android:hint="Enter a display name" />
+ android:hint="@string/activity_settings_display_name_edit_text_hint" />
+ android:text="@string/copy" />
+ android:text="@string/share" />
@@ -170,7 +170,7 @@
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
- android:text="Privacy" />
+ android:text="@string/activity_settings_privacy_button_title" />
+ android:text="@string/activity_settings_notifications_button_title" />
+ android:text="@string/activity_settings_chats_button_title" />
+ android:text="@string/activity_settings_devices_button_title" />
+ android:text="@string/activity_settings_recovery_phrase_button_title" />
+ android:text="@string/activity_settings_clear_all_data_button_title" />
@@ -24,7 +24,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/large_spacing"
- android:text="This will permanently delete your Session ID, including all messages, sessions, and contacts."
+ android:text="@string/dialog_clear_all_data_explanation"
android:textColor="@color/text"
android:textSize="@dimen/small_font_size"
android:textAlignment="center" />
@@ -41,7 +41,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/small_button_height"
android:layout_weight="1"
- android:text="Cancel" />
+ android:text="@string/cancel" />
+ android:text="@string/delete" />
diff --git a/res/layout/dialog_seed.xml b/res/layout/dialog_seed.xml
index 44fd747301..11c4076dbc 100644
--- a/res/layout/dialog_seed.xml
+++ b/res/layout/dialog_seed.xml
@@ -14,7 +14,7 @@
@@ -33,7 +33,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/large_spacing"
- android:text="This is your recovery phrase. With it, you can restore or migrate your Session ID to a new device."
+ android:text="@string/dialog_seed_explanation"
android:textColor="@color/text"
android:textSize="@dimen/small_font_size"
android:textAlignment="center"
@@ -51,7 +51,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/small_button_height"
android:layout_weight="1"
- android:text="Cancel" />
+ android:text="@string/cancel" />
+ android:text="@string/copy" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f3757fe85d..ccf59d5bee 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1680,6 +1680,7 @@
NextShareInvalid Session ID
+ CancelYour Session begins here...Create Session ID
@@ -1761,10 +1762,16 @@
Enter Session ID of recipientUsers can share their Session ID by going into their account settings and tapping "Share Session ID", or by sharing their QR code.
+ New Closed GroupEnter a group nameClosed groups support up to 10 members and provide the same privacy protections as one-on-one sessions.You don\'t have any contacts yetStart a Session
+ Please enter a group name
+ Please enter a shorter group name
+ Please pick at least 2 group members
+ A closed group cannot have more than 10 members
+ One of the members of your group has an invalid Session IDJoin Open GroupCouldn\'t join group
@@ -1775,14 +1782,38 @@
Enter an open group URLOpen groups can be joined by anyone and do not provide full privacy protection
-
-
- Contacts
- Closed Groups
- Open Groups
+ Settings
+ Enter a display name
+ Please pick a display name
+ Please pick a display name that consists of only a-z, A-Z, 0-9 and _ characters
+ Please pick a shorter display name
+ Privacy
+ Notifications
+ Chats
+ Devices
+ Recovery Phrase
+ Clear DataNotification StrategyUse FCMUsing Firebase Cloud Messaging allows for more reliable push notifications, but exposes your IP to Google.
+ Your Recovery Phrase
+ This is your recovery phrase. With it, you can restore or migrate your Session ID to a new device.
+
+ Clear All Data
+ This will permanently delete your Session ID, including all messages, sessions, and contacts.
+
+ QR Code
+ View My QR Code
+ Scan QR Code
+ Scan someone\'s QR code to start a conversation with them
+
+ This is your QR code. Other users can scan it to start a session with you.
+ Share QR Code
+
+ Contacts
+ Closed Groups
+ Open Groups
+
diff --git a/src/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt b/src/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt
index 991133d018..f0989dc29b 100644
--- a/src/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt
+++ b/src/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt
@@ -47,7 +47,7 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), MemberC
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
super.onCreate(savedInstanceState, isReady)
setContentView(R.layout.activity_create_closed_group)
- supportActionBar!!.title = "New Closed Group"
+ supportActionBar!!.title = resources.getString(R.string.activity_create_closed_group_title)
recyclerView.adapter = createClosedGroupAdapter
recyclerView.layoutManager = LinearLayoutManager(this)
createNewPrivateChatButton.setOnClickListener { createNewPrivateChat() }
@@ -103,17 +103,17 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), MemberC
private fun createClosedGroup() {
val name = nameEditText.text.trim()
if (name.isEmpty()) {
- return Toast.makeText(this, "Please enter a group name", Toast.LENGTH_LONG).show()
+ return Toast.makeText(this, R.string.activity_create_closed_group_group_name_missing_error, Toast.LENGTH_LONG).show()
}
if (name.length >= 64) {
- return Toast.makeText(this, "Please enter a shorter group name", Toast.LENGTH_LONG).show()
+ return Toast.makeText(this, R.string.activity_create_closed_group_group_name_too_long_error, Toast.LENGTH_LONG).show()
}
val selectedMembers = this.selectedMembers
if (selectedMembers.count() < 2) {
- return Toast.makeText(this, "Please pick at least 2 group members", Toast.LENGTH_LONG).show()
+ return Toast.makeText(this, R.string.activity_create_closed_group_not_enough_group_members_error, Toast.LENGTH_LONG).show()
}
if (selectedMembers.count() > 10) {
- return Toast.makeText(this, "A closed group cannot have more than 10 members", Toast.LENGTH_LONG).show()
+ return Toast.makeText(this, R.string.activity_create_closed_group_too_many_group_members_error, Toast.LENGTH_LONG).show()
}
val recipients = selectedMembers.map {
Recipient.from(this, Address.fromSerialized(it), false)
@@ -155,7 +155,7 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), MemberC
}
} else {
super.onPostExecute(result)
- Toast.makeText(activity.applicationContext, "One of the members of your group has an invalid Session ID.", Toast.LENGTH_LONG).show()
+ Toast.makeText(activity.applicationContext, R.string.activity_create_closed_group_invalid_session_id_error, Toast.LENGTH_LONG).show()
}
}
}
diff --git a/src/org/thoughtcrime/securesms/loki/activities/QRCodeActivity.kt b/src/org/thoughtcrime/securesms/loki/activities/QRCodeActivity.kt
index e84b3add0c..34fbe29756 100644
--- a/src/org/thoughtcrime/securesms/loki/activities/QRCodeActivity.kt
+++ b/src/org/thoughtcrime/securesms/loki/activities/QRCodeActivity.kt
@@ -40,7 +40,7 @@ class QRCodeActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperF
// Set content view
setContentView(R.layout.activity_qr_code)
// Set title
- supportActionBar!!.title = "QR Code"
+ supportActionBar!!.title = resources.getString(R.string.activity_qr_code_title)
// Set up view pager
viewPager.adapter = adapter
tabLayout.setupWithViewPager(viewPager)
@@ -53,7 +53,7 @@ class QRCodeActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperF
}
fun createPrivateChatIfPossible(hexEncodedPublicKey: String) {
- if (!PublicKeyValidation.isValid(hexEncodedPublicKey)) { return Toast.makeText(this, "Invalid Session ID", Toast.LENGTH_SHORT).show() }
+ if (!PublicKeyValidation.isValid(hexEncodedPublicKey)) { return Toast.makeText(this, R.string.invalid_session_id, Toast.LENGTH_SHORT).show() }
val masterHexEncodedPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(this)
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(this)
val targetHexEncodedPublicKey = if (hexEncodedPublicKey == masterHexEncodedPublicKey) userHexEncodedPublicKey else hexEncodedPublicKey
@@ -84,7 +84,7 @@ private class QRCodeActivityAdapter(val activity: QRCodeActivity) : FragmentPage
1 -> {
val result = ScanQRCodeWrapperFragment()
result.delegate = activity
- result.message = "Scan someone\'s QR code to start a conversation with them"
+ result.message = activity.resources.getString(R.string.activity_qr_code_view_scan_qr_code_explanation)
result
}
else -> throw IllegalStateException()
@@ -93,8 +93,8 @@ private class QRCodeActivityAdapter(val activity: QRCodeActivity) : FragmentPage
override fun getPageTitle(index: Int): CharSequence? {
return when (index) {
- 0 -> "View My QR Code"
- 1 -> "Scan QR Code"
+ 0 -> activity.resources.getString(R.string.activity_qr_code_view_my_qr_code_tab_title)
+ 1 -> activity.resources.getString(R.string.activity_qr_code_view_scan_qr_code_tab_title)
else -> throw IllegalStateException()
}
}
@@ -122,7 +122,7 @@ class ViewMyQRCodeFragment : Fragment() {
qrCodeImageView.setImageBitmap(qrCode)
// val explanation = SpannableStringBuilder("This is your unique public QR code. Other users can scan this to start a conversation with you.")
// explanation.setSpan(StyleSpan(Typeface.BOLD), 8, 34, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
- explanationTextView.text = "This is your QR code. Other users can scan it to start a session with you."
+ explanationTextView.text = resources.getString(R.string.fragment_view_my_qr_code_explanation)
shareButton.setOnClickListener { shareQRCode() }
}
@@ -142,7 +142,7 @@ class ViewMyQRCodeFragment : Fragment() {
intent.putExtra(Intent.EXTRA_STREAM, FileProviderUtil.getUriFor(activity!!, file))
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.type = "image/png"
- startActivity(Intent.createChooser(intent, "Share QR Code"))
+ startActivity(Intent.createChooser(intent, resources.getString(R.string.fragment_view_my_qr_code_share_title)))
}
if (RxPermissions(this).isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
proceed()
diff --git a/src/org/thoughtcrime/securesms/loki/activities/SettingsActivity.kt b/src/org/thoughtcrime/securesms/loki/activities/SettingsActivity.kt
index e3051b1039..269f0eeae7 100644
--- a/src/org/thoughtcrime/securesms/loki/activities/SettingsActivity.kt
+++ b/src/org/thoughtcrime/securesms/loki/activities/SettingsActivity.kt
@@ -215,13 +215,13 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
private fun saveDisplayName() {
val displayName = displayNameEditText.text.toString().trim()
if (displayName.isEmpty()) {
- return Toast.makeText(this, "Please pick a display name", Toast.LENGTH_SHORT).show()
+ return Toast.makeText(this, R.string.activity_settings_display_name_missing_error, Toast.LENGTH_SHORT).show()
}
if (!displayName.matches(Regex("[a-zA-Z0-9_]+"))) {
- return Toast.makeText(this, "Please pick a display name that consists of only a-z, A-Z, 0-9 and _ characters", Toast.LENGTH_SHORT).show()
+ return Toast.makeText(this, R.string.activity_settings_invalid_display_name_error, Toast.LENGTH_SHORT).show()
}
if (displayName.toByteArray().size > ProfileCipher.NAME_PADDED_LENGTH) {
- return Toast.makeText(this, "Please pick a shorter display name", Toast.LENGTH_SHORT).show()
+ return Toast.makeText(this, R.string.activity_settings_display_name_too_long_error, Toast.LENGTH_SHORT).show()
}
isEditingDisplayName = false
displayNameToBeUploaded = displayName
@@ -245,7 +245,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("Session ID", hexEncodedPublicKey)
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()
}
private fun sharePublicKey() {
diff --git a/src/org/thoughtcrime/securesms/loki/dialogs/SeedDialog.kt b/src/org/thoughtcrime/securesms/loki/dialogs/SeedDialog.kt
index 255580b3a8..3caf3d752b 100644
--- a/src/org/thoughtcrime/securesms/loki/dialogs/SeedDialog.kt
+++ b/src/org/thoughtcrime/securesms/loki/dialogs/SeedDialog.kt
@@ -45,7 +45,7 @@ class SeedDialog : DialogFragment() {
val clipboard = activity!!.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("Seed", seed)
clipboard.primaryClip = clip
- Toast.makeText(context!!, R.string.activity_register_public_key_copied_message, Toast.LENGTH_SHORT).show()
+ Toast.makeText(context!!, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show()
dismiss()
}
}
\ No newline at end of file