mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Update localization
This commit is contained in:
parent
a90d128527
commit
33dc13f2d5
@ -8337,3 +8337,66 @@ Sorry for the inconvenience.";
|
|||||||
"UserInfo.AnonymousNumberInfo" = "This number is not tied to a SIM card and was acquired on [Fragment]().";
|
"UserInfo.AnonymousNumberInfo" = "This number is not tied to a SIM card and was acquired on [Fragment]().";
|
||||||
|
|
||||||
"Login.NewNumber" = "New Number";
|
"Login.NewNumber" = "New Number";
|
||||||
|
|
||||||
|
"ChatList.GeneralHidden" = "General hidden";
|
||||||
|
"ChatList.GeneralHiddenInfo" = "Pull down to see the general topic.";
|
||||||
|
"ChatList.GeneralUnhidden" = "General unhidden";
|
||||||
|
"ChatList.GeneralUnhiddenInfo" = "Swipe left on the general topic to hide it.";
|
||||||
|
|
||||||
|
"Autoremove.OptionOff" = "Off";
|
||||||
|
"Autoremove.SetCustomTime" = "Set Custom Time...";
|
||||||
|
"CreateGroup.AutoDeleteTitle" = "Auto-Delete Messages";
|
||||||
|
"CreateGroup.AutoDeleteText" = "Automatically delete messages sent in this group for everyone after a period of time.";
|
||||||
|
|
||||||
|
"Settings.AutoDeleteTitle" = "Auto-Delete Messages";
|
||||||
|
"Settings.AutoDeleteInfo" = "Automatically delete messages for everyone after a period of time in all new chats you start.";
|
||||||
|
|
||||||
|
"Time.AfterSeconds_1" = "%@ second";
|
||||||
|
"Time.AfterSeconds_any" = "%@ seconds";
|
||||||
|
"Time.AfterMinutes_1" = "%@ minute";
|
||||||
|
"Time.AfterMinutes_any" = "%@ minutes";
|
||||||
|
"Time.AfterHours_1" = "%@ hour";
|
||||||
|
"Time.AfterHours_any" = "%@ hours";
|
||||||
|
"Time.AfterDays_1" = "%@ day";
|
||||||
|
"Time.AfterDays_any" = "%@ days";
|
||||||
|
"Time.AfterWeeks_1" = "%@ week";
|
||||||
|
"Time.AfterWeeks_any" = "%@ weeks";
|
||||||
|
"Time.AfterMonths_1" = "%@ month";
|
||||||
|
"Time.AfterMonths_any" = "%@ months";
|
||||||
|
"Time.AfterYears_1" = "%@ years";
|
||||||
|
"Time.AfterYears_any" = "%@ years";
|
||||||
|
|
||||||
|
"Time.TimerSeconds_1" = "%@-second";
|
||||||
|
"Time.TimerSeconds_any" = "%@-second";
|
||||||
|
"Time.TimerMinutes_1" = "%@-minute";
|
||||||
|
"Time.TimerMinutes_any" = "%@-minute";
|
||||||
|
"Time.TimerHours_1" = "%@-hour";
|
||||||
|
"Time.TimerHours_any" = "%@-hour";
|
||||||
|
"Time.TimerDays_1" = "%@-day";
|
||||||
|
"Time.TimerDays_any" = "%@-day";
|
||||||
|
"Time.TimerWeeks_1" = "%@-week";
|
||||||
|
"Time.TimerWeeks_any" = "%@-week";
|
||||||
|
"Time.TimerMonths_1" = "%@-month";
|
||||||
|
"Time.TimerMonths_any" = "%@-month";
|
||||||
|
"Time.TimerYears_1" = "%@-year";
|
||||||
|
"Time.TimerYears_any" = "%@-year";
|
||||||
|
|
||||||
|
"ChatList.LabelAutodeleteAfter" = "auto-delete after %@";
|
||||||
|
"ChatList.LabelAutodeleteDisabled" = "auto-deletion disabled";
|
||||||
|
|
||||||
|
"GlobalAutodeleteSettings.Title" = "Auto-Delete Messages";
|
||||||
|
"GlobalAutodeleteSettings.OptionsHeader" = "SELF-DESTRUCT TIMER";
|
||||||
|
"GlobalAutodeleteSettings.OptionTitle" = "After %@";
|
||||||
|
"GlobalAutodeleteSettings.SetCustomTime" = "Set Custom Time...";
|
||||||
|
"GlobalAutodeleteSettings.InfoDisabled" = "If enabled, all new messages in chats you start will be automatically deleted for everyone at some point after they have been sent. This will not affect your existing chats.";
|
||||||
|
"GlobalAutodeleteSettings.InfoEnabled" = "All new messages in chats you started will be automatically deleted for everyone %@ after they have been sent. You can also [apply this setting for your existing chats]().";
|
||||||
|
"GlobalAutodeleteSettings.SetConfirmTitle" = "Self-Destruct Timer";
|
||||||
|
"GlobalAutodeleteSettings.SetConfirmText" = "Are you sure you want all messages in your new private chats and in new groups you create to be automatically deleted for everyone %@ after they have been sent?";
|
||||||
|
"GlobalAutodeleteSettings.SetConfirmAction" = "Enable Auto-Deletion";
|
||||||
|
"GlobalAutodeleteSettings.SetConfirmToastEnabled" = "Messages in all new chats you start will be automatically deleted after %@.";
|
||||||
|
"GlobalAutodeleteSettings.SetConfirmToastDisabled" = "Messages in all new chats you start will not be automatically deleted.";
|
||||||
|
"GlobalAutodeleteSettings.ApplyChatsTitle" = "Select Chats";
|
||||||
|
"GlobalAutodeleteSettings.ApplyChatsPlaceholder" = "Select chats to apply the %@ self-destruct timer";
|
||||||
|
"GlobalAutodeleteSettings.ApplyChatsToast" = "You applied the %1$@ self-destruct timer to %2$@.";
|
||||||
|
"GlobalAutodeleteSettings.ApplyChatsSubject_1" = "%@ chat";
|
||||||
|
"GlobalAutodeleteSettings.ApplyChatsSubject_any" = "%@ chats";
|
||||||
|
@ -3653,8 +3653,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if isHidden {
|
if isHidden {
|
||||||
//TODO:localize
|
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .hidArchive(title: strongSelf.presentationData.strings.ChatList_GeneralHidden, text: strongSelf.presentationData.strings.ChatList_GeneralHiddenInfo, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] value in
|
||||||
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .hidArchive(title: "General hidden", text: "Pull down to see the general topic.", undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] value in
|
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -3665,7 +3664,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
|||||||
return false
|
return false
|
||||||
}), in: .current)
|
}), in: .current)
|
||||||
} else {
|
} else {
|
||||||
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .revealedArchive(title: "General unhidden", text: "Swipe left on the general topic to hide it.", undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in return false
|
strongSelf.present(UndoOverlayController(presentationData: strongSelf.context.sharedContext.currentPresentationData.with { $0 }, content: .revealedArchive(title: strongSelf.presentationData.strings.ChatList_GeneralUnhidden, text: strongSelf.presentationData.strings.ChatList_GeneralUnhiddenInfo, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in return false
|
||||||
}), in: .current)
|
}), in: .current)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2972,11 +2972,9 @@ private func statusStringForPeerType(accountPeerId: EnginePeer.Id, strings: Pres
|
|||||||
|
|
||||||
if displayAutoremoveTimeout {
|
if displayAutoremoveTimeout {
|
||||||
if let autoremoveTimeout = autoremoveTimeout {
|
if let autoremoveTimeout = autoremoveTimeout {
|
||||||
//TODO:localize
|
return (strings.ChatList_LabelAutodeleteAfter(timeIntervalString(strings: strings, value: autoremoveTimeout, usage: .afterTime)).string, false, true, .autoremove)
|
||||||
return ("auto-delete after \(timeIntervalString(strings: strings, value: autoremoveTimeout))", false, true, .autoremove)
|
|
||||||
} else {
|
} else {
|
||||||
//TODO:localize
|
return (strings.ChatList_LabelAutodeleteDisabled, false, false, .autoremove)
|
||||||
return ("auto-deletion disabled", false, false, .autoremove)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,8 +149,7 @@ private func globalAutoremoveScreenEntries(presentationData: PresentationData, s
|
|||||||
|
|
||||||
let effectiveCurrentValue = state.updatedValue
|
let effectiveCurrentValue = state.updatedValue
|
||||||
|
|
||||||
//TODO:localize
|
entries.append(.sectionHeader(presentationData.strings.GlobalAutodeleteSettings_OptionsHeader))
|
||||||
entries.append(.sectionHeader("SELF-DESTRUCT TIMER"))
|
|
||||||
|
|
||||||
var values: [Int32] = [
|
var values: [Int32] = [
|
||||||
0,
|
0,
|
||||||
@ -170,25 +169,22 @@ private func globalAutoremoveScreenEntries(presentationData: PresentationData, s
|
|||||||
|
|
||||||
values.sort()
|
values.sort()
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
for value in values {
|
for value in values {
|
||||||
let text: String
|
let text: String
|
||||||
if value == 0 {
|
if value == 0 {
|
||||||
text = "Off"
|
text = presentationData.strings.Autoremove_OptionOff
|
||||||
} else {
|
} else {
|
||||||
text = "After \(timeIntervalString(strings: presentationData.strings, value: value))"
|
text = presentationData.strings.GlobalAutodeleteSettings_OptionTitle(timeIntervalString(strings: presentationData.strings, value: value, usage: .afterTime)).string
|
||||||
}
|
}
|
||||||
entries.append(.timerOption(value: value, text: text, isSelected: effectiveCurrentValue == value))
|
entries.append(.timerOption(value: value, text: text, isSelected: effectiveCurrentValue == value))
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.append(.customAction("Set Custom Time..."))
|
entries.append(.customAction(presentationData.strings.GlobalAutodeleteSettings_SetCustomTime))
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
if effectiveCurrentValue == 0 {
|
if effectiveCurrentValue == 0 {
|
||||||
entries.append(.info("If enabled, all new messages in chats you start will be automatically deleted for everyone at some point after they have been sent. This will not affect your existing chats."))
|
entries.append(.info(presentationData.strings.GlobalAutodeleteSettings_InfoDisabled))
|
||||||
} else {
|
} else {
|
||||||
|
entries.append(.info(presentationData.strings.GlobalAutodeleteSettings_InfoEnabled(timeIntervalString(strings: presentationData.strings, value: effectiveCurrentValue, usage: .afterTime)).string))
|
||||||
entries.append(.info("All new messages in chats you started will be automatically deleted for everyone \(timeIntervalString(strings: presentationData.strings, value: effectiveCurrentValue)) after they have been sent. You can also [apply this setting for your existing chats]()."))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return entries
|
return entries
|
||||||
@ -237,10 +233,10 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
|||||||
var isOn: Bool = true
|
var isOn: Bool = true
|
||||||
var text: String?
|
var text: String?
|
||||||
if timeout != 0 {
|
if timeout != 0 {
|
||||||
text = "Messages in all new chats you start will be automatically deleted after \(timeIntervalString(strings: presentationData.strings, value: timeout))."
|
text = presentationData.strings.GlobalAutodeleteSettings_SetConfirmToastEnabled(timeIntervalString(strings: presentationData.strings, value: timeout, usage: .afterTime)).string
|
||||||
} else {
|
} else {
|
||||||
isOn = false
|
isOn = false
|
||||||
text = "Messages in all new chats you start will not be automatically deleted.";
|
text = presentationData.strings.GlobalAutodeleteSettings_SetConfirmToastDisabled
|
||||||
}
|
}
|
||||||
if let text = text {
|
if let text = text {
|
||||||
var animateAsReplacement = false
|
var animateAsReplacement = false
|
||||||
@ -264,14 +260,13 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
|||||||
apply(timeout)
|
apply(timeout)
|
||||||
} else {
|
} else {
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
//TODO:localize
|
let valueText = timeIntervalString(strings: presentationData.strings, value: timeout, usage: .afterTime)
|
||||||
let valueText = timeIntervalString(strings: presentationData.strings, value: timeout)
|
|
||||||
presentControllerImpl?(standardTextAlertController(
|
presentControllerImpl?(standardTextAlertController(
|
||||||
theme: AlertControllerTheme(presentationData: presentationData),
|
theme: AlertControllerTheme(presentationData: presentationData),
|
||||||
title: "Self-Destruct Timer",
|
title: presentationData.strings.GlobalAutodeleteSettings_SetConfirmTitle,
|
||||||
text: "Are you sure you want all messages in your new private chats and in new groups you create to be automatically deleted for everyone \(valueText) after they have been sent?",
|
text: presentationData.strings.GlobalAutodeleteSettings_SetConfirmText(valueText).string,
|
||||||
actions: [
|
actions: [
|
||||||
TextAlertAction(type: .defaultAction, title: "Enable Auto-Deletion", action: {
|
TextAlertAction(type: .defaultAction, title: presentationData.strings.GlobalAutodeleteSettings_SetConfirmAction, action: {
|
||||||
apply(timeout)
|
apply(timeout)
|
||||||
}),
|
}),
|
||||||
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {})
|
TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {})
|
||||||
@ -299,16 +294,14 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
let valueText = timeIntervalString(strings: presentationData.strings, value: value)
|
let valueText = timeIntervalString(strings: presentationData.strings, value: value, usage: .timer)
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
let selectionController = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(
|
let selectionController = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(
|
||||||
context: context,
|
context: context,
|
||||||
mode: .chatSelection(ContactMultiselectionControllerMode.ChatSelection(
|
mode: .chatSelection(ContactMultiselectionControllerMode.ChatSelection(
|
||||||
title: "Select Chats",
|
title: presentationData.strings.GlobalAutodeleteSettings_ApplyChatsTitle,
|
||||||
searchPlaceholder: "Select chats to apply the \(valueText) self-destruct timer",
|
searchPlaceholder: presentationData.strings.GlobalAutodeleteSettings_ApplyChatsPlaceholder(valueText).string,
|
||||||
selectedChats: Set(),
|
selectedChats: Set(),
|
||||||
additionalCategories: nil,
|
additionalCategories: nil,
|
||||||
chatListFilters: nil,
|
chatListFilters: nil,
|
||||||
@ -362,8 +355,7 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
|||||||
selectionController?.dismiss()
|
selectionController?.dismiss()
|
||||||
|
|
||||||
let isOn: Bool = true
|
let isOn: Bool = true
|
||||||
//TODO:localize
|
let text = presentationData.strings.GlobalAutodeleteSettings_ApplyChatsToast(timeIntervalString(strings: presentationData.strings, value: value, usage: .timer), presentationData.strings.GlobalAutodeleteSettings_ApplyChatsSubject(Int32(peerIds.count))).string
|
||||||
let text = "You applied the \(timeIntervalString(strings: presentationData.strings, value: value)) self-destruct timer to \(peerIds.count) \(peerIds.count == 1 ? "chat" : "chats")."
|
|
||||||
|
|
||||||
var animateAsReplacement = false
|
var animateAsReplacement = false
|
||||||
if let window = getController?()?.window {
|
if let window = getController?()?.window {
|
||||||
@ -390,8 +382,7 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
|||||||
|> map { presentationData, state -> (ItemListControllerState, (ItemListNodeState, Any)) in
|
|> map { presentationData, state -> (ItemListControllerState, (ItemListNodeState, Any)) in
|
||||||
let rightNavigationButton: ItemListNavigationButton? = nil
|
let rightNavigationButton: ItemListNavigationButton? = nil
|
||||||
|
|
||||||
//TODO:localize
|
let title: ItemListControllerTitle = .text(presentationData.strings.GlobalAutodeleteSettings_Title)
|
||||||
let title: ItemListControllerTitle = .text("Auto-Delete Messages")
|
|
||||||
|
|
||||||
let entries: [GlobalAutoremoveEntry] = globalAutoremoveScreenEntries(presentationData: presentationData, state: state)
|
let entries: [GlobalAutoremoveEntry] = globalAutoremoveScreenEntries(presentationData: presentationData, state: state)
|
||||||
|
|
||||||
|
@ -514,7 +514,6 @@ private func privacyAndSecurityControllerEntries(
|
|||||||
}
|
}
|
||||||
entries.append(.twoStepVerification(presentationData.theme, presentationData.strings.PrivacySettings_TwoStepAuth, twoStepAuthString, twoStepAuthData))
|
entries.append(.twoStepVerification(presentationData.theme, presentationData.strings.PrivacySettings_TwoStepAuth, twoStepAuthString, twoStepAuthData))
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
if let privacySettings = privacySettings {
|
if let privacySettings = privacySettings {
|
||||||
let value: Int32?
|
let value: Int32?
|
||||||
if let updatingMessageAutoremoveTimeoutValue = state.updatingMessageAutoremoveTimeoutValue {
|
if let updatingMessageAutoremoveTimeoutValue = state.updatingMessageAutoremoveTimeoutValue {
|
||||||
@ -526,13 +525,13 @@ private func privacyAndSecurityControllerEntries(
|
|||||||
if let value {
|
if let value {
|
||||||
valueText = timeIntervalString(strings: presentationData.strings, value: value)
|
valueText = timeIntervalString(strings: presentationData.strings, value: value)
|
||||||
} else {
|
} else {
|
||||||
valueText = "Off"
|
valueText = presentationData.strings.Autoremove_OptionOff
|
||||||
}
|
}
|
||||||
entries.append(.messageAutoremoveTimeout(presentationData.theme, "Auto-Delete Messages", valueText))
|
entries.append(.messageAutoremoveTimeout(presentationData.theme, presentationData.strings.Settings_AutoDeleteTitle, valueText))
|
||||||
} else {
|
} else {
|
||||||
entries.append(.messageAutoremoveTimeout(presentationData.theme, "Auto-Delete Messages", presentationData.strings.Channel_NotificationLoading))
|
entries.append(.messageAutoremoveTimeout(presentationData.theme, presentationData.strings.Settings_AutoDeleteTitle, presentationData.strings.Channel_NotificationLoading))
|
||||||
}
|
}
|
||||||
entries.append(.messageAutoremoveInfo(presentationData.theme, "Automatically delete messages for everyone after a period of time in all new chats you start."))
|
entries.append(.messageAutoremoveInfo(presentationData.theme, presentationData.strings.Settings_AutoDeleteInfo))
|
||||||
|
|
||||||
if loginEmail != nil {
|
if loginEmail != nil {
|
||||||
entries.append(.loginEmail(presentationData.theme, presentationData.strings.PrivacySettings_LoginEmail, loginEmail))
|
entries.append(.loginEmail(presentationData.theme, presentationData.strings.PrivacySettings_LoginEmail, loginEmail))
|
||||||
|
@ -50,38 +50,115 @@ public func minutesIntervalString(strings: PresentationStrings, minutes: Int32)
|
|||||||
return strings.MessageTimer_Minutes(max(0, minutes))
|
return strings.MessageTimer_Minutes(max(0, minutes))
|
||||||
}
|
}
|
||||||
|
|
||||||
public func timeIntervalString(strings: PresentationStrings, value: Int32, preferLowerValue: Bool = false) -> String {
|
public enum TimeIntervalStringUsage {
|
||||||
if preferLowerValue {
|
case generic
|
||||||
if value <= 60 {
|
case afterTime
|
||||||
return strings.MessageTimer_Seconds(max(1, value))
|
case timer
|
||||||
} else if value <= 60 * 60 {
|
}
|
||||||
return strings.MessageTimer_Minutes(max(1, value / 60))
|
|
||||||
} else if value <= 60 * 60 * 24 {
|
public func timeIntervalString(strings: PresentationStrings, value: Int32, usage: TimeIntervalStringUsage = .generic, preferLowerValue: Bool = false) -> String {
|
||||||
return strings.MessageTimer_Hours(max(1, value / (60 * 60)))
|
switch usage {
|
||||||
} else if value <= 60 * 60 * 24 * 7 {
|
case .generic:
|
||||||
return strings.MessageTimer_Days(max(1, value / (60 * 60 * 24)))
|
if preferLowerValue {
|
||||||
} else if value <= 60 * 60 * 24 * 30 {
|
if value <= 60 {
|
||||||
return strings.MessageTimer_Weeks(max(1, value / (60 * 60 * 24 * 7)))
|
return strings.MessageTimer_Seconds(max(1, value))
|
||||||
} else if value <= 60 * 60 * 24 * 365 {
|
} else if value <= 60 * 60 {
|
||||||
return strings.MessageTimer_Months(max(1, value / (60 * 60 * 24 * 30)))
|
return strings.MessageTimer_Minutes(max(1, value / 60))
|
||||||
|
} else if value <= 60 * 60 * 24 {
|
||||||
|
return strings.MessageTimer_Hours(max(1, value / (60 * 60)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 7 {
|
||||||
|
return strings.MessageTimer_Days(max(1, value / (60 * 60 * 24)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 30 {
|
||||||
|
return strings.MessageTimer_Weeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 365 {
|
||||||
|
return strings.MessageTimer_Months(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.MessageTimer_Years(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return strings.MessageTimer_Years(max(1, value / (60 * 60 * 24 * 365)))
|
if value < 60 {
|
||||||
|
return strings.MessageTimer_Seconds(max(1, value))
|
||||||
|
} else if value < 60 * 60 {
|
||||||
|
return strings.MessageTimer_Minutes(max(1, value / 60))
|
||||||
|
} else if value < 60 * 60 * 24 {
|
||||||
|
return strings.MessageTimer_Hours(max(1, value / (60 * 60)))
|
||||||
|
} else if value < 60 * 60 * 24 * 7 {
|
||||||
|
return strings.MessageTimer_Days(max(1, value / (60 * 60 * 24)))
|
||||||
|
} else if value < 60 * 60 * 24 * 30 {
|
||||||
|
return strings.MessageTimer_Weeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
|
} else if value < 60 * 60 * 24 * 365 {
|
||||||
|
return strings.MessageTimer_Months(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.MessageTimer_Years(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
case .afterTime:
|
||||||
if value < 60 {
|
if preferLowerValue {
|
||||||
return strings.MessageTimer_Seconds(max(1, value))
|
if value <= 60 {
|
||||||
} else if value < 60 * 60 {
|
return strings.Time_AfterSeconds(max(1, value))
|
||||||
return strings.MessageTimer_Minutes(max(1, value / 60))
|
} else if value <= 60 * 60 {
|
||||||
} else if value < 60 * 60 * 24 {
|
return strings.Time_AfterMinutes(max(1, value / 60))
|
||||||
return strings.MessageTimer_Hours(max(1, value / (60 * 60)))
|
} else if value <= 60 * 60 * 24 {
|
||||||
} else if value < 60 * 60 * 24 * 7 {
|
return strings.Time_AfterHours(max(1, value / (60 * 60)))
|
||||||
return strings.MessageTimer_Days(max(1, value / (60 * 60 * 24)))
|
} else if value <= 60 * 60 * 24 * 7 {
|
||||||
} else if value < 60 * 60 * 24 * 30 {
|
return strings.Time_AfterDays(max(1, value / (60 * 60 * 24)))
|
||||||
return strings.MessageTimer_Weeks(max(1, value / (60 * 60 * 24 * 7)))
|
} else if value <= 60 * 60 * 24 * 30 {
|
||||||
} else if value < 60 * 60 * 24 * 365 {
|
return strings.Time_AfterWeeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
return strings.MessageTimer_Months(max(1, value / (60 * 60 * 24 * 30)))
|
} else if value <= 60 * 60 * 24 * 365 {
|
||||||
|
return strings.Time_AfterMonths(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.Time_AfterYears(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return strings.MessageTimer_Years(max(1, value / (60 * 60 * 24 * 365)))
|
if value < 60 {
|
||||||
|
return strings.Time_AfterSeconds(max(1, value))
|
||||||
|
} else if value < 60 * 60 {
|
||||||
|
return strings.Time_AfterMinutes(max(1, value / 60))
|
||||||
|
} else if value < 60 * 60 * 24 {
|
||||||
|
return strings.Time_AfterHours(max(1, value / (60 * 60)))
|
||||||
|
} else if value < 60 * 60 * 24 * 7 {
|
||||||
|
return strings.Time_AfterDays(max(1, value / (60 * 60 * 24)))
|
||||||
|
} else if value < 60 * 60 * 24 * 30 {
|
||||||
|
return strings.Time_AfterWeeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
|
} else if value < 60 * 60 * 24 * 365 {
|
||||||
|
return strings.Time_AfterMonths(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.Time_AfterYears(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case .timer:
|
||||||
|
if preferLowerValue {
|
||||||
|
if value <= 60 {
|
||||||
|
return strings.Time_TimerSeconds(max(1, value))
|
||||||
|
} else if value <= 60 * 60 {
|
||||||
|
return strings.Time_TimerMinutes(max(1, value / 60))
|
||||||
|
} else if value <= 60 * 60 * 24 {
|
||||||
|
return strings.Time_TimerHours(max(1, value / (60 * 60)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 7 {
|
||||||
|
return strings.Time_TimerDays(max(1, value / (60 * 60 * 24)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 30 {
|
||||||
|
return strings.Time_TimerWeeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
|
} else if value <= 60 * 60 * 24 * 365 {
|
||||||
|
return strings.Time_TimerMonths(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.Time_TimerYears(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if value < 60 {
|
||||||
|
return strings.Time_TimerSeconds(max(1, value))
|
||||||
|
} else if value < 60 * 60 {
|
||||||
|
return strings.Time_TimerMinutes(max(1, value / 60))
|
||||||
|
} else if value < 60 * 60 * 24 {
|
||||||
|
return strings.Time_TimerHours(max(1, value / (60 * 60)))
|
||||||
|
} else if value < 60 * 60 * 24 * 7 {
|
||||||
|
return strings.Time_TimerDays(max(1, value / (60 * 60 * 24)))
|
||||||
|
} else if value < 60 * 60 * 24 * 30 {
|
||||||
|
return strings.Time_TimerWeeks(max(1, value / (60 * 60 * 24 * 7)))
|
||||||
|
} else if value < 60 * 60 * 24 * 365 {
|
||||||
|
return strings.Time_TimerMonths(max(1, value / (60 * 60 * 24 * 30)))
|
||||||
|
} else {
|
||||||
|
return strings.Time_TimerYears(max(1, value / (60 * 60 * 24 * 365)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,16 +310,15 @@ private func createGroupEntries(presentationData: PresentationData, state: Creat
|
|||||||
|
|
||||||
entries.append(.groupInfo(presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, peer, groupInfoState, state.avatar))
|
entries.append(.groupInfo(presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, peer, groupInfoState, state.avatar))
|
||||||
|
|
||||||
//TODO:localize
|
|
||||||
let autoremoveTimeout = state.autoremoveTimeout ?? globalAutoremoveTimeout
|
let autoremoveTimeout = state.autoremoveTimeout ?? globalAutoremoveTimeout
|
||||||
let autoRemoveText: String
|
let autoRemoveText: String
|
||||||
if autoremoveTimeout == 0 {
|
if autoremoveTimeout == 0 {
|
||||||
autoRemoveText = "Off"
|
autoRemoveText = presentationData.strings.Autoremove_OptionOff
|
||||||
} else {
|
} else {
|
||||||
autoRemoveText = timeIntervalString(strings: presentationData.strings, value: autoremoveTimeout)
|
autoRemoveText = timeIntervalString(strings: presentationData.strings, value: autoremoveTimeout)
|
||||||
}
|
}
|
||||||
entries.append(.autoDelete(title: "Auto-Delete Messages", value: autoRemoveText))
|
entries.append(.autoDelete(title: presentationData.strings.CreateGroup_AutoDeleteTitle, value: autoRemoveText))
|
||||||
entries.append(.autoDeleteInfo("Automatically delete messages sent in this group for everyone after a period of time."))
|
entries.append(.autoDeleteInfo(presentationData.strings.CreateGroup_AutoDeleteText))
|
||||||
|
|
||||||
var peers: [Peer] = []
|
var peers: [Peer] = []
|
||||||
for peerId in peerIds {
|
for peerId in peerIds {
|
||||||
@ -846,8 +845,7 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId]
|
|||||||
}
|
}
|
||||||
|
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
//TODO:localize
|
subItems.append(.action(ContextMenuActionItem(text: presentationData.strings.Autoremove_OptionOff, icon: { theme in
|
||||||
subItems.append(.action(ContextMenuActionItem(text: "Off", icon: { theme in
|
|
||||||
if currentValue == 0 {
|
if currentValue == 0 {
|
||||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor)
|
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor)
|
||||||
} else {
|
} else {
|
||||||
@ -882,8 +880,7 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId]
|
|||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:localize
|
subItems.append(.action(ContextMenuActionItem(text: presentationData.strings.Autoremove_SetCustomTime, icon: { _ in
|
||||||
subItems.append(.action(ContextMenuActionItem(text: "Set Custom Time...", icon: { _ in
|
|
||||||
return nil
|
return nil
|
||||||
}, action: { _, f in
|
}, action: { _, f in
|
||||||
f(.default)
|
f(.default)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user