From 9a924679c2fa47ebbde1eef3a78a678a0612617d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 23 Sep 2021 16:59:33 +0300 Subject: [PATCH] vector-im/element-ios/issues/4717 - Exposed new room name localizable string to use for empty direct messages. --- .../MatrixKitAssets.bundle/en.lproj/MatrixKit.strings | 1 + .../EventFormatter/MXKRoomNameStringLocalizations.h | 6 +----- .../EventFormatter/MXKRoomNameStringLocalizations.m | 10 ++++++++++ changelog.d/4717.change | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 changelog.d/4717.change diff --git a/MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings b/MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings index 5258f9cbb..39bc43108 100644 --- a/MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings +++ b/MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings @@ -158,6 +158,7 @@ "room_displayname_empty_room" = "Empty room"; "room_displayname_two_members" = "%@ and %@"; "room_displayname_more_than_two_members" = "%@ and %@ others"; +"room_displayname_all_other_participants_left" = "%@ (Left)"; // Settings "settings" = "Settings"; diff --git a/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.h b/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.h index 9f1a0cdef..de63937a0 100644 --- a/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.h +++ b/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.h @@ -21,10 +21,6 @@ /** The `MXKRoomNameStringLocalizations` implements localization strings for `MXRoomNameStringsLocalizable`. */ -@interface MXKRoomNameStringLocalizations : NSObject - -@property (copy, readonly, nonnull) NSString *emptyRoom; -@property (copy, readonly, nonnull) NSString *twoMembers; -@property (copy, readonly, nonnull) NSString *moreThanTwoMembers; +@interface MXKRoomNameStringLocalizations : NSObject @end diff --git a/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.m b/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.m index e748719a2..d689018e3 100644 --- a/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.m +++ b/MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizations.m @@ -18,6 +18,15 @@ #import "NSBundle+MatrixKit.h" +@interface MXKRoomNameStringLocalizations () + +@property (nonatomic, copy) NSString *emptyRoom; +@property (nonatomic, copy) NSString *twoMembers; +@property (nonatomic, copy) NSString *moreThanTwoMembers; +@property (nonatomic, copy) NSString *allOtherParticipantsLeft; + +@end + @implementation MXKRoomNameStringLocalizations - (instancetype)init @@ -28,6 +37,7 @@ - (instancetype)init _emptyRoom = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"]; _twoMembers = [NSBundle mxk_localizedStringForKey:@"room_displayname_two_members"]; _moreThanTwoMembers = [NSBundle mxk_localizedStringForKey:@"room_displayname_more_than_two_members"]; + _allOtherParticipantsLeft = [NSBundle mxk_localizedStringForKey:@"room_displayname_all_other_participants_left"]; } return self; } diff --git a/changelog.d/4717.change b/changelog.d/4717.change new file mode 100644 index 000000000..61c305227 --- /dev/null +++ b/changelog.d/4717.change @@ -0,0 +1 @@ +Exposed new room name localizable string to use for empty direct messages. \ No newline at end of file