From 3b62e474b37bef9530ae7e74d28312c902653b1b Mon Sep 17 00:00:00 2001 From: Al Lansley Date: Mon, 29 Jul 2024 16:33:21 +1000 Subject: [PATCH] Down to just the final few straggler strings --- .../disappearingmessages/State.kt | 2 +- .../v2/messages/EmojiReactionsView.kt | 4 +- .../database/model/ThreadRecord.java | 9 ++- .../PrivacySettingsPreferenceFragment.kt | 2 +- .../securesms/util/SaveAttachmentTask.kt | 10 +-- .../layout/activity_disappearing_messages.xml | 2 +- .../main/res/layout/fragment_create_group.xml | 2 +- .../res/layout/fragment_view_my_qr_code.xml | 77 ------------------- .../res/layout/keyboard_pager_search_bar.xml | 2 +- .../react_with_any_emoji_dialog_fragment.xml | 2 +- app/src/main/res/xml/preferences_privacy.xml | 4 +- .../src/main/res/values/strings.xml | 1 + .../src/main/res/values-ar-rSA/strings.xml | 3 - libsession/src/main/res/values-ar/strings.xml | 3 - .../src/main/res/values-az-rAZ/strings.xml | 3 - libsession/src/main/res/values-az/strings.xml | 3 - .../src/main/res/values-bal-rBA/strings.xml | 3 - .../src/main/res/values-bal/strings.xml | 3 - .../src/main/res/values-bg-rBG/strings.xml | 1 - libsession/src/main/res/values-bg/strings.xml | 1 - .../src/main/res/values-ca-rES/strings.xml | 3 - libsession/src/main/res/values-ca/strings.xml | 3 - .../src/main/res/values-cs-rCZ/strings.xml | 3 - libsession/src/main/res/values-cs/strings.xml | 3 - .../src/main/res/values-cy-rGB/strings.xml | 1 - libsession/src/main/res/values-cy/strings.xml | 1 - .../src/main/res/values-da-rDK/strings.xml | 2 - libsession/src/main/res/values-da/strings.xml | 2 - .../src/main/res/values-de-rDE/strings.xml | 3 - libsession/src/main/res/values-de/strings.xml | 3 - .../src/main/res/values-el-rGR/strings.xml | 3 - libsession/src/main/res/values-el/strings.xml | 3 - .../src/main/res/values-eo-rUY/strings.xml | 3 - libsession/src/main/res/values-eo/strings.xml | 3 - .../src/main/res/values-es-rES/strings.xml | 3 - libsession/src/main/res/values-es/strings.xml | 3 - .../src/main/res/values-et-rEE/strings.xml | 1 - libsession/src/main/res/values-et/strings.xml | 1 - .../src/main/res/values-fa-rIR/strings.xml | 4 - libsession/src/main/res/values-fa/strings.xml | 3 - .../src/main/res/values-fi-rFI/strings.xml | 3 - libsession/src/main/res/values-fi/strings.xml | 3 - .../src/main/res/values-fr-rFR/strings.xml | 4 - libsession/src/main/res/values-fr/strings.xml | 4 - .../src/main/res/values-gl-rES/strings.xml | 2 - libsession/src/main/res/values-gl/strings.xml | 2 - .../src/main/res/values-ha-rHG/strings.xml | 1 - libsession/src/main/res/values-ha/strings.xml | 1 - .../src/main/res/values-hi-rIN/strings.xml | 3 - libsession/src/main/res/values-hi/strings.xml | 3 - .../src/main/res/values-hu-rHU/strings.xml | 3 - libsession/src/main/res/values-hu/strings.xml | 3 - .../src/main/res/values-hy-rAM/strings.xml | 3 - libsession/src/main/res/values-hy/strings.xml | 3 - .../src/main/res/values-in-rID/strings.xml | 2 - libsession/src/main/res/values-in/strings.xml | 2 - .../src/main/res/values-it-rIT/strings.xml | 3 - libsession/src/main/res/values-it/strings.xml | 3 - .../src/main/res/values-iw-rIL/strings.xml | 1 - libsession/src/main/res/values-iw/strings.xml | 1 - .../src/main/res/values-ja-rJP/strings.xml | 3 - libsession/src/main/res/values-ja/strings.xml | 3 - .../src/main/res/values-km-rKH/strings.xml | 1 - libsession/src/main/res/values-km/strings.xml | 1 - .../src/main/res/values-kn-rIN/strings.xml | 1 - libsession/src/main/res/values-kn/strings.xml | 1 - .../src/main/res/values-ko-rKR/strings.xml | 1 - libsession/src/main/res/values-ko/strings.xml | 1 - .../src/main/res/values-lt-rLT/strings.xml | 2 - libsession/src/main/res/values-lt/strings.xml | 2 - .../src/main/res/values-lv-rLV/strings.xml | 1 - libsession/src/main/res/values-lv/strings.xml | 1 - .../src/main/res/values-nb-rNO/strings.xml | 3 - libsession/src/main/res/values-nb/strings.xml | 3 - .../src/main/res/values-nl-rNL/strings.xml | 3 - libsession/src/main/res/values-nl/strings.xml | 3 - .../src/main/res/values-nn-rNO/strings.xml | 1 - libsession/src/main/res/values-nn/strings.xml | 1 - .../src/main/res/values-ny-rMW/strings.xml | 1 - libsession/src/main/res/values-ny/strings.xml | 1 - .../src/main/res/values-pl-rPL/strings.xml | 3 - libsession/src/main/res/values-pl/strings.xml | 3 - .../src/main/res/values-pt-rBR/strings.xml | 3 - .../src/main/res/values-pt-rPT/strings.xml | 3 - libsession/src/main/res/values-pt/strings.xml | 3 - .../src/main/res/values-ro-rRO/strings.xml | 1 - libsession/src/main/res/values-ro/strings.xml | 1 - .../src/main/res/values-ru-rRU/strings.xml | 3 - libsession/src/main/res/values-ru/strings.xml | 3 - .../src/main/res/values-si-rLK/strings.xml | 1 - libsession/src/main/res/values-si/strings.xml | 1 - .../src/main/res/values-sk-rSK/strings.xml | 2 - libsession/src/main/res/values-sk/strings.xml | 2 - .../src/main/res/values-sq-rAL/strings.xml | 1 - libsession/src/main/res/values-sq/strings.xml | 1 - .../src/main/res/values-sr-rSP/strings.xml | 2 - libsession/src/main/res/values-sr/strings.xml | 2 - .../src/main/res/values-sv-rSE/strings.xml | 3 - libsession/src/main/res/values-sv/strings.xml | 3 - .../src/main/res/values-sw-rKE/strings.xml | 1 - .../src/main/res/values-te-rIN/strings.xml | 1 - libsession/src/main/res/values-te/strings.xml | 1 - .../src/main/res/values-th-rTH/strings.xml | 1 - libsession/src/main/res/values-th/strings.xml | 1 - .../src/main/res/values-tr-rTR/strings.xml | 3 - libsession/src/main/res/values-tr/strings.xml | 3 - .../src/main/res/values-uk-rUA/strings.xml | 3 - libsession/src/main/res/values-uk/strings.xml | 3 - .../src/main/res/values-vi-rVN/strings.xml | 3 - libsession/src/main/res/values-vi/strings.xml | 3 - .../src/main/res/values-xh-rZA/strings.xml | 1 - libsession/src/main/res/values-xh/strings.xml | 1 - .../src/main/res/values-zh-rCN/strings.xml | 3 - .../src/main/res/values-zh-rTW/strings.xml | 3 - libsession/src/main/res/values-zh/strings.xml | 3 - libsession/src/main/res/values/strings.xml | 63 +++++++-------- 116 files changed, 54 insertions(+), 356 deletions(-) delete mode 100644 app/src/main/res/layout/fragment_view_my_qr_code.xml diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/State.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/State.kt index 0fe44b02ed..6fddcbc548 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/State.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/disappearingmessages/State.kt @@ -25,7 +25,7 @@ data class State( ) { val subtitle get() = when { isGroup || isNoteToSelf -> GetString(R.string.disappearingMessagesDisappearAfterSendDescription) - else -> GetString(R.string.activity_disappearing_messages_subtitle) + else -> GetString(R.string.disappearingMessagesDescription1) } val typeOptionsHidden get() = isNoteToSelf || (isGroup && isNewConfigEnabled) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/EmojiReactionsView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/EmojiReactionsView.kt index 49e4b1044f..06b3c112d5 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/EmojiReactionsView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/EmojiReactionsView.kt @@ -11,8 +11,10 @@ import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import com.google.android.flexbox.JustifyContent +import com.squareup.phrase.Phrase import network.loki.messenger.R import network.loki.messenger.databinding.ViewEmojiReactionsBinding +import org.session.libsession.utilities.StringSubstitutionConstants.COUNT_KEY import org.session.libsession.utilities.TextSecurePreferences.Companion.getLocalNumber import org.session.libsession.utilities.ThemeUtil import org.thoughtcrime.securesms.components.emoji.EmojiImageView @@ -195,7 +197,7 @@ class EmojiReactionsView : ConstraintLayout, OnTouchListener { } else { emojiView.visibility = GONE spacer.visibility = GONE - countView.text = context.getString(R.string.ReactionsConversationView_plus, reaction.count) + countView.text = Phrase.from(context, R.string.andMore).put(COUNT_KEY, reaction.count.toInt()).format() } if (reaction.userWasSender && !isCompact) { root.background = ContextCompat.getDrawable(context, R.drawable.reaction_pill_background_selected) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/model/ThreadRecord.java b/app/src/main/java/org/thoughtcrime/securesms/database/model/ThreadRecord.java index 54cdb66932..0dd6f016b8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/model/ThreadRecord.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/model/ThreadRecord.java @@ -177,9 +177,14 @@ public class ThreadRecord extends DisplayRecord { } else if (getCount() == 0) { return new SpannableString(context.getString(R.string.messageEmpty)); } else { - // This is shown when we receive a media message from an un-accepted contact + // This block hits when we receive a media message from an unaccepted contact - however, + // unaccepted contacts aren't allowed to send us media - so we'll return an empty string + // if it's JUST an image, or the body text that accompanied the image should any exist. + // We could return null here - but then we have to find all the usages of this + // `getDisplayBody` method and make sure it doesn't fall over if it has a null result. if (TextUtils.isEmpty(getBody())) { - return new SpannableString(emphasisAdded(context.getString(R.string.mediaMessage))); + return new SpannableString(""); + // Old behaviour was: return new SpannableString(emphasisAdded(context.getString(R.string.mediaMessage))); } else { return new SpannableString(getBody()); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/PrivacySettingsPreferenceFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/PrivacySettingsPreferenceFragment.kt index aa174ee8e7..ad30b9f16b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/PrivacySettingsPreferenceFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/PrivacySettingsPreferenceFragment.kt @@ -39,7 +39,7 @@ class PrivacySettingsPreferenceFragment : ListSummaryPreferenceFragment() { .onPreferenceChangeListener = TypingIndicatorsToggleListener() findPreference(TextSecurePreferences.CALL_NOTIFICATIONS_ENABLED)!! .onPreferenceChangeListener = CallToggleListener(this) { setCall(it) } - findPreference(getString(R.string.preferences__message_requests_category))?.let { category -> + findPreference(getString(R.string.sessionMessageRequests))?.let { category -> when (val user = configFactory.user) { null -> category.isVisible = false else -> SwitchPreferenceCompat(requireContext()).apply { diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/SaveAttachmentTask.kt b/app/src/main/java/org/thoughtcrime/securesms/util/SaveAttachmentTask.kt index 584910d31d..71f09314cc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/SaveAttachmentTask.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/SaveAttachmentTask.kt @@ -49,13 +49,9 @@ class SaveAttachmentTask @JvmOverloads constructor(context: Context, count: Int context.showSessionDialog { title(R.string.permissionsRequired) iconAttribute(R.attr.dialog_alert_icon) - - // ACL TODO - Need a replacement plurals string for the below! - val txt = context.resources.getQuantityString(R.plurals.ConversationFragment_saving_n_media_to_storage_warning, count, count) - text(txt) - - button(R.string.yes) { onAcceptListener() } - button(R.string.no) + text(context.getString(R.string.attachmentsWarning)) + button(R.string.accept) { onAcceptListener() } + button(R.string.cancel) } } } diff --git a/app/src/main/res/layout/activity_disappearing_messages.xml b/app/src/main/res/layout/activity_disappearing_messages.xml index 7d5b3a55b5..461767ff43 100644 --- a/app/src/main/res/layout/activity_disappearing_messages.xml +++ b/app/src/main/res/layout/activity_disappearing_messages.xml @@ -12,7 +12,7 @@ android:layout_height="wrap_content" android:background="?colorPrimary" app:contentInsetStart="0dp" - app:subtitle="@string/activity_disappearing_messages_subtitle" + app:subtitle="@string/disappearingMessagesDescription1" app:subtitleTextAppearance="@style/TextAppearance.Session.ToolbarSubtitle" app:title="@string/disappearingMessages" /> diff --git a/app/src/main/res/layout/fragment_create_group.xml b/app/src/main/res/layout/fragment_create_group.xml index ca143f2c8f..e387684b4a 100644 --- a/app/src/main/res/layout/fragment_create_group.xml +++ b/app/src/main/res/layout/fragment_create_group.xml @@ -138,7 +138,7 @@ android:layout_width="196dp" android:layout_height="@dimen/medium_button_height" android:layout_marginVertical="@dimen/medium_spacing" - android:text="@string/activity_create_closed_group_empty_state_button_title" + android:text="@string/groupCreate" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/fragment_view_my_qr_code.xml b/app/src/main/res/layout/fragment_view_my_qr_code.xml deleted file mode 100644 index 227b1ecd7f..0000000000 --- a/app/src/main/res/layout/fragment_view_my_qr_code.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - -