Use peer name localization

This commit is contained in:
Peter
2019-10-11 16:05:35 +04:00
parent 120135b8fe
commit 284db5aba8
100 changed files with 391 additions and 275 deletions

View File

@@ -295,7 +295,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
locationBroadcastAccessoryPanel.updateLayout(size: panelFrame.size, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, transition: transition)
} else {
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
locationBroadcastAccessoryPanel = LocationBroadcastNavigationAccessoryPanel(accountPeerId: self.context.account.peerId, theme: presentationData.theme, strings: presentationData.strings, tapAction: { [weak self] in
locationBroadcastAccessoryPanel = LocationBroadcastNavigationAccessoryPanel(accountPeerId: self.context.account.peerId, theme: presentationData.theme, strings: presentationData.strings, nameDisplayOrder: presentationData.nameDisplayOrder, tapAction: { [weak self] in
if let strongSelf = self {
switch strongSelf.locationBroadcastPanelSource {
case .none:
@@ -325,7 +325,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
}
if let beginTimeAndTimeout = beginTimeAndTimeout {
items.append(LocationBroadcastActionSheetItem(context: strongSelf.context, peer: peer, title: peer.displayTitle, beginTimestamp: beginTimeAndTimeout.0, timeout: beginTimeAndTimeout.1, strings: presentationData.strings, action: {
items.append(LocationBroadcastActionSheetItem(context: strongSelf.context, peer: peer, title: peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), beginTimestamp: beginTimeAndTimeout.0, timeout: beginTimeAndTimeout.1, strings: presentationData.strings, action: {
dismissAction()
if let strongSelf = self {
presentLiveLocationController(context: strongSelf.context, peerId: peer.id, controller: strongSelf)
@@ -382,7 +382,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
if let closePeers = closePeers, !closePeers.isEmpty {
items.append(ActionSheetTextItem(title: presentationData.strings.LiveLocation_MenuChatsCount(Int32(closePeers.count))))
for peer in closePeers {
items.append(ActionSheetButtonItem(title: peer.displayTitle, action: {
items.append(ActionSheetButtonItem(title: peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder), action: {
dismissAction()
if let strongSelf = self {
presentLiveLocationController(context: strongSelf.context, peerId: peer.id, controller: strongSelf)