Update localization

This commit is contained in:
Ali 2021-08-29 23:28:32 +04:00
parent 9ee7988147
commit e2683c509a
5 changed files with 27 additions and 10 deletions

View File

@ -2696,6 +2696,7 @@ Unused sets are archived when you add more.";
"Conversation.ViewChannel" = "VIEW CHANNEL";
"Conversation.ViewGroup" = "VIEW GROUP";
"Conversation.ViewBot" = "VIEW BOT";
"GroupInfo.ActionPromote" = "Promote";
"GroupInfo.ActionRestrict" = "Restrict";
@ -5719,7 +5720,7 @@ Sorry for the inconvenience.";
"VoiceChat.PanelJoin" = "Join";
"VoiceChat.Title" = "Voice Chat";
"VoiceChatChannel.Title" = "Voice Chat";
"VoiceChatChannel.Title" = "Live Stream";
"VoiceChat.InviteMember" = "Invite Member";
"VoiceChat.UserInvited" = "You invited **%@** to the voice chat";
@ -6715,3 +6716,12 @@ Sorry for the inconvenience.";
"Channel.AdminLog.MessageChangedThemeSet" = "%1$@ changed chat theme to %2$@";
"Channel.AdminLog.MessageChangedThemeRemove" = "%1$@ disabled chat theme";
"SponsoredMessageMenu.Info" = "What are sponsored\nmessages?";
"SponsoredMessageInfo.Text" = "See https://telegram.org";
"SponsoredMessageInfo.Action" = "Learn More";
"SponsoredMessageInfo.ActionUrl" = "https://telegram.org";
"Chat.NavigationNoChannels" = "You have no unread channels";
"Message.SponsoredLabel" = "sponsored";

View File

@ -295,11 +295,20 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
var actions: [ContextMenuItem] = []
//TODO:localize
actions.append(.action(ContextMenuActionItem(text: "What are sponsored\nmessages?", textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0)), badge: nil, icon: { theme in
actions.append(.action(ContextMenuActionItem(text: presentationData.strings.SponsoredMessageMenu_Info, textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0)), badge: nil, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor)
}, iconSource: nil, action: { _, f in
f(.default)
controllerInteraction.presentController(textAlertController(context: context, title: nil, text: presentationData.strings.SponsoredMessageInfo_Text, actions: [
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {
}),
TextAlertAction(type: .defaultAction, title: presentationData.strings.SponsoredMessageInfo_Action, action: {
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: presentationData.strings.SponsoredMessageInfo_ActionUrl, forceExternal: true, presentationData: presentationData, navigationController: controllerInteraction.navigationController(), dismissInput: {
controllerInteraction.navigationController()?.view.endEditing(true)
})
}),
]), nil)
})))
actions.append(.separator)

View File

@ -328,8 +328,7 @@ final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContentNode {
}
if let author = item.message.author as? TelegramUser, author.botInfo != nil {
//TODO:localize
actionTitle = "VIEW BOT"
actionTitle = item.presentationData.strings.Conversation_ViewBot
} else if let author = item.message.author as? TelegramChannel, case .group = author.info {
actionTitle = item.presentationData.strings.Conversation_ViewGroup
} else {

View File

@ -494,7 +494,8 @@ final class AvatarComponent: Component {
func update(component: AvatarComponent, availableSize: CGSize, transition: Transition) -> CGSize {
self.avatarNode.frame = CGRect(origin: CGPoint(), size: availableSize)
self.avatarNode.setPeer(context: component.context, theme: component.context.sharedContext.currentPresentationData.with({ $0 }).theme, peer: component.peer, synchronousLoad: true)
let theme = component.context.sharedContext.currentPresentationData.with({ $0 }).theme
self.avatarNode.setPeer(context: component.context, theme: theme, peer: component.peer, emptyColor: theme.list.mediaPlaceholderColor, synchronousLoad: true)
if let badge = component.badge {
let badgeView: ComponentHostView<Empty>
@ -858,8 +859,7 @@ final class OverscrollContentsComponent: Component {
if let peer = component.peer {
titleText = peer.compactDisplayTitle
} else {
//TODO:localize
titleText = "You have no unread channels"
titleText = component.context.sharedContext.currentPresentationData.with({ $0 }).strings.Chat_NavigationNoChannels
}
self.titleNode.attributedText = NSAttributedString(string: titleText, font: Font.semibold(13.0), textColor: component.foregroundColor)
let titleSize = self.titleNode.updateLayout(CGSize(width: availableSize.width - 32.0, height: 100.0))

View File

@ -30,8 +30,7 @@ private func dateStringForDay(strings: PresentationStrings, dateTimeFormat: Pres
func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Message, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, strings: PresentationStrings, format: MessageTimestampStatusFormat = .regular, reactionCount: Int) -> String {
if message.adAttribute != nil {
//TODO:localize
return "sponsored"
return strings.Message_SponsoredLabel
}
let timestamp: Int32