Update localization

This commit is contained in:
Isaac 2024-04-23 13:37:42 +04:00
parent 1f4297e0db
commit 3b719ede86
8 changed files with 137 additions and 102 deletions

View File

@ -12139,3 +12139,46 @@ Sorry for the inconvenience.";
"Channel.AdminLog.ShowMoreMessages_1" = "Show %@ More Message"; "Channel.AdminLog.ShowMoreMessages_1" = "Show %@ More Message";
"Channel.AdminLog.ShowMoreMessages_any" = "Show %@ More Messages"; "Channel.AdminLog.ShowMoreMessages_any" = "Show %@ More Messages";
"CreatePoll.OptionCountFooterFormat_1" = "You can add {count} more option.";
"CreatePoll.OptionCountFooterFormat_any" = "You can add {count} more options.";
"Chat.AdminActionSheet.DeleteTitle_1" = "Delete 1 Message";
"Chat.AdminActionSheet.DeleteTitle_any" = "Delete %d Messages";
"Chat.AdminActionSheet.ReportSpam" = "Report Spam";
"Chat.AdminActionSheet.DeleteAllSingle" = "Delete All from %@";
"Chat.AdminActionSheet.DeleteAllMultiple" = "Delete All from Users";
"Chat.AdminActionSheet.BanSingle" = "Ban %@";
"Chat.AdminActionSheet.BanMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSingle" = "Ban %@";
"Chat.AdminActionSheet.RestrictMultiple" = "Ban Users";
"Chat.AdminActionSheet.RestrictSectionHeader" = "ADDITIONAL ACTIONS";
"Chat.AdminActionSheet.BanFooterSingle" = "Fully ban this user";
"Chat.AdminActionSheet.RestrictFooterSingle" = "Partially restrict this user";
"Chat.AdminActionSheet.BanFooterMultiple" = "Fully ban users";
"Chat.AdminActionSheet.RestrictFooterMultiple" = "Partially restrict users";
"Chat.AdminActionSheet.PermissionsSectionHeader" = "WHAT CAN THIS USER DO?";
"Chat.AdminActionSheet.ActionButton" = "Proceed";
"Chat.AdminAction.ToastMessagesDeletedTitleSingle" = "Message Deleted";
"Chat.AdminAction.ToastMessagesDeletedTitleMultiple" = "Messages Deleted";
"Chat.AdminAction.ToastMessagesDeletedTextSingle" = "Message Deleted.";
"Chat.AdminAction.ToastMessagesDeletedTextMultiple" = "Messages Deleted.";
"Chat.AdminAction.ToastReportedSpamText_1" = "**1** user reported for spam.";
"Chat.AdminAction.ToastReportedSpamText_any" = "**%d** users reported for spam.";
"Chat.AdminAction.ToastBannedText_1" = "**1** user banned.";
"Chat.AdminAction.ToastBannedText_any" = "**%d** users banned.";
"Chat.AdminAction.ToastRestrictedText_1" = "**1** user restricted.";
"Chat.AdminAction.ToastRestrictedText_any" = "**%d** users restricted.";
"Chat.MessageForwardInfo.StoryHeader" = "Forwarded story from";
"Chat.MessageForwardInfo.ExpiredStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.UnavailableStoryHeader" = "Expired story from";
"Chat.MessageForwardInfo.MessageHeader" = "Forwarded from";
"Chat.NavigationNoTopics" = "You have no unread topics";
"Chat.NextSuggestedChannelSwipeProgress" = "Swipe up to go to the next channel";
"Chat.NextSuggestedChannelSwipeAction" = "Release to go to the next channel";
"Chat.NextUnreadTopicSwipeProgress" = "Swipe up to go to the next topic";
"Chat.NextUnreadTopicSwipeAction" = "Release to go to the next topic";

View File

@ -688,14 +688,13 @@ final class ComposePollScreenComponent: Component {
)))) ))))
self.resetPollText = nil self.resetPollText = nil
//TODO:localize
let pollTextSectionSize = self.pollTextSection.update( let pollTextSectionSize = self.pollTextSection.update(
transition: transition, transition: transition,
component: AnyComponent(ListSectionComponent( component: AnyComponent(ListSectionComponent(
theme: environment.theme, theme: environment.theme,
header: AnyComponent(MultilineTextComponent( header: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "QUESTION", string: environment.strings.CreatePoll_TextHeader,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -716,7 +715,7 @@ final class ComposePollScreenComponent: Component {
transition.setFrame(view: pollTextSectionView, frame: pollTextSectionFrame) transition.setFrame(view: pollTextSectionView, frame: pollTextSectionFrame)
if let itemView = pollTextSectionView.itemView(id: 0) as? ListComposePollOptionComponent.View { if let itemView = pollTextSectionView.itemView(id: 0) as? ListComposePollOptionComponent.View {
itemView.updateCustomPlaceholder(value: "Ask a Question", size: itemView.bounds.size, transition: .immediate) itemView.updateCustomPlaceholder(value: environment.strings.CreatePoll_TextPlaceholder, size: itemView.bounds.size, transition: .immediate)
} }
} }
contentHeight += pollTextSectionSize.height contentHeight += pollTextSectionSize.height
@ -858,9 +857,9 @@ final class ComposePollScreenComponent: Component {
for i in 0 ..< pollOptionsSectionReadyItems.count { for i in 0 ..< pollOptionsSectionReadyItems.count {
let placeholder: String let placeholder: String
if i == pollOptionsSectionReadyItems.count - 1 { if i == pollOptionsSectionReadyItems.count - 1 {
placeholder = "Add an Option" placeholder = environment.strings.CreatePoll_AddOption
} else { } else {
placeholder = "Option" placeholder = environment.strings.CreatePoll_OptionPlaceholder
} }
if let itemView = pollOptionsSectionReadyItems[i].itemView.contents.view as? ListComposePollOptionComponent.View { if let itemView = pollOptionsSectionReadyItems[i].itemView.contents.view as? ListComposePollOptionComponent.View {
@ -886,7 +885,7 @@ final class ComposePollScreenComponent: Component {
transition: .immediate, transition: .immediate,
component: AnyComponent(MultilineTextComponent( component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "POLL OPTIONS", string: environment.strings.CreatePoll_OptionsHeader,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -937,26 +936,36 @@ final class ComposePollScreenComponent: Component {
if pollOptionsLimitReached { if pollOptionsLimitReached {
pollOptionsFooterTransition = pollOptionsFooterTransition.withAnimation(.none) pollOptionsFooterTransition = pollOptionsFooterTransition.withAnimation(.none)
pollOptionsComponent = AnyComponent(MultilineTextComponent( pollOptionsComponent = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: "You have added the maximum number of options.", font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: environment.theme.list.freeTextColor)), text: .plain(NSAttributedString(string: environment.strings.CreatePoll_AllOptionsAdded, font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), textColor: environment.theme.list.freeTextColor)),
maximumNumberOfLines: 0 maximumNumberOfLines: 0
)) ))
} else { } else {
let remainingCount = 10 - self.pollOptions.count
let rawString = environment.strings.CreatePoll_OptionCountFooterFormat(Int32(remainingCount))
var pollOptionsFooterItems: [AnimatedTextComponent.Item] = [] var pollOptionsFooterItems: [AnimatedTextComponent.Item] = []
if let range = rawString.range(of: "{count}") {
if range.lowerBound != rawString.startIndex {
pollOptionsFooterItems.append(AnimatedTextComponent.Item( pollOptionsFooterItems.append(AnimatedTextComponent.Item(
id: 0, id: 0,
isUnbreakable: true, isUnbreakable: true,
content: .text("You can add ") content: .text(String(rawString[rawString.startIndex ..< range.lowerBound]))
)) ))
}
pollOptionsFooterItems.append(AnimatedTextComponent.Item( pollOptionsFooterItems.append(AnimatedTextComponent.Item(
id: 1, id: 1,
isUnbreakable: true, isUnbreakable: true,
content: .number(10 - self.pollOptions.count, minDigits: 1) content: .number(remainingCount, minDigits: 1)
)) ))
if range.upperBound != rawString.endIndex {
pollOptionsFooterItems.append(AnimatedTextComponent.Item( pollOptionsFooterItems.append(AnimatedTextComponent.Item(
id: 2, id: 2,
isUnbreakable: true, isUnbreakable: true,
content: .text(" more options.") content: .text(String(rawString[range.upperBound ..< rawString.endIndex]))
)) ))
}
}
pollOptionsComponent = AnyComponent(AnimatedTextComponent( pollOptionsComponent = AnyComponent(AnimatedTextComponent(
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
color: environment.theme.list.freeTextColor, color: environment.theme.list.freeTextColor,
@ -997,7 +1006,7 @@ final class ComposePollScreenComponent: Component {
title: AnyComponent(VStack([ title: AnyComponent(VStack([
AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Anonymous Voting", string: environment.strings.CreatePoll_Anonymous,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1018,7 +1027,7 @@ final class ComposePollScreenComponent: Component {
title: AnyComponent(VStack([ title: AnyComponent(VStack([
AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Multiple Answers", string: environment.strings.CreatePoll_MultipleChoice,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1042,7 +1051,7 @@ final class ComposePollScreenComponent: Component {
title: AnyComponent(VStack([ title: AnyComponent(VStack([
AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent( AnyComponentWithIdentity(id: AnyHashable(0), component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Quiz Mode", string: environment.strings.CreatePoll_Quiz,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1069,7 +1078,7 @@ final class ComposePollScreenComponent: Component {
header: nil, header: nil,
footer: AnyComponent(MultilineTextComponent( footer: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Polls in Quiz Mode have one correct answer. Users can't revoke their answers.", string: environment.strings.CreatePoll_QuizInfo,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -1098,7 +1107,7 @@ final class ComposePollScreenComponent: Component {
theme: environment.theme, theme: environment.theme,
header: AnyComponent(MultilineTextComponent( header: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "EXPLANATION", string: environment.strings.CreatePoll_ExplanationHeader,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -1106,7 +1115,7 @@ final class ComposePollScreenComponent: Component {
)), )),
footer: AnyComponent(MultilineTextComponent( footer: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Users will see this comment after choosing a wrong answer, good for educational purposes.", string: environment.strings.CreatePoll_ExplanationInfo,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -1421,6 +1430,11 @@ final class ComposePollScreenComponent: Component {
if sendButtonItem.isEnabled != isValid { if sendButtonItem.isEnabled != isValid {
sendButtonItem.isEnabled = isValid sendButtonItem.isEnabled = isValid
} }
let controllerTitle = self.isQuiz ? presentationData.strings.CreatePoll_QuizTitle : presentationData.strings.CreatePoll_Title
if controller.title != controllerTitle {
controller.title = controllerTitle
}
} }
if let currentEditingTag = self.currentEditingTag, previousEditingTag !== currentEditingTag, self.currentInputMode != .keyboard { if let currentEditingTag = self.currentEditingTag, previousEditingTag !== currentEditingTag, self.currentInputMode != .keyboard {
@ -1514,12 +1528,13 @@ public class ComposePollScreen: ViewControllerComponentContainer, AttachmentCont
completion: completion completion: completion
), navigationBarAppearance: .default, theme: .default) ), navigationBarAppearance: .default, theme: .default)
//TODO:localize let presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.title = "New Poll"
self.navigationItem.setLeftBarButton(UIBarButtonItem(title: "Cancel", style: .plain, target: self, action: #selector(self.cancelPressed)), animated: false) self.title = isQuiz == true ? presentationData.strings.CreatePoll_QuizTitle : presentationData.strings.CreatePoll_Title
let sendButtonItem = UIBarButtonItem(title: "Send", style: .done, target: self, action: #selector(self.sendPressed)) self.navigationItem.setLeftBarButton(UIBarButtonItem(title: presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)), animated: false)
let sendButtonItem = UIBarButtonItem(title: presentationData.strings.CreatePoll_Create, style: .done, target: self, action: #selector(self.sendPressed))
self.sendButtonItem = sendButtonItem self.sendButtonItem = sendButtonItem
self.navigationItem.setRightBarButton(sendButtonItem, animated: false) self.navigationItem.setRightBarButton(sendButtonItem, animated: false)
sendButtonItem.isEnabled = false sendButtonItem.isEnabled = false

View File

@ -651,16 +651,16 @@ private final class AdminUserActionsSheetComponent: Component {
selectedPeers = self.optionReportSelectedPeers selectedPeers = self.optionReportSelectedPeers
isExpanded = self.isOptionReportExpanded isExpanded = self.isOptionReportExpanded
title = "Report Spam" title = environment.strings.Chat_AdminActionSheet_ReportSpam
case .deleteAll: case .deleteAll:
sectionId = "delete-all" sectionId = "delete-all"
selectedPeers = self.optionDeleteAllSelectedPeers selectedPeers = self.optionDeleteAllSelectedPeers
isExpanded = self.isOptionDeleteAllExpanded isExpanded = self.isOptionDeleteAllExpanded
if component.peers.count == 1 { if component.peers.count == 1 {
title = "Delete All from \(EnginePeer(component.peers[0].peer).compactDisplayTitle)" title = environment.strings.Chat_AdminActionSheet_DeleteAllSingle(EnginePeer(component.peers[0].peer).compactDisplayTitle).string
} else { } else {
title = "Delete All from Users" title = environment.strings.Chat_AdminActionSheet_DeleteAllMultiple
} }
case .ban: case .ban:
sectionId = "ban" sectionId = "ban"
@ -670,11 +670,11 @@ private final class AdminUserActionsSheetComponent: Component {
let banTitle: String let banTitle: String
let restrictTitle: String let restrictTitle: String
if component.peers.count == 1 { if component.peers.count == 1 {
banTitle = "Ban \(EnginePeer(component.peers[0].peer).compactDisplayTitle)" banTitle = environment.strings.Chat_AdminActionSheet_BanSingle(EnginePeer(component.peers[0].peer).compactDisplayTitle).string
restrictTitle = "Restrict \(EnginePeer(component.peers[0].peer).compactDisplayTitle)" restrictTitle = environment.strings.Chat_AdminActionSheet_RestrictSingle(EnginePeer(component.peers[0].peer).compactDisplayTitle).string
} else { } else {
banTitle = "Ban Users" banTitle = environment.strings.Chat_AdminActionSheet_BanMultiple
restrictTitle = "Restrict Users" restrictTitle = environment.strings.Chat_AdminActionSheet_RestrictMultiple
} }
title = self.isConfigurationExpanded ? restrictTitle : banTitle title = self.isConfigurationExpanded ? restrictTitle : banTitle
} }
@ -870,13 +870,7 @@ private final class AdminUserActionsSheetComponent: Component {
))) )))
} }
//TODO:localize let titleString: String = environment.strings.Chat_AdminActionSheet_DeleteTitle(Int32(component.messageCount))
let titleString: String
if component.messageCount == 1 {
titleString = "Delete 1 Message?"
} else {
titleString = "Delete \(component.messageCount) Messages?"
}
let titleSize = self.title.update( let titleSize = self.title.update(
transition: .immediate, transition: .immediate,
component: AnyComponent(MultilineTextComponent( component: AnyComponent(MultilineTextComponent(
@ -928,7 +922,7 @@ private final class AdminUserActionsSheetComponent: Component {
theme: environment.theme, theme: environment.theme,
header: AnyComponent(MultilineTextComponent( header: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "ADDITIONAL ACTIONS", string: environment.strings.Chat_AdminActionSheet_RestrictSectionHeader,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -954,11 +948,11 @@ private final class AdminUserActionsSheetComponent: Component {
let partiallyRestrictTitle: String let partiallyRestrictTitle: String
let fullyBanTitle: String let fullyBanTitle: String
if component.peers.count == 1 { if component.peers.count == 1 {
partiallyRestrictTitle = "Partially restrict this user" partiallyRestrictTitle = environment.strings.Chat_AdminActionSheet_RestrictFooterSingle
fullyBanTitle = "Fully ban this user" fullyBanTitle = environment.strings.Chat_AdminActionSheet_BanFooterSingle
} else { } else {
partiallyRestrictTitle = "Partially restrict users" partiallyRestrictTitle = environment.strings.Chat_AdminActionSheet_RestrictFooterMultiple
fullyBanTitle = "Fully ban users" fullyBanTitle = environment.strings.Chat_AdminActionSheet_BanFooterMultiple
} }
let optionsFooterSize = self.optionsFooter.update( let optionsFooterSize = self.optionsFooter.update(
@ -1029,7 +1023,7 @@ private final class AdminUserActionsSheetComponent: Component {
case .sendMessages: case .sendMessages:
itemTitle = AnyComponent(MultilineTextComponent( itemTitle = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Send Messages", string: environment.strings.Channel_BanUser_PermissionSendMessages,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1041,7 +1035,7 @@ private final class AdminUserActionsSheetComponent: Component {
itemTitle = AnyComponent(HStack([ itemTitle = AnyComponent(HStack([
AnyComponentWithIdentity(id: 0, component: AnyComponent(MultilineTextComponent( AnyComponentWithIdentity(id: 0, component: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Send Media", string: environment.strings.Channel_BanUser_PermissionSendMedia,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1056,7 +1050,7 @@ private final class AdminUserActionsSheetComponent: Component {
} else { } else {
itemTitle = AnyComponent(MultilineTextComponent( itemTitle = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Send Media", string: environment.strings.Channel_BanUser_PermissionSendMedia,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1068,7 +1062,7 @@ private final class AdminUserActionsSheetComponent: Component {
case .addUsers: case .addUsers:
itemTitle = AnyComponent(MultilineTextComponent( itemTitle = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Add Users", string: environment.strings.Channel_BanUser_PermissionAddMembers,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1078,7 +1072,7 @@ private final class AdminUserActionsSheetComponent: Component {
case .pinMessages: case .pinMessages:
itemTitle = AnyComponent(MultilineTextComponent( itemTitle = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Pin Messages", string: environment.strings.Channel_EditAdmin_PermissionPinMessages,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1088,7 +1082,7 @@ private final class AdminUserActionsSheetComponent: Component {
case .changeInfo: case .changeInfo:
itemTitle = AnyComponent(MultilineTextComponent( itemTitle = AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "Change Chat Info", string: environment.strings.Channel_BanUser_PermissionChangeGroupInfo,
font: Font.regular(presentationData.listsFontSize.baseDisplaySize), font: Font.regular(presentationData.listsFontSize.baseDisplaySize),
textColor: environment.theme.list.itemPrimaryTextColor textColor: environment.theme.list.itemPrimaryTextColor
)), )),
@ -1163,23 +1157,23 @@ private final class AdminUserActionsSheetComponent: Component {
let mediaItemTitle: String let mediaItemTitle: String
switch possibleMediaItem { switch possibleMediaItem {
case .photos: case .photos:
mediaItemTitle = "Send Photos" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendPhoto
case .videos: case .videos:
mediaItemTitle = "Send Videos" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendVideo
case .stickersAndGifs: case .stickersAndGifs:
mediaItemTitle = "Send Stickers & GIFs" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendStickersAndGifs
case .music: case .music:
mediaItemTitle = "Send Music" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendMusic
case .files: case .files:
mediaItemTitle = "Send Files" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendFile
case .voiceMessages: case .voiceMessages:
mediaItemTitle = "Send Voice Messages" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendVoiceMessage
case .videoMessages: case .videoMessages:
mediaItemTitle = "Send Video Messages" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendVideoMessage
case .links: case .links:
mediaItemTitle = "Embed Links" mediaItemTitle = environment.strings.Channel_BanUser_PermissionEmbedLinks
case .polls: case .polls:
mediaItemTitle = "Send Polls" mediaItemTitle = environment.strings.Channel_BanUser_PermissionSendPolls
default: default:
continue mediaRightsLoop continue mediaRightsLoop
} }
@ -1244,7 +1238,7 @@ private final class AdminUserActionsSheetComponent: Component {
theme: environment.theme, theme: environment.theme,
header: AnyComponent(MultilineTextComponent( header: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString( text: .plain(NSAttributedString(
string: "WHAT CAN THIS USER DO?", string: environment.strings.Chat_AdminActionSheet_PermissionsSectionHeader,
font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize), font: Font.regular(presentationData.listsFontSize.itemListBaseHeaderFontSize),
textColor: environment.theme.list.freeTextColor textColor: environment.theme.list.freeTextColor
)), )),
@ -1318,7 +1312,7 @@ private final class AdminUserActionsSheetComponent: Component {
content: AnyComponentWithIdentity( content: AnyComponentWithIdentity(
id: AnyHashable(0), id: AnyHashable(0),
component: AnyComponent(ButtonTextContentComponent( component: AnyComponent(ButtonTextContentComponent(
text: "Proceed", text: environment.strings.Chat_AdminActionSheet_ActionButton,
badge: 0, badge: 0,
textColor: environment.theme.list.itemCheckColors.foregroundColor, textColor: environment.theme.list.itemCheckColors.foregroundColor,
badgeBackground: environment.theme.list.itemCheckColors.foregroundColor, badgeBackground: environment.theme.list.itemCheckColors.foregroundColor,

View File

@ -264,21 +264,20 @@ public class ChatMessageForwardInfoNode: ASDisplayNode {
titleColor = presentationData.theme.theme.chat.message.outgoing.accentTextColor titleColor = presentationData.theme.theme.chat.message.outgoing.accentTextColor
} }
//TODO:localize
if let storyData = storyData { if let storyData = storyData {
switch storyData.storyType { switch storyData.storyType {
case .regular: case .regular:
titleString = PresentationStrings.FormattedString(string: "Forwarded story from", ranges: []) titleString = PresentationStrings.FormattedString(string: presentationData.strings.Chat_MessageForwardInfo_StoryHeader, ranges: [])
authorString = peerString authorString = peerString
case .expired: case .expired:
titleString = PresentationStrings.FormattedString(string: "Expired story from", ranges: []) titleString = PresentationStrings.FormattedString(string: presentationData.strings.Chat_MessageForwardInfo_ExpiredStoryHeader, ranges: [])
authorString = peerString authorString = peerString
case .unavailable: case .unavailable:
titleString = PresentationStrings.FormattedString(string: "Expired story from", ranges: []) titleString = PresentationStrings.FormattedString(string: presentationData.strings.Chat_MessageForwardInfo_UnavailableStoryHeader, ranges: [])
authorString = peerString authorString = peerString
} }
} else { } else {
titleString = PresentationStrings.FormattedString(string: "Forwarded from", ranges: []) titleString = PresentationStrings.FormattedString(string: presentationData.strings.Chat_MessageForwardInfo_MessageHeader, ranges: [])
authorString = peerString authorString = peerString
} }
} }
@ -309,7 +308,7 @@ public class ChatMessageForwardInfoNode: ASDisplayNode {
titleString = strings.Message_GenericForwardedPsa(peerString) titleString = strings.Message_GenericForwardedPsa(peerString)
} }
} else { } else {
titleString = PresentationStrings.FormattedString(string: "Forwarded from", ranges: []) titleString = PresentationStrings.FormattedString(string: presentationData.strings.Chat_MessageForwardInfo_MessageHeader, ranges: [])
authorString = peerString authorString = peerString
} }
} }

View File

@ -972,8 +972,7 @@ final class OverscrollContentsComponent: Component {
} else if let peer = component.peer { } else if let peer = component.peer {
titleText = peer.compactDisplayTitle titleText = peer.compactDisplayTitle
} else if component.isForumThread { } else if component.isForumThread {
//TODO:localize titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoTopics
titleText = "You have no unread topics"
} else { } else {
titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoChannels titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoChannels
} }

View File

@ -1658,7 +1658,6 @@ public extension EmojiPagerContentComponent {
let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings
//TODO:localize
let searchCategories: Signal<EmojiSearchCategories?, NoError> let searchCategories: Signal<EmojiSearchCategories?, NoError>
switch subject { switch subject {
case .groupPhotoEmojiSelection, .profilePhotoEmojiSelection: case .groupPhotoEmojiSelection, .profilePhotoEmojiSelection:

View File

@ -26,10 +26,9 @@ extension ChatControllerImpl {
return return
} }
//TODO:localize var title: String? = messageIds.count == 1 ? self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTitleSingle : self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTitleMultiple
var title: String? = messageIds.count == 1 ? "Message Deleted" : "Messages Deleted"
if !result.deleteAllFromPeers.isEmpty { if !result.deleteAllFromPeers.isEmpty {
title = "Messages Deleted" title = self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTitleMultiple
} }
var text: String = "" var text: String = ""
var undoRights: [EnginePeer.Id: InitialBannedRights] = [:] var undoRights: [EnginePeer.Id: InitialBannedRights] = [:]
@ -38,21 +37,13 @@ extension ChatControllerImpl {
if !text.isEmpty { if !text.isEmpty {
text.append("\n") text.append("\n")
} }
if result.reportSpamPeers.count == 1 { text.append(self.presentationData.strings.Chat_AdminAction_ToastReportedSpamText(Int32(result.reportSpamPeers.count)))
text.append("**1** user reported for spam.")
} else {
text.append("**\(result.reportSpamPeers.count)** users reported for spam.")
}
} }
if !result.banPeers.isEmpty { if !result.banPeers.isEmpty {
if !text.isEmpty { if !text.isEmpty {
text.append("\n") text.append("\n")
} }
if result.banPeers.count == 1 { text.append(self.presentationData.strings.Chat_AdminAction_ToastBannedText(Int32(result.banPeers.count)))
text.append("**1** user banned.")
} else {
text.append("**\(result.banPeers.count)** users banned.")
}
for id in result.banPeers { for id in result.banPeers {
if let value = initialUserBannedRights[id] { if let value = initialUserBannedRights[id] {
undoRights[id] = value undoRights[id] = value
@ -63,11 +54,7 @@ extension ChatControllerImpl {
if !text.isEmpty { if !text.isEmpty {
text.append("\n") text.append("\n")
} }
if result.updateBannedRights.count == 1 { text.append(self.presentationData.strings.Chat_AdminAction_ToastRestrictedText(Int32(result.updateBannedRights.count)))
text.append("**1** user restricted.")
} else {
text.append("**\(result.updateBannedRights.count)** users restricted.")
}
for (id, _) in result.updateBannedRights { for (id, _) in result.updateBannedRights {
if let value = initialUserBannedRights[id] { if let value = initialUserBannedRights[id] {
undoRights[id] = value undoRights[id] = value
@ -97,9 +84,9 @@ extension ChatControllerImpl {
} }
if text.isEmpty { if text.isEmpty {
text = messageIds.count == 1 ? "Message Deleted." : "Messages Deleted." text = messageIds.count == 1 ? self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTextSingle : self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTextMultiple
if !result.deleteAllFromPeers.isEmpty { if !result.deleteAllFromPeers.isEmpty {
text = "Messages Deleted." text = self.presentationData.strings.Chat_AdminAction_ToastMessagesDeletedTextMultiple
} }
title = nil title = nil
} }

View File

@ -2243,12 +2243,11 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
switch nextChannelToRead.location { switch nextChannelToRead.location {
case .same: case .same:
if let controllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, let chatController = controllerNode.interfaceInteraction?.chatController() as? ChatControllerImpl, chatController.customChatNavigationStack != nil { if let controllerNode = self.controllerInteraction.chatControllerNode() as? ChatControllerNode, let chatController = controllerNode.interfaceInteraction?.chatController() as? ChatControllerImpl, chatController.customChatNavigationStack != nil {
//TODO:localize swipeText = (self.currentPresentationData.strings.Chat_NextSuggestedChannelSwipeProgress, [])
swipeText = ("Pull up to go to the next channel", []) releaseText = (self.currentPresentationData.strings.Chat_NextSuggestedChannelSwipeAction, [])
releaseText = ("Release to go to the next channel", [])
} else if nextChannelToRead.threadData != nil { } else if nextChannelToRead.threadData != nil {
swipeText = ("Pull up to go to the next topic", []) swipeText = (self.currentPresentationData.strings.Chat_NextUnreadTopicSwipeProgress, [])
releaseText = ("Release to go to the next topic", []) releaseText = (self.currentPresentationData.strings.Chat_NextUnreadTopicSwipeAction, [])
} else { } else {
swipeText = (self.currentPresentationData.strings.Chat_NextChannelSameLocationSwipeProgress, []) swipeText = (self.currentPresentationData.strings.Chat_NextChannelSameLocationSwipeProgress, [])
releaseText = (self.currentPresentationData.strings.Chat_NextChannelSameLocationSwipeAction, []) releaseText = (self.currentPresentationData.strings.Chat_NextChannelSameLocationSwipeAction, [])