This commit is contained in:
Al Lansley 2024-08-05 10:45:05 +10:00
parent bc94cb78db
commit 6948d64fa8
8 changed files with 37 additions and 48 deletions

View File

@ -256,7 +256,7 @@ public class AttachmentManager {
String needStoragePermissionTxt = Phrase.from(c, R.string.permissionsStorageSend)
.put(APP_NAME_KEY, c.getString(R.string.sessionMessenger))
.format().toString();
String storagePermissionDeniedTxt = Phrase.from(c, R.string.cameraGrantAccessStorageDenied)
String storagePermissionDeniedTxt = Phrase.from(c, R.string.permissionsStorageSaveDenied)
.put(APP_NAME_KEY, c.getString(R.string.sessionMessenger))
.format().toString();

View File

@ -35,7 +35,7 @@
android:layout_marginTop="@dimen/large_spacing"
android:contentDescription="@string/AccessibilityId_account_id_input"
android:gravity="center_vertical"
android:hint="@string/accountIdEnterYourFriends"
android:hint="@string/accountIdOrOnsEnter"
android:imeOptions="actionDone"
android:inputType="textMultiLine"
android:maxLines="3"

View File

@ -27,7 +27,7 @@
app:showAsAction="never" />
<item
android:title="@string/messageCopy"
android:title="@string/copy"
android:id="@+id/menu_context_copy"
android:icon="?menu_copy_icon"
app:showAsAction="always" />

View File

@ -42,10 +42,8 @@ object UpdateMessageBuilder {
return when (updateData) {
// --- Group created or joined ---
is UpdateMessageData.Kind.GroupCreation -> {
if (isOutgoing) context.getString(R.string.disappearingMessagesNewGroup)
else Phrase.from(context, R.string.disappearingMessagesAddedYou)
.put(NAME_KEY, senderName)
.format().toString()
if (!isOutgoing) context.getString(R.string.groupInviteYou)
else "" // We no longer add a string like `disappearingMessagesNewGroup` ("You created a new group") and leave the group with its default empty state
}
// --- Group name changed ---
@ -56,8 +54,7 @@ object UpdateMessageBuilder {
.format().toString()
}
else {
Phrase.from(context, R.string.groupNameUpdatedBy)
.put(NAME_KEY, senderName)
Phrase.from(context, R.string.groupNameNew)
.put(GROUP_NAME_KEY, updateData.name)
.format().toString()
}
@ -65,20 +62,36 @@ object UpdateMessageBuilder {
// --- Group member(s) were added ---
is UpdateMessageData.Kind.GroupMemberAdded -> {
val members = updateData.updatedMembers.joinToString(", ", transform = ::getSenderName)
// You added these members
if (isOutgoing) {
Phrase.from(context, R.string.groupYouAdded)
.put(MEMBERS_KEY, members)
.format().toString()
}
// Someone else added these members
else {
Phrase.from(context, R.string.groupNameAdded)
.put(NAME_KEY,senderName)
.put(MEMBERS_KEY, members)
.format().toString()
val newMemberCount = updateData.updatedMembers.size
//val members = updateData.updatedMembers.joinToString(", ", transform = ::getSenderName)
// We previously differentiated between members added by us Vs. members added by someone
// else via checking against `isOutgoing` - but now we use the same strings regardless.
when (newMemberCount) {
0 -> {
Log.w(TAG, "Somehow asked to add zero new members to group - this should never happen.")
return ""
}
1 -> {
Phrase.from(context, R.string.groupMemberNew)
.put(NAME_KEY, updateData.updatedMembers.elementAtOrNull(0))
.format().toString()
}
2 -> {
Phrase.from(context, R.string.groupMemberTwoNew)
.put(NAME_KEY, updateData.updatedMembers.elementAtOrNull(0))
.put(OTHER_NAME_KEY, updateData.updatedMembers.elementAtOrNull(1))
.format().toString()
}
else -> {
val newMemberCountMinusOne = newMemberCount - 1
Phrase.from(context, R.string.groupMemberMoreNew)
.put(NAME_KEY, updateData.updatedMembers.elementAtOrNull(0))
.put(COUNT_KEY, newMemberCountMinusOne)
.format().toString()
}
}
}
@ -217,7 +230,7 @@ object UpdateMessageBuilder {
.format().toString()
} else // 1-on-1 conversation
{
Phrase.from(context, R.string.disappearingMessagesUpdatedYours)
Phrase.from(context, R.string.disappearingMessagesSetYou)
.put(TIME_KEY, time)
.put(DISAPPEARING_MESSAGES_TYPE_KEY, action)
.format().toString()

View File

@ -146,7 +146,7 @@ class RecipientProvider {
return new RecipientDetails(title, avatarId, false, false, settings.orNull(), members);
}
return new RecipientDetails(context.getString(R.string.groupUnnamed), null, false, false, settings.orNull(), null);
return new RecipientDetails(context.getString(R.string.groupUnknown), null, false, false, settings.orNull(), null);
}
static class RecipientDetails {

View File

@ -1,16 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- MessageRecord -->
<string name="disappearingMessagesNewGroup">Vous avez créé un nouveau groupe.</string>
<string name="disappearingMessagesAddedYou">%1$s vous a ajouté·e dans le groupe.</string>
<string name="groupNameUpdatedBy">{name} a renommé le groupe en : {group_name}</string>
<string name="groupYouAdded">Vous avez ajouté {members} au groupe.</string>
<string name="groupNameAdded">%1$s a ajouté %2$s au groupe.</string>
<string name="you">Vous</string>
<!-- RecipientProvider -->
<string name="groupUnnamed">Groupe sans nom</string>
<string name="yes">Oui</string>
<string name="no">Non</string>
<string name="delete">Supprimer</string>

View File

@ -1,16 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- MessageRecord -->
<string name="disappearingMessagesNewGroup">Vous avez créé un nouveau groupe.</string>
<string name="disappearingMessagesAddedYou">%1$s vous a ajouté·e dans le groupe.</string>
<string name="groupNameUpdatedBy">{name} a renommé le groupe en : {group_name}</string>
<string name="groupYouAdded">Vous avez ajouté {members} au groupe.</string>
<string name="groupNameAdded">%1$s a ajouté %2$s au groupe.</string>
<string name="you">Vous</string>
<!-- RecipientProvider -->
<string name="groupUnnamed">Groupe sans nom</string>
<string name="yes">Oui</string>
<string name="no">Non</string>
<string name="delete">Supprimer</string>

View File

@ -72,7 +72,6 @@
<string name="accept">Accept</string>
<string name="accountIdCopy">Copy Account ID</string>
<string name="accountIdEnter">Enter Account ID</string>
<string name="accountIdEnterYourFriends">Enter your friend\'s Account ID or ONS</string>
<string name="accountIdErrorInvalid">This Account ID is invalid. Please check and try again.</string>
<string name="accountIdOrOnsEnter">Enter Account ID or ONS</string>
<string name="accountIdOrOnsInvite">Invite Account ID or ONS</string>
@ -208,7 +207,6 @@
<string name="cameraGrantAccessDenied">{app_name} needs camera access to take photos and videos, but it has been permanently denied. Please continue to app settings, select \"Permissions\", and enable \"Camera\".</string>
<string name="cameraGrantAccessDescription">{app_name} needs camera access to take photos and videos, or scan QR codes.</string>
<string name="cameraGrantAccessQr">{app_name} needs camera access to scan QR codes</string>
<string name="cameraGrantAccessStorageDenied">{app_name} needs storage access to send photos and videos, but it has been permanently denied. Please continue to app settings, select "Permissions", and enable "Storage".</string>
<string name="cancel">Cancel</string>
<string name="clear">Clear</string>
<string name="clearAll">Clear All</string>
@ -307,7 +305,6 @@
<string name="deleting">Deleting</string>
<string name="developerToolsToggle">Toggle Developer Tools</string>
<string name="disappearingMessages">Disappearing Messages</string>
<string name="disappearingMessagesAddedYou">{name} added you to the group.</string>
<string name="disappearingMessagesCountdownBigMobile">Auto-deletes in {time_large}</string>
<string name="disappearingMessagesCountdownBigSmallMobile">Auto-deletes in {time_large} {time_small}</string>
<string name="disappearingMessagesDeleteType">Delete Type</string>
@ -322,7 +319,6 @@
<string name="disappearingMessagesFollowSettingOff">Set your messages to disappear <b>{time}</b> after they have been <b>{disappearing_messages_type}</b>?</string>
<string name="disappearingMessagesFollowSettingOn">Set your messages to disappear <b>{time}</b> after they have been <b>{disappearing_messages_type}</b>?</string>
<string name="disappearingMessagesLegacy">{name} is using an outdated client. Disappearing messages may not work as expected.</string>
<string name="disappearingMessagesNewGroup">You created a new group.</string>
<string name="disappearingMessagesOnlyAdmins">Only group admins can change this setting.</string>
<string name="disappearingMessagesSent">Sent</string>
<string name="disappearingMessagesSet"><b>{name}</b> has set messages to disappear {time} after they have been {disappearing_messages_type}.</string>
@ -334,7 +330,6 @@
<string name="disappearingMessagesTypeSent">sent</string>
<string name="disappearingMessagesUpdated"><b>{admin_name}</b> updated disappearing message settings.</string>
<string name="disappearingMessagesUpdatedYou"><b>You</b> updated disappearing message settings.</string>
<string name="disappearingMessagesUpdatedYours">You set your messages to disappear {time} after they have been {disappearing_messages_type}.</string>
<string name="dismiss">Dismiss</string>
<string name="displayNameDescription">It can be your real name, an alias, or anything else you like — and you can change it at any time.</string>
<string name="displayNameEnter">Enter your display name</string>
@ -412,13 +407,11 @@
<string name="groupMembers">Group Members</string>
<string name="groupMembersNone">There are no other members in this group.</string>
<string name="groupName">Group Name</string>
<string name="groupNameAdded">{name} added {members} to the group.</string>
<string name="groupNameEnter">Enter a group name</string>
<string name="groupNameEnterPlease">Please enter a group name.</string>
<string name="groupNameEnterShorter">Please enter a shorter group name.</string>
<string name="groupNameNew">Group name is now {group_name}.</string>
<string name="groupNameUpdated">Group name updated.</string>
<string name="groupNameUpdatedBy">{name} renamed the group to: {group_name}</string>
<string name="groupNoMessages">You have no messages from <b>{group_name}</b>. Send a message to start the conversation!</string>
<string name="groupOnlyAdmin">You are the only admin in <b>{group_name}</b>.\nGroup members and settings cannot be changed without an admin.</string>
<string name="groupPromotedYou"><b>You</b> were promoted to Admin.</string>
@ -435,9 +428,7 @@
<string name="groupRemovedYou">You were removed from <b>{group_name}</b>.</string>
<string name="groupSetDisplayPicture">Set Group Display Picture</string>
<string name="groupUnknown">Unknown Group</string>
<string name="groupUnnamed">Unnamed group</string>
<string name="groupUpdated">Group updated</string>
<string name="groupYouAdded">You added {members} to the group.</string>
<string name="helpFAQ">FAQ</string>
<string name="helpHelpUsTranslateSession">Help us translate {app_name}</string>
<string name="helpReportABug">Report a bug</string>
@ -491,7 +482,6 @@
<string name="membersInviteShareTwoDescription">Would you like to share group message history with <b>{name}</b> and <b>{other_name}</b>?</string>
<string name="membersInviteTitle">Invite</string>
<string name="message">Message</string>
<string name="messageCopy">Copy message</string>
<string name="messageEmpty">This message is empty.</string>
<string name="messageErrorDelivery">Message delivery failed</string>
<string name="messageErrorLimit">Message limit reached</string>