Localization

This commit is contained in:
Ali 2023-07-16 18:13:43 +04:00
parent d472c7d1a9
commit 875ad20c6d
14 changed files with 101 additions and 135 deletions

View File

@ -9380,3 +9380,52 @@ Sorry for the inconvenience.";
"Conversation.StoryMentionTextIncoming" = "%@ mentioned you\nin a story";
"Conversation.StoryExpiredMentionTextOutgoing" = "The story where you mentioned %@\n is no longer available";
"Conversation.StoryExpiredMentionTextIncoming" = "The story you were mentioned in\nis no longer available";
"ChatList.ArchiveStoryCount_1" = "1 story";
"ChatList.ArchiveStoryCount_any" = "%d stories";
"Notification.Story" = "Story";
"ChatList.StoryFeedTooltip" = "Tap above to view updates\nfrom %@";
"StoryFeed.ContextAddStory" = "Add Story";
"StoryFeed.ContextSavedStories" = "Saved Stories";
"StoryFeed.ContextArchivedStories" = "Archived Stories";
"StoryFeed.ContextOpenChat" = "Send Message";
"StoryFeed.ContextOpenProfile" = "View Profile";
"StoryFeed.ContextNotifyOn" = "Notify About Stories";
"StoryFeed.ContextNotifyOff" = "Do Not Notify About Stories";
"StoryFeed.ContextArchive" = "Hide Stories";
"StoryFeed.ContextUnarchive" = "Unhide Stories";
"StoryFeed.TooltipNotifyOn" = "You will now get a notification whenever **%@** posts a story.";
"StoryFeed.TooltipNotifyOff" = "You will no longer receive a notification when **%@** posts a story.";
"StoryFeed.TooltipArchive" = "Stories from **%@** will now be shown in Archived Chats.";
"ChatList.Archive.ContextSettings" = "Archive Settings";
"ChatList.Archive.ContextInfo" = "How Does It Work?";
"ChatList.ContextSelectChats" = "Select Chats";
"StoryFeed.TooltipPremiumPosting" = "Posting stories is currently available only\nto subscribers of [Telegram Premium]().";
"StoryFeed.TooltipStoryLimitValue_1" = "1 story";
"StoryFeed.TooltipStoryLimitValue_any" = "%d stories";
"StoryFeed.TooltipStoryLimit" = "You can't post more than **%@** stories in **24 hours**.";
"MediaPicker.AddImage" = "Add Image";
"Premium.Stories" = "Story Posting";
"Premium.StoriesInfo" = "Be one of the first to share your stories with your contacts or an unlimited audience.";
"Premium.Stories.Proceed" = "Unlock Story Posting";
"AutoDownloadSettings.OnForContacts" = "On for contacts";
"AutoDownloadSettings.StoriesSectionHeader" = "AUTO-DOWNLOAD STORIES";
"AutoDownloadSettings.StoriesArchivedContacts" = "Archived Contacts";
"AutoDownloadSettings.StoriesTitle" = "Stories";
"Notifications.TopChats" = "Top 5";
"Notifications.Stories" = "Stories";
"Settings.MyStories" = "My Stories";
"Settings.StoriesArchive" = "Stories Archive";

View File

@ -1991,7 +1991,6 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.displayedStoriesTooltip = true
let absoluteFrame = anchorView.convert(anchorRect, to: self.view)
//TODO:localize
let itemList = orderedStorySubscriptions.items.prefix(3).map(\.peer.compactDisplayTitle)
var itemListString: String = itemList.joined(separator: ", ")
@ -2003,7 +2002,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
}
}
let text: String = "Tap above to view updates\nfrom \(itemListString)"
let text: String = self.presentationData.strings.ChatList_StoryFeedTooltip(itemListString).string
let tooltipController = TooltipController(content: .text(text), baseFontSize: self.presentationData.listsFontSize.baseDisplaySize, timeout: 30.0, dismissByTapOutside: true, dismissImmediatelyOnLayoutUpdate: true, padding: 6.0, innerPadding: UIEdgeInsets(top: 2.0, left: 3.0, bottom: 2.0, right: 3.0))
self.present(tooltipController, in: .current, with: TooltipControllerPresentationArguments(sourceNodeAndRect: { [weak self] in
@ -2574,9 +2573,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
let text: String
if premiumNeeded {
text = "Posting stories is currently available only\nto subscribers of [Telegram Premium]()."
text = self.presentationData.strings.StoryFeed_TooltipPremiumPosting
} else if reachedCountLimit {
text = "You can't post more than **\(storiesCountLimit)** stories in **24 hours**."
let valueText = self.presentationData.strings.StoryFeed_TooltipStoryLimitValue(Int32(storiesCountLimit))
text = self.presentationData.strings.StoryFeed_TooltipStoryLimit
} else {
text = ""
}
@ -2716,9 +2716,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
var items: [ContextMenuItem] = []
//TODO:localize
if peer.id == self.context.account.peerId {
items.append(.action(ContextMenuActionItem(text: "Add Story", icon: { theme in
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.StoryFeed_ContextAddStory, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Add"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in
c.dismiss(completion: {
@ -2730,7 +2729,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})
})))
items.append(.action(ContextMenuActionItem(text: "Saved Stories", icon: { theme in
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.StoryFeed_ContextSavedStories, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Stories"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in
c.dismiss(completion: {
@ -2742,7 +2741,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})
})))
items.append(.action(ContextMenuActionItem(text: "Archived Stories", icon: { theme in
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.StoryFeed_ContextArchivedStories, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Archive"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in
c.dismiss(completion: {
@ -2754,7 +2753,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})
})))
} else {
items.append(.action(ContextMenuActionItem(text: "Send Message", icon: { theme in
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.StoryFeed_ContextOpenChat, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MessageBubble"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in
c.dismiss(completion: {
@ -2766,7 +2765,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})
})))
items.append(.action(ContextMenuActionItem(text: "View Profile", icon: { theme in
items.append(.action(ContextMenuActionItem(text: self.presentationData.strings.StoryFeed_ContextOpenProfile, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/User"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in
c.dismiss(completion: {
@ -2790,7 +2789,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})))
let isMuted = resolvedAreStoriesMuted(globalSettings: globalSettings._asGlobalNotificationSettings(), peer: peer._asPeer(), peerSettings: notificationSettings._asNotificationSettings(), topSearchPeers: topSearchPeers)
items.append(.action(ContextMenuActionItem(text: isMuted ? "Notify About Stories" : "Do Not Notify About Stories", icon: { theme in
items.append(.action(ContextMenuActionItem(text: isMuted ? self.presentationData.strings.StoryFeed_ContextNotifyOn : self.presentationData.strings.StoryFeed_ContextNotifyOff, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: isMuted ? "Chat/Context Menu/Unmute" : "Chat/Context Menu/Muted"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, f in
f(.default)
@ -2811,7 +2810,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
"Bottom.Group 1.Fill 1": iconColor,
"EXAMPLE.Group 1.Fill 1": iconColor,
"Line.Group 1.Stroke 1": iconColor
], title: nil, text: "You will now get a notification whenever **\(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder))** posts a story.", customUndoText: nil, timeout: nil),
], title: nil, text: presentationData.strings.StoryFeed_TooltipNotifyOn(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).string, customUndoText: nil, timeout: nil),
elevatedLayout: false,
animateInAsReplacement: false,
action: { _ in return false }
@ -2825,7 +2824,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
"Bottom.Group 1.Fill 1": iconColor,
"EXAMPLE.Group 1.Fill 1": iconColor,
"Line.Group 1.Stroke 1": iconColor
], title: nil, text: "You will no longer receive a notification when **\(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder))** posts a story.", customUndoText: nil, timeout: nil),
], title: nil, text: presentationData.strings.StoryFeed_TooltipNotifyOff(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).string, customUndoText: nil, timeout: nil),
elevatedLayout: false,
animateInAsReplacement: false,
action: { _ in return false }
@ -2835,9 +2834,9 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
let hideText: String
if self.location == .chatList(groupId: .archive) {
hideText = "Unhide Stories"
hideText = self.presentationData.strings.StoryFeed_ContextUnarchive
} else {
hideText = "Hide Stories"
hideText = self.presentationData.strings.StoryFeed_ContextArchive
}
let iconName = self.location == .chatList(groupId: .archive) ? "Chat/Context Menu/Unarchive" : "Chat/Context Menu/Archive"
items.append(.action(ContextMenuActionItem(text: hideText, icon: { theme in
@ -2857,9 +2856,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
undoValue = false
}
//TODO:localize
if self.location != .chatList(groupId: .archive) {
self.present(UndoOverlayController(presentationData: self.presentationData, content: .archivedChat(peerId: peer.id.toInt64(), title: "", text: "Stories from **\(peer.compactDisplayTitle)** will now be shown in Archived Chats.", undo: true), elevatedLayout: false, position: .bottom, animateInAsReplacement: false, action: { [weak self] action in
self.present(UndoOverlayController(presentationData: self.presentationData, content: .archivedChat(peerId: peer.id.toInt64(), title: "", text: self.presentationData.strings.StoryFeed_TooltipArchive(peer.compactDisplayTitle).string, undo: true), elevatedLayout: false, position: .bottom, animateInAsReplacement: false, action: { [weak self] action in
if case .undo = action {
if let self {
self.context.engine.peers.updatePeerStoriesHidden(id: peer.id, isHidden: undoValue)
@ -2868,30 +2866,6 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
return false
}), in: .current)
}
/*guard let parentController = self.parent as? TabBarController, let contactsController = (self.navigationController as? TelegramRootControllerInterface)?.getContactsController(), let sourceFrame = parentController.frameForControllerTab(controller: contactsController) else {
return
}
let location = CGRect(origin: CGPoint(x: sourceFrame.midX, y: sourceFrame.minY + 1.0), size: CGSize())
let tooltipController = TooltipScreen(
context: self.context,
account: self.context.account,
sharedContext: self.context.sharedContext,
text: .markdown(text: "Stories from **\(peer.compactDisplayTitle)** will now be shown in Contacts, not Chats."),
icon: .peer(peer: peer, isStory: true),
action: TooltipScreen.Action(
title: "Undo",
action: { [weak self] in
if let self {
self.context.engine.peers.updatePeerStoriesHidden(id: peer.id, isHidden: false)
}
}
),
location: .point(location, .bottom),
shouldDismissOnTouch: { _, _ in return .dismiss(consume: false) }
)
self.present(tooltipController, in: .window(.root))*/
})))
}
@ -3314,8 +3288,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
var items: [ContextMenuItem] = []
//TODO:localize
items.append(.action(ContextMenuActionItem(text: "Archive Settings", icon: { theme in
items.append(.action(ContextMenuActionItem(text: presentationData.strings.ChatList_Archive_ContextSettings, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Customize"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, a in
a(.default)
@ -3327,7 +3300,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
})))
if !archiveChatList.items.isEmpty {
items.append(.action(ContextMenuActionItem(text: "How Does It Work?", icon: { theme in
items.append(.action(ContextMenuActionItem(text: presentationData.strings.ChatList_Archive_ContextInfo, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Message/Question"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, a in
a(.default)
@ -3345,7 +3318,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.push(ArchiveInfoScreen(context: self.context, settings: settings))
})
})))
items.append(.action(ContextMenuActionItem(text: "Select Chats", icon: { theme in
items.append(.action(ContextMenuActionItem(text: presentationData.strings.ChatList_ContextSelectChats, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Select"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, a in
a(.default)

View File

@ -2156,13 +2156,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
}
}
if textString.length == 0, case let .groupReference(data) = item.content, let storyState = data.storyState, storyState.stats.totalCount != 0 {
//TODO:localize
let storyText: String
if storyState.stats.totalCount == 1 {
storyText = "1 story"
} else {
storyText = "\(storyState.stats.totalCount) stories"
}
let storyText: String = item.presentationData.strings.ChatList_ArchiveStoryCount(Int32(storyState.stats.totalCount))
textString.append(NSAttributedString(string: storyText, font: textFont, textColor: theme.messageTextColor))
}
attributedText = textString

View File

@ -303,8 +303,7 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder:
messageText = strings.Conversation_StoryMentionTextOutgoing(peer.compactDisplayTitle).string
}
} else {
//TODO:localize
messageText = "Story"
messageText = strongs.Notification_Story
}
default:
break

View File

@ -31,8 +31,7 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
var items: [ContextMenuItem] = []
if isStories {
//TODO:localize
items.append(.action(ContextMenuActionItem(text: "View Profile", icon: { theme in
items.append(.action(ContextMenuActionItem(text: strings.StoryFeed_ContextOpenProfile, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/User"), color: theme.contextMenu.primaryColor)
}, action: { c, _ in
c.dismiss(completion: {
@ -50,7 +49,7 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
let isMuted = resolvedAreStoriesMuted(globalSettings: globalSettings._asGlobalNotificationSettings(), peer: peer._asPeer(), peerSettings: notificationSettings._asNotificationSettings(), topSearchPeers: topSearchPeers)
items.append(.action(ContextMenuActionItem(text: isMuted ? "Notify" : "Don't Notify", icon: { theme in
items.append(.action(ContextMenuActionItem(text: isMuted ? strings.StoryFeed_ContextNotifyOn : strings.StoryFeed_ContextNotifyOff, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: isMuted ? "Chat/Context Menu/Unmute" : "Chat/Context Menu/Muted"), color: theme.contextMenu.primaryColor)
}, action: { _, f in
f(.default)
@ -69,7 +68,7 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
"Bottom.Group 1.Fill 1": iconColor,
"EXAMPLE.Group 1.Fill 1": iconColor,
"Line.Group 1.Stroke 1": iconColor
], title: nil, text: "You will now get a notification whenever **\(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder))** posts a story.", customUndoText: nil, timeout: nil),
], title: nil, text: presentationData.strings.StoryFeed.TooltipNotifyOn(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).string, customUndoText: nil, timeout: nil),
elevatedLayout: false,
animateInAsReplacement: false,
action: { _ in return false }
@ -83,7 +82,7 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
"Bottom.Group 1.Fill 1": iconColor,
"EXAMPLE.Group 1.Fill 1": iconColor,
"Line.Group 1.Stroke 1": iconColor
], title: nil, text: "You will no longer receive a notification when **\(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder))** posts a story.", customUndoText: nil, timeout: nil),
], title: nil, text: presentationData.strings.StoryFeed.TooltipNotifyOff(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)), customUndoText: nil, timeout: nil),
elevatedLayout: false,
animateInAsReplacement: false,
action: { _ in return false }
@ -92,36 +91,12 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con
}
})))
items.append(.action(ContextMenuActionItem(text: "Move to Chats", icon: { theme in
items.append(.action(ContextMenuActionItem(text: strings.StoryFeed_ContextUnarchive, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/MoveToChats"), color: theme.contextMenu.primaryColor)
}, action: { _, f in
f(.dismissWithoutContent)
context.engine.peers.updatePeerStoriesHidden(id: peerId, isHidden: false)
guard let parentController = contactsController?.parent as? TabBarController, let chatsController = (contactsController?.navigationController as? TelegramRootControllerInterface)?.getChatsController(), let sourceFrame = parentController.frameForControllerTab(controller: chatsController) else {
return
}
do {
let location = CGRect(origin: CGPoint(x: sourceFrame.midX, y: sourceFrame.minY + 1.0), size: CGSize())
let tooltipController = TooltipScreen(
context: context,
account: context.account,
sharedContext: context.sharedContext,
text: .markdown(text: "Stories from **\(peer.compactDisplayTitle)** will now be shown in Chats, not Contacts."),
icon: .peer(peer: peer, isStory: true),
action: TooltipScreen.Action(
title: "Undo",
action: {
context.engine.peers.updatePeerStoriesHidden(id: peer.id, isHidden: true)
}
),
location: .point(location, .bottom),
shouldDismissOnTouch: { _, _ in return .dismiss(consume: false) }
)
contactsController?.present(tooltipController, in: .window(.root))
}
})))
return items

View File

@ -207,20 +207,7 @@ private enum ContactListNodeEntry: Comparable, Identifiable {
storyStats = (storyData.count, storyData.unseenCount, storyData.hasUnseenCloseFriends)
let text: String
//TODO:localize
if storyData.unseenCount != 0 {
if storyData.unseenCount == 1 {
text = "1 unseen story"
} else {
text = "\(storyData.unseenCount) unseen stories"
}
} else {
if storyData.count == 1 {
text = "1 story"
} else {
text = "\(storyData.count) stories"
}
}
text = presentationData.strings.ChatList_ArchiveStoryCount(Int32(storyData.count))
status = .custom(string: text, multiline: false, isActive: false, icon: nil)
}
@ -405,7 +392,7 @@ private func contactListNodeEntries(accountPeer: EnginePeer?, peers: [ContactLis
if addHeader {
//TODO:localize
commonHeader = ChatListSearchItemHeader(type: .text("SORTED BY LAST SEEN TIME", AnyHashable(1)), theme: theme, strings: strings, actionTitle: nil, action: nil)
commonHeader = ChatListSearchItemHeader(type: .text(strings.Contacts_SortedByPresence.uppercased(), AnyHashable(1)), theme: theme, strings: strings, actionTitle: nil, action: nil)
}
switch presentation {
@ -529,15 +516,15 @@ private func contactListNodeEntries(accountPeer: EnginePeer?, peers: [ContactLis
if let storySubscriptions {
var index: Int = 0
let _ = storySubscriptions
/*var index: Int = 0
//TODO:localize
let header: ListViewItemHeader? = ChatListSearchItemHeader(type: .text("HIDDEN STORIES", AnyHashable(0)), theme: theme, strings: strings)
for item in storySubscriptions.items {
entries.append(.peer(index, .peer(peer: item.peer._asPeer(), isGlobal: false, participantCount: nil), nil, header, .none, theme, strings, dateTimeFormat, sortOrder, displayOrder, false, true, ContactListNodeEntry.StoryData(count: item.storyCount, unseenCount: item.unseenCount, hasUnseenCloseFriends: item.hasUnseenCloseFriends)))
index += 1
}
}*/
}
var index: Int = 0

View File

@ -300,12 +300,11 @@ final class ContactsControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
let tabsNode: ASDisplayNode? = nil
let tabsNodeIsSearch = false
//TODO:localize
let primaryContent = ChatListHeaderComponent.Content(
title: "Contacts",
title: self.presentationData.strings.Contacts_Title,
navigationBackTitle: nil,
titleComponent: nil,
chatListTitle: NetworkStatusTitle(text: "Contacts", activity: false, hasProxy: false, connectsViaProxy: false, isPasscodeSet: false, isManuallyLocked: false, peerStatus: nil),
chatListTitle: NetworkStatusTitle(text: self.presentationData.strings.Contacts_Title, activity: false, hasProxy: false, connectsViaProxy: false, isPasscodeSet: false, isManuallyLocked: false, peerStatus: nil),
leftButton: AnyComponentWithIdentity(id: "sort", component: AnyComponent(NavigationButtonComponent(
content: .text(title: self.presentationData.strings.Contacts_Sort, isBold: false),
pressed: { [weak self] sourceView in

View File

@ -1445,8 +1445,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
case .wallpaper:
self.titleView.title = presentationData.strings.Conversation_Theme_ChooseWallpaperTitle
case .addImage:
//TODO:localize
self.titleView.title = "Add Image"
self.titleView.title = presentationData.strings.MediaPicker_AddImage
}
}
} else {

View File

@ -939,7 +939,6 @@ private final class DemoSheetContent: CombinedComponent {
)
)
)
//TODO:localize
availableItems[.stories] = DemoPagerComponent.Item(
AnyComponentWithIdentity(
id: PremiumDemoScreen.Subject.stories,
@ -951,8 +950,8 @@ private final class DemoSheetContent: CombinedComponent {
videoFile: configuration.videos["voice_to_text"],
decoration: .badgeStars
)),
title: "Story Posting",
text: "Be one of the first to share your stories with your contacts or an unlimited audience.",
title: strings.Premium_Stories,
text: strings.Premium_StoriesInfo,
textColor: textColor
)
)
@ -1049,8 +1048,7 @@ private final class DemoSheetContent: CombinedComponent {
case .translation:
buttonText = strings.Premium_Translation_Proceed
case .stories:
//TODO:localize
buttonText = "Unlock Story Posting"
buttonText = strings.Premium_Stories_Proceed
buttonAnimationName = "premium_unlock"
default:
buttonText = strings.Common_OK

View File

@ -395,8 +395,7 @@ enum PremiumPerk: CaseIterable {
case .translation:
return strings.Premium_Translation
case .stories:
//TODO:localize
return "Story Posting"
return strings.Premium_Stories
}
}

View File

@ -207,8 +207,7 @@ private func stringForAutomaticDownloadPeers(strings: PresentationStrings, decim
if peers.contacts && peers.otherPrivate {
return strings.AutoDownloadSettings_OnForAll
} else if peers.contacts {
//TODO:localize
return "On for contacts"
return strings.AutoDownloadSettings_OnForContacts
} else {
return strings.AutoDownloadSettings_OffForAll
}

View File

@ -274,16 +274,14 @@ private func autodownloadMediaCategoryControllerEntries(presentationData: Presen
downloadTitle = presentationData.strings.AutoDownloadSettings_AutodownloadFiles
sizeTitle = presentationData.strings.AutoDownloadSettings_MaxFileSize
case .story:
//TODO:localize
downloadTitle = "AUTO-DOWNLOAD STORIES"
downloadTitle = presentationData.strings.AutoDownloadSettings_StoriesSectionHeader
sizeTitle = presentationData.strings.AutoDownloadSettings_MaxFileSize
}
if case .story = category {
entries.append(.peerContacts(presentationData.theme, presentationData.strings.AutoDownloadSettings_Contacts, peers.contacts))
//TODO:localize
if peers.contacts {
entries.append(.peerOtherPrivate(presentationData.theme, "Hidden Contacts", peers.otherPrivate))
entries.append(.peerOtherPrivate(presentationData.theme, presentationData.strings.AutoDownloadSettings_StoriesArchivedContacts, peers.otherPrivate))
}
} else {
entries.append(.peerHeader(presentationData.theme, downloadTitle))
@ -463,15 +461,14 @@ func autodownloadMediaCategoryController(context: AccountContext, connectionType
let title: String
switch category {
case .photo:
title = presentationData.strings.AutoDownloadSettings_PhotosTitle
case .video:
title = presentationData.strings.AutoDownloadSettings_VideosTitle
case .file:
title = presentationData.strings.AutoDownloadSettings_DocumentsTitle
case .story:
//TODO:localize
title = "Stories"
case .photo:
title = presentationData.strings.AutoDownloadSettings_PhotosTitle
case .video:
title = presentationData.strings.AutoDownloadSettings_VideosTitle
case .file:
title = presentationData.strings.AutoDownloadSettings_DocumentsTitle
case .story:
title = presentationData.strings.AutoDownloadSettings_StoriesTitle
}
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false)

View File

@ -552,18 +552,17 @@ private func notificationsAndSoundsEntries(authorizationStatus: AccessType, warn
entries.append(.groupChats(presentationData.theme, presentationData.strings.Notifications_GroupChats, !exceptions.groups.isEmpty ? presentationData.strings.Notifications_CategoryExceptions(Int32(exceptions.groups.peerIds.count)) : "", globalSettings.groupChats.enabled ? presentationData.strings.Notifications_On : presentationData.strings.Notifications_Off))
entries.append(.channels(presentationData.theme, presentationData.strings.Notifications_Channels, !exceptions.channels.isEmpty ? presentationData.strings.Notifications_CategoryExceptions(Int32(exceptions.channels.peerIds.count)) : "", globalSettings.channels.enabled ? presentationData.strings.Notifications_On : presentationData.strings.Notifications_Off))
//TODO:localize
let storiesValue: String
switch globalSettings.privateChats.storySettings.mute {
case .default:
storiesValue = "Top 5"
storiesValue = presentationData.strings.Notifications_TopChats
case .muted:
storiesValue = presentationData.strings.Notifications_Off
case .unmuted:
storiesValue = presentationData.strings.Notifications_On
}
entries.append(.stories(presentationData.theme, "Stories", !exceptions.stories.isEmpty ? presentationData.strings.Notifications_CategoryExceptions(Int32(exceptions.stories.peerIds.count)) : "", storiesValue))
entries.append(.stories(presentationData.theme, presentationData.strings.Notifications_Stories, !exceptions.stories.isEmpty ? presentationData.strings.Notifications_CategoryExceptions(Int32(exceptions.stories.peerIds.count)) : "", storiesValue))
entries.append(.inAppHeader(presentationData.theme, presentationData.strings.Notifications_InAppNotifications.uppercased()))
entries.append(.inAppSounds(presentationData.theme, presentationData.strings.Notifications_InAppNotificationsSounds, inAppSettings.playSounds))

View File

@ -354,12 +354,11 @@ private func storiesSearchableItems(context: AccountContext) -> [SettingsSearcha
var result: [SettingsSearchableItem] = []
//TODO:localize
result.append(SettingsSearchableItem(id: .stories(0), title: "My Stories", alternate: synonyms(strings.SettingsSearch_Synonyms_Premium), icon: icon, breadcrumbs: [], present: { context, _, present in
result.append(SettingsSearchableItem(id: .stories(0), title: strings.Settings_MyStories, alternate: synonyms(strings.SettingsSearch_Synonyms_Premium), icon: icon, breadcrumbs: [], present: { context, _, present in
present(.push, PeerInfoStoryGridScreen(context: context, peerId: context.account.peerId, scope: .saved))
}))
result.append(SettingsSearchableItem(id: .stories(1), title: "Stories Archive", alternate: synonyms(strings.SettingsSearch_Synonyms_Premium), icon: icon, breadcrumbs: [], present: { context, _, present in
result.append(SettingsSearchableItem(id: .stories(1), title: strings.Settings_StoriesArchive, alternate: synonyms(strings.SettingsSearch_Synonyms_Premium), icon: icon, breadcrumbs: [], present: { context, _, present in
present(.push, PeerInfoStoryGridScreen(context: context, peerId: context.account.peerId, scope: .archive))
}))