Localization

This commit is contained in:
Ali 2023-07-20 13:08:44 +04:00
parent 541f335cac
commit b7972466bf
7 changed files with 25 additions and 19 deletions

View File

@ -9400,7 +9400,7 @@ Sorry for the inconvenience.";
"StoryFeed.ContextSavedStories" = "Saved Stories";
"StoryFeed.ContextArchivedStories" = "Archived Stories";
"StoryFeed.ContextOpenChat" = "Send Message";
"StoryFeed.ContextOpenProfile" = "View Profile";
"StoryFeed.ContextOpenProfile" = "Open Profile";
"StoryFeed.ContextNotifyOn" = "Notify About Stories";
"StoryFeed.ContextNotifyOff" = "Do Not Notify About Stories";
"StoryFeed.ContextArchive" = "Hide Stories";
@ -9456,6 +9456,7 @@ Sorry for the inconvenience.";
"ArchiveSettings.UnknownChatsFooter" = "Automatically archive and mute new private chats, groups and channels from non-contacts.";
"ArchiveSettings.KeepArchived" = "Always Keep Archived";
"ArchiveSettings.AutomaticallyArchive" = "Automatically Archive";
"ArchiveSettings.TooltipPremiumRequired" = "This setting is available only to the subscribers of [Telegram Premium]().";
"NotificationSettings.Stories.ShowAll" = "Show All Notifications";
@ -9552,7 +9553,7 @@ Sorry for the inconvenience.";
"Story.ContextDeleteStory" = "Delete Story";
"Story.TooltipPrivacyCloseFriends" = "You are seeing this story because you have\nbeen added to %@'s list of close friends.";
"Story.TooltipPrivacyCloseFriends" = "You are seeing this story because %@ added you\nto their list of Close Friends.";
"Story.TooltipPrivacyContacts" = "Only %@'s contacts can view this story.";
"Story.TooltipPrivacySelectedContacts" = "Only some contacts %@ selected can view this story.";
@ -9622,7 +9623,7 @@ Sorry for the inconvenience.";
"Story.Editor.DraftDiscardDraft" = "Discard Draft?";
"Story.Editor.DraftKeepMedia" = "Save Draft";
"Story.Editor.DraftKeepDraft" = "Keep Draft";
"Story.Editor.DraftDiscaedText" = "If you go back now, you will lose any changes that you've made.";
"Story.Editor.DraftDiscaedText" = "If you go back now, you will lose any changes you made.";
"Story.Editor.DraftDiscard" = "Discard";
"Story.Editor.ExpirationText" = "Choose how long the story will be visible.";
@ -9684,7 +9685,7 @@ Sorry for the inconvenience.";
"Story.Privacy.TooltipStoryArchived" = "Users allowed to view your story will see it on your page even after it expires.";
"Story.Privacy.TooltipStoryExpires" = "The story will disappear after it expires.";
"Story.Privacy.WhoCanViewHeader" = "WHO CAN VIEW";
"Story.Privacy.WhoCanViewHeader" = "WHO CAN VIEW THIS STORY";
"Story.Privacy.ContactsHeader" = "CONTACTS";
"Story.Privacy.SearchChats" = "Search Chats";
@ -9716,3 +9717,6 @@ Sorry for the inconvenience.";
"Story.Privacy.SaveSettings" = "Save Settings";
"Story.Privacy.PostStory" = "Post Story";
"AutoDownloadSettings.Stories" = "Stories";
"MediaEditor.Draft" = "Draft";

View File

@ -28,16 +28,18 @@ final class MediaPickerGridItem: GridItem {
let content: MediaPickerGridItemContent
let interaction: MediaPickerInteraction
let theme: PresentationTheme
let strings: PresentationStrings
let selectable: Bool
let enableAnimations: Bool
let stories: Bool
let section: GridSection? = nil
init(content: MediaPickerGridItemContent, interaction: MediaPickerInteraction, theme: PresentationTheme, selectable: Bool, enableAnimations: Bool, stories: Bool) {
init(content: MediaPickerGridItemContent, interaction: MediaPickerInteraction, theme: PresentationTheme, strings: PresentationStrings, selectable: Bool, enableAnimations: Bool, stories: Bool) {
self.content = content
self.interaction = interaction
self.theme = theme
self.strings = strings
self.selectable = selectable
self.enableAnimations = enableAnimations
self.stories = stories
@ -55,7 +57,7 @@ final class MediaPickerGridItem: GridItem {
return node
case let .draft(draft, index):
let node = MediaPickerGridItemNode()
node.setup(interaction: self.interaction, draft: draft, index: index, theme: self.theme, selectable: self.selectable, enableAnimations: self.enableAnimations, stories: self.stories)
node.setup(interaction: self.interaction, draft: draft, index: index, theme: self.theme, strings: self.strings, selectable: self.selectable, enableAnimations: self.enableAnimations, stories: self.stories)
return node
}
}
@ -71,7 +73,7 @@ final class MediaPickerGridItem: GridItem {
case let .media(media, index):
node.setup(interaction: self.interaction, media: media, index: index, theme: self.theme, selectable: self.selectable, enableAnimations: self.enableAnimations, stories: self.stories)
case let .draft(draft, index):
node.setup(interaction: self.interaction, draft: draft, index: index, theme: self.theme, selectable: self.selectable, enableAnimations: self.enableAnimations, stories: self.stories)
node.setup(interaction: self.interaction, draft: draft, index: index, theme: self.theme, strings: self.strings, selectable: self.selectable, enableAnimations: self.enableAnimations, stories: self.stories)
}
}
}
@ -287,7 +289,7 @@ final class MediaPickerGridItemNode: GridItemNode {
}
}
func setup(interaction: MediaPickerInteraction, draft: MediaEditorDraft, index: Int, theme: PresentationTheme, selectable: Bool, enableAnimations: Bool, stories: Bool) {
func setup(interaction: MediaPickerInteraction, draft: MediaEditorDraft, index: Int, theme: PresentationTheme, strings: PresentationStrings, selectable: Bool, enableAnimations: Bool, stories: Bool) {
self.interaction = interaction
self.theme = theme
self.selectable = selectable
@ -310,7 +312,7 @@ final class MediaPickerGridItemNode: GridItemNode {
}
if self.draftNode.supernode == nil {
self.draftNode.attributedText = NSAttributedString(string: "Draft", font: Font.semibold(12.0), textColor: .white)
self.draftNode.attributedText = NSAttributedString(string: strings.MediaEditor_Draft, font: Font.semibold(12.0), textColor: .white)
self.addSubnode(self.draftNode)
}

View File

@ -61,8 +61,8 @@ private struct MediaPickerGridEntry: Comparable, Identifiable {
return lhs.stableId < rhs.stableId
}
func item(context: AccountContext, interaction: MediaPickerInteraction, theme: PresentationTheme) -> MediaPickerGridItem {
return MediaPickerGridItem(content: self.content, interaction: interaction, theme: theme, selectable: self.selectable, enableAnimations: context.sharedContext.energyUsageSettings.fullTranslucency, stories: self.stories)
func item(context: AccountContext, interaction: MediaPickerInteraction, theme: PresentationTheme, strings: PresentationStrings) -> MediaPickerGridItem {
return MediaPickerGridItem(content: self.content, interaction: interaction, theme: theme, strings: strings, selectable: self.selectable, enableAnimations: context.sharedContext.energyUsageSettings.fullTranslucency, stories: self.stories)
}
}
@ -72,12 +72,12 @@ private struct MediaPickerGridTransaction {
let updates: [GridNodeUpdateItem]
let scrollToItem: GridNodeScrollToItem?
init(previousList: [MediaPickerGridEntry], list: [MediaPickerGridEntry], context: AccountContext, interaction: MediaPickerInteraction, theme: PresentationTheme, scrollToItem: GridNodeScrollToItem?) {
init(previousList: [MediaPickerGridEntry], list: [MediaPickerGridEntry], context: AccountContext, interaction: MediaPickerInteraction, theme: PresentationTheme, strings: PresentationStrings, scrollToItem: GridNodeScrollToItem?) {
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: previousList, rightList: list)
self.deletions = deleteIndices
self.insertions = indicesAndItems.map { GridNodeInsertItem(index: $0.0, item: $0.1.item(context: context, interaction: interaction, theme: theme), previousIndex: $0.2) }
self.updates = updateIndices.map { GridNodeUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, interaction: interaction, theme: theme)) }
self.insertions = indicesAndItems.map { GridNodeInsertItem(index: $0.0, item: $0.1.item(context: context, interaction: interaction, theme: theme, strings: strings), previousIndex: $0.2) }
self.updates = updateIndices.map { GridNodeUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, interaction: interaction, theme: theme, strings: strings)) }
self.scrollToItem = scrollToItem
}
@ -671,7 +671,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
scrollToItem = GridNodeScrollToItem(index: entries.count - 1, position: .bottom(0.0), transition: .immediate, directionHint: .down, adjustForSection: false)
}
let transaction = MediaPickerGridTransaction(previousList: previousEntries, list: entries, context: controller.context, interaction: interaction, theme: self.presentationData.theme, scrollToItem: scrollToItem)
let transaction = MediaPickerGridTransaction(previousList: previousEntries, list: entries, context: controller.context, interaction: interaction, theme: self.presentationData.theme, strings: self.presentationData.strings, scrollToItem: scrollToItem)
self.enqueueTransaction(transaction)
if !self.didSetReady {

View File

@ -105,7 +105,7 @@ private enum ArchiveSettingsControllerEntry: ItemListNodeEntry {
case .unknownHeader:
return ItemListSectionHeaderItem(presentationData: presentationData, text: presentationData.strings.ArchiveSettings_UnknownChatsHeader, sectionId: self.section)
case let .unknownValue(isOn, isLocked):
return ItemListSwitchItem(presentationData: presentationData, title: presentationData.strings.ArchiveSettings_KeepArchived, value: isOn, enableInteractiveChanges: !isLocked, enabled: true, displayLocked: isLocked, sectionId: self.section, style: .blocks, updated: { value in
return ItemListSwitchItem(presentationData: presentationData, title: presentationData.strings.ArchiveSettings_AutomaticallyArchive, value: isOn, enableInteractiveChanges: !isLocked, enabled: true, displayLocked: isLocked, sectionId: self.section, style: .blocks, updated: { value in
arguments.updateUnknown(value)
}, activatedWhileDisabled: {
arguments.updateUnknown(nil)

View File

@ -292,7 +292,7 @@ private func autodownloadMediaConnectionTypeControllerEntries(presentationData:
entries.append(.typesHeader(presentationData.theme, presentationData.strings.AutoDownloadSettings_MediaTypes))
entries.append(.photos(presentationData.theme, presentationData.strings.AutoDownloadSettings_Photos, stringForAutomaticDownloadPeers(strings: presentationData.strings, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, peers: photo, category: .photo), master))
entries.append(.stories(presentationData.theme, "Stories", stringForAutomaticDownloadPeers(strings: presentationData.strings, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, peers: stories, category: .story), master))
entries.append(.stories(presentationData.theme, presentationData.strings.AutoDownloadSettings_Stories, stringForAutomaticDownloadPeers(strings: presentationData.strings, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, peers: stories, category: .story), master))
entries.append(.videos(presentationData.theme, presentationData.strings.AutoDownloadSettings_Videos, stringForAutomaticDownloadPeers(strings: presentationData.strings, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, peers: video, category: .video), master))
entries.append(.files(presentationData.theme, presentationData.strings.AutoDownloadSettings_Files, stringForAutomaticDownloadPeers(strings: presentationData.strings, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, peers: file, category: .file), master))
entries.append(.voiceMessagesInfo(presentationData.theme, presentationData.strings.AutoDownloadSettings_VoiceMessagesInfo))

View File

@ -817,7 +817,7 @@ public final class StoryPeerListComponent: Component {
}
//print("overscrollStage2: \(overscrollStage2)")
if let overscrollFocusIndex, overscrollStage2 >= 1.25 {
if let overscrollFocusIndex, overscrollStage2 >= 1.19 {
self.overscrollSelectedId = self.sortedItems[overscrollFocusIndex].peer.id
} else {
self.overscrollSelectedId = nil

View File

@ -12247,7 +12247,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
@objc func rightNavigationButtonAction() {
if let button = self.rightNavigationButton {
if case let .peer(peerId) = self.chatLocation, case .openChatInfo(expandAvatar: true) = button.action, let storyStats = self.storyStats, storyStats.totalCount != 0, let avatarNode = self.avatarNode {
if case let .peer(peerId) = self.chatLocation, case .openChatInfo(expandAvatar: true) = button.action, let storyStats = self.storyStats, storyStats.unseenCount != 0, let avatarNode = self.avatarNode {
self.openStories(peerId: peerId, avatarHeaderNode: nil, avatarNode: avatarNode.avatarNode)
} else {
self.navigationButtonAction(button.action)