Skip to content

Commit cf07a3a

Browse files
added missing keys for texts
1 parent 272724a commit cf07a3a

File tree

7 files changed

+74
-20
lines changed

7 files changed

+74
-20
lines changed

Sources/StreamChatSwiftUI/ChatChannel/Composer/ComposerHelperViews.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct FilePickerDisplayView: View {
7070
Button {
7171
filePickerShown = true
7272
} label: {
73-
Text("Add more files")
73+
Text(L10n.Composer.Files.addMore)
7474
.font(fonts.bodyBold)
7575
}
7676
}
@@ -109,12 +109,12 @@ struct AssetsAccessPermissionView: View {
109109

110110
var body: some View {
111111
VStack(alignment: .center, spacing: 8) {
112-
Text("You have not granted access to the photo library.")
112+
Text(L10n.Composer.Images.noAccessLibrary)
113113
.font(fonts.body)
114114
Button {
115115
openAppPrivacySettings()
116116
} label: {
117-
Text("Change in Settings")
117+
Text(L10n.Composer.Images.accessSettings)
118118
.font(fonts.bodyBold)
119119
.multilineTextAlignment(.center)
120120
.foregroundColor(Color(colors.highlightedAccentBackground))

Sources/StreamChatSwiftUI/ChatChannel/MessageList/FileAttachmentPreview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct FileAttachmentPreview: View {
2020
NavigationView {
2121
ZStack {
2222
if error != nil {
23-
Text("Error occured while previewing the file.")
23+
Text(L10n.Message.FileAttachment.errorPreview)
2424
.font(fonts.body)
2525
.padding()
2626
} else {

Sources/StreamChatSwiftUI/ChatChannel/MessageList/GiphyBadgeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct GiphyBadgeView: View {
1414
BottomLeftView {
1515
HStack(spacing: 4) {
1616
Image(uiImage: images.commandGiphy)
17-
Text("GIPHY")
17+
Text(L10n.Message.GiphyAttachment.title)
1818
.font(fonts.bodyBold)
1919
.foregroundColor(Color(colors.staticColorText))
2020
}

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public struct ChatChannelListItem: View {
7474

7575
private var subtitleText: String {
7676
if channel.isMuted {
77-
return "Channel is muted"
77+
return L10n.Channel.Item.muted
7878
} else if let latestMessage = channel.latestMessages.first {
7979
return "\(latestMessage.author.name ?? latestMessage.author.id): \(latestMessage.textContent ?? latestMessage.text)"
8080
} else {

Sources/StreamChatSwiftUI/ChatChannelList/DefaultChannelActions.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension ChannelAction {
5959
actions.append(deleteConversation)
6060

6161
let cancel = ChannelAction(
62-
title: "Cancel",
62+
title: L10n.Alert.Actions.cancel,
6363
iconName: "xmark.circle",
6464
action: onDismiss,
6565
confirmationPopup: nil,
@@ -88,12 +88,12 @@ extension ChannelAction {
8888
}
8989
}
9090
let confirmationPopup = ConfirmationPopup(
91-
title: "Mute \(naming(for: channel))",
92-
message: "Are you sure you want to mute this \(naming(for: channel))?",
93-
buttonTitle: "Mute"
91+
title: "\(L10n.Channel.Item.mute) \(naming(for: channel))",
92+
message: "\(L10n.Alert.Actions.muteChannelTitle) \(naming(for: channel))?",
93+
buttonTitle: L10n.Channel.Item.mute
9494
)
9595
let muteUser = ChannelAction(
96-
title: "Mute \(naming(for: channel))",
96+
title: "\(L10n.Channel.Item.mute) \(naming(for: channel))",
9797
iconName: "speaker.slash",
9898
action: muteAction,
9999
confirmationPopup: confirmationPopup,
@@ -119,12 +119,12 @@ extension ChannelAction {
119119
}
120120
}
121121
let confirmationPopup = ConfirmationPopup(
122-
title: "Unmute \(naming(for: channel))",
123-
message: "Are you sure you want to unmute this \(naming(for: channel))?",
124-
buttonTitle: "Unmute"
122+
title: "\(L10n.Channel.Item.unmute) \(naming(for: channel))",
123+
message: "\(L10n.Alert.Actions.unmuteChannelTitle) \(naming(for: channel))?",
124+
buttonTitle: L10n.Channel.Item.unmute
125125
)
126126
let unmuteUser = ChannelAction(
127-
title: "Unmute \(naming(for: channel))",
127+
title: "\(L10n.Channel.Item.unmute) \(naming(for: channel))",
128128
iconName: "speaker.wave.1",
129129
action: unMuteAction,
130130
confirmationPopup: confirmationPopup,
@@ -184,12 +184,12 @@ extension ChannelAction {
184184
}
185185
}
186186
let confirmationPopup = ConfirmationPopup(
187-
title: "Leave group",
188-
message: "Are you sure you want to leave this group?",
189-
buttonTitle: "Leave"
187+
title: L10n.Alert.Actions.leaveGroupTitle,
188+
message: L10n.Alert.Actions.leaveGroupMessage,
189+
buttonTitle: L10n.Alert.Actions.leaveGroupButton
190190
)
191191
let leaveConversation = ChannelAction(
192-
title: "Leave group",
192+
title: L10n.Alert.Actions.leaveGroupTitle,
193193
iconName: "person.fill.xmark",
194194
action: leaveAction,
195195
confirmationPopup: confirmationPopup,
@@ -200,6 +200,6 @@ extension ChannelAction {
200200
}
201201

202202
private static func naming(for channel: ChatChannel) -> String {
203-
channel.isDirectMessageChannel ? "user" : "group"
203+
channel.isDirectMessageChannel ? L10n.Channel.Name.directMessage : L10n.Channel.Name.group
204204
}
205205
}

Sources/StreamChatSwiftUI/Generated/L10n.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,18 @@ internal enum L10n {
2121
internal static var deleteChannelMessage: String { L10n.tr("Localizable", "alert.actions.delete-channel-message") }
2222
/// Delete conversation
2323
internal static var deleteChannelTitle: String { L10n.tr("Localizable", "alert.actions.delete-channel-title") }
24+
/// Leave
25+
internal static var leaveGroupButton: String { L10n.tr("Localizable", "alert.actions.leave-group-button") }
26+
/// Are you sure you want to leave this group?
27+
internal static var leaveGroupMessage: String { L10n.tr("Localizable", "alert.actions.leave-group-message") }
28+
/// Leave group
29+
internal static var leaveGroupTitle: String { L10n.tr("Localizable", "alert.actions.leave-group-title") }
30+
/// Are you sure you want to mute this
31+
internal static var muteChannelTitle: String { L10n.tr("Localizable", "alert.actions.mute-channel-title") }
2432
/// Ok
2533
internal static var ok: String { L10n.tr("Localizable", "alert.actions.ok") }
34+
/// Are you sure you want to unmute this
35+
internal static var unmuteChannelTitle: String { L10n.tr("Localizable", "alert.actions.unmute-channel-title") }
2636
}
2737
internal enum Error {
2838
/// The operation couldn't be completed.
@@ -41,10 +51,16 @@ internal enum L10n {
4151
internal enum Item {
4252
/// No messages
4353
internal static var emptyMessages: String { L10n.tr("Localizable", "channel.item.empty-messages") }
54+
/// Mute
55+
internal static var mute: String { L10n.tr("Localizable", "channel.item.mute") }
56+
/// Channel is muted
57+
internal static var muted: String { L10n.tr("Localizable", "channel.item.muted") }
4458
/// are typing ...
4559
internal static var typingPlural: String { L10n.tr("Localizable", "channel.item.typing-plural") }
4660
/// is typing ...
4761
internal static var typingSingular: String { L10n.tr("Localizable", "channel.item.typing-singular") }
62+
/// Unmute
63+
internal static var unmute: String { L10n.tr("Localizable", "channel.item.unmute") }
4864
}
4965
internal enum Name {
5066
/// and
@@ -53,6 +69,10 @@ internal enum L10n {
5369
internal static func andXMore(_ p1: Any) -> String {
5470
return L10n.tr("Localizable", "channel.name.andXMore", String(describing: p1))
5571
}
72+
/// user
73+
internal static var directMessage: String { L10n.tr("Localizable", "channel.name.direct-message") }
74+
/// group
75+
internal static var group: String { L10n.tr("Localizable", "channel.name.group") }
5676
/// NoChannel
5777
internal static var missing: String { L10n.tr("Localizable", "channel.name.missing") }
5878
}
@@ -73,6 +93,16 @@ internal enum L10n {
7393
/// Also send as direct message
7494
internal static var directMessageReply: String { L10n.tr("Localizable", "composer.checkmark.direct-message-reply") }
7595
}
96+
internal enum Files {
97+
/// Add more files
98+
internal static var addMore: String { L10n.tr("Localizable", "composer.files.add-more") }
99+
}
100+
internal enum Images {
101+
/// Change in Settings
102+
internal static var accessSettings: String { L10n.tr("Localizable", "composer.images.access-settings") }
103+
/// You have not granted access to the photo library.
104+
internal static var noAccessLibrary: String { L10n.tr("Localizable", "composer.images.no-access-library") }
105+
}
76106
internal enum Picker {
77107
/// Cancel
78108
internal static var cancel: String { L10n.tr("Localizable", "composer.picker.cancel") }
@@ -183,6 +213,14 @@ internal enum L10n {
183213
internal static var confirmationTitle: String { L10n.tr("Localizable", "message.actions.flag.confirmation-title") }
184214
}
185215
}
216+
internal enum FileAttachment {
217+
/// Error occured while previewing the file.
218+
internal static var errorPreview: String { L10n.tr("Localizable", "message.file-attachment.error-preview") }
219+
}
220+
internal enum GiphyAttachment {
221+
/// GIPHY
222+
internal static var title: String { L10n.tr("Localizable", "message.giphy-attachment.title") }
223+
}
186224
internal enum Sending {
187225
/// UPLOADING FAILED
188226
internal static var attachmentUploadingFailed: String { L10n.tr("Localizable", "message.sending.attachment-uploading-failed") }

Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.strings

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"channel.item.empty-messages" = "No messages";
99
"channel.item.typing-singular" = "is typing ...";
1010
"channel.item.typing-plural" = "are typing ...";
11+
"channel.item.muted" = "Channel is muted";
12+
"channel.item.mute" = "Mute";
13+
"channel.item.unmute" = "Unmute";
14+
"channel.name.direct-message" = "user";
15+
"channel.name.group" = "group";
1116

1217
"channel.no-content.title" = "Let's start chatting";
1318
"channel.no-content.message" = "How about sending your first message to a friend?";
@@ -41,6 +46,11 @@
4146
"alert.actions.delete-channel-message" = "Are you sure you want to delete this conversation?";
4247
"alert.error.title" = "Something went wrong.";
4348
"alert.error.message" = "The operation couldn't be completed.";
49+
"alert.actions.mute-channel-title" = "Are you sure you want to mute this";
50+
"alert.actions.unmute-channel-title" = "Are you sure you want to unmute this";
51+
"alert.actions.leave-group-title" = "Leave group";
52+
"alert.actions.leave-group-message" = "Are you sure you want to leave this group?";
53+
"alert.actions.leave-group-button" = "Leave";
4454

4555
"message.only-visible-to-you" = "Only visible to you";
4656
"message.deleted-message-placeholder" = "Message deleted";
@@ -55,6 +65,9 @@
5565
"composer.picker.file" = "File";
5666
"composer.picker.media" = "Photo or Video";
5767
"composer.picker.cancel" = "Cancel";
68+
"composer.files.add-more" = "Add more files";
69+
"composer.images.no-access-library" = "You have not granted access to the photo library.";
70+
"composer.images.access-settings" = "Change in Settings";
5871

5972
"composer.suggestions.commands.header" = "Instant Commands";
6073
"message.sending.attachment-uploading-failed" = "UPLOADING FAILED";
@@ -63,6 +76,9 @@
6376
"message.title.offline" = "Offline";
6477
"message.title.group" = "%d members, %d online";
6578

79+
"message.file-attachment.error-preview" = "Error occured while previewing the file.";
80+
"message.giphy-attachment.title" = "GIPHY";
81+
6682
"current-selection" = "%d of %d";
6783

6884
"attachment.max-size-exceeded" = "Attachment size exceed the limit.";

0 commit comments

Comments
 (0)