Skip to content

Commit 4b64b15

Browse files
committed
Back out Bug 1154088 for incorrect l10n.
This reverts commit 3a04fd5.
1 parent a643cb5 commit 4b64b15

File tree

4 files changed

+2
-141
lines changed

4 files changed

+2
-141
lines changed

Client.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
034C81621AE6032D0050EDA1 /* RelativeDatesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 034C81611AE6032D0050EDA1 /* RelativeDatesTests.swift */; };
1110
0AE491A61A41C88C0046C724 /* BackForwardListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE491A51A41C88C0046C724 /* BackForwardListViewController.swift */; };
1211
0B1C05D71A798B1F004C78B0 /* UIImageViewAligned.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B1C05D61A798B1F004C78B0 /* UIImageViewAligned.m */; };
1312
0B5142CC1AE1BAF50014D0B3 /* UIViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B5142CB1AE1BAF50014D0B3 /* UIViewExtensions.swift */; };
@@ -1031,7 +1030,6 @@
10311030
/* End PBXCopyFilesBuildPhase section */
10321031

10331032
/* Begin PBXFileReference section */
1034-
034C81611AE6032D0050EDA1 /* RelativeDatesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RelativeDatesTests.swift; sourceTree = "<group>"; };
10351033
0AE491A51A41C88C0046C724 /* BackForwardListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackForwardListViewController.swift; sourceTree = "<group>"; };
10361034
0B1C05D51A798B1F004C78B0 /* UIImageViewAligned.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageViewAligned.h; sourceTree = "<group>"; };
10371035
0B1C05D61A798B1F004C78B0 /* UIImageViewAligned.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIImageViewAligned.m; sourceTree = "<group>"; };
@@ -2271,7 +2269,6 @@
22712269
F84B21D61A090F8100AAB793 /* ClientTests */ = {
22722270
isa = PBXGroup;
22732271
children = (
2274-
034C81611AE6032D0050EDA1 /* RelativeDatesTests.swift */,
22752272
F84B21D91A090F8100AAB793 /* ClientTests.swift */,
22762273
281B2BE91ADF4D90002917DC /* MockProfile.swift */,
22772274
D3D488581ABB54CD00A93597 /* FileAccessorTests.swift */,
@@ -3692,7 +3689,6 @@
36923689
D3D488591ABB54CD00A93597 /* FileAccessorTests.swift in Sources */,
36933690
0BA8964B1A250E6500C1010C /* ProfileTest.swift in Sources */,
36943691
0BB5B28D1AC0A6130052877D /* Toolbar.swift in Sources */,
3695-
034C81621AE6032D0050EDA1 /* RelativeDatesTests.swift in Sources */,
36963692
F84B21DA1A090F8100AAB793 /* ClientTests.swift in Sources */,
36973693
281B2BEA1ADF4D90002917DC /* MockProfile.swift in Sources */,
36983694
2F697F7E1A9FD22D009E03AE /* SearchEnginesTests.swift in Sources */,

Client/Frontend/Home/RemoteTabsPanel.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ private let RemoteTabIdentifier = "RemoteTab"
3737
class RemoteTabsPanel: UITableViewController, HomePanel {
3838
weak var homePanelDelegate: HomePanelDelegate? = nil
3939
var profile: Profile!
40-
var timer: NSTimer!
4140

4241
private var clientAndTabs: [ClientAndTabs]?
4342

@@ -61,14 +60,6 @@ class RemoteTabsPanel: UITableViewController, HomePanel {
6160
self.SELrefresh()
6261
}
6362

64-
override func viewDidAppear(animated: Bool) {
65-
timer = NSTimer.scheduledTimerWithTimeInterval(60.0, target: self.tableView, selector: Selector("reloadData"), userInfo: nil, repeats: true)
66-
}
67-
68-
override func viewWillDisappear(animated: Bool) {
69-
timer.invalidate()
70-
}
71-
7263
@objc private func SELrefresh() {
7364
self.refreshControl?.beginRefreshing()
7465

@@ -139,7 +130,7 @@ class RemoteTabsPanel: UITableViewController, HomePanel {
139130
*/
140131
let timestamp = clientTabs.approximateLastSyncTime()
141132
let label = NSLocalizedString("Last synced: %@", comment: "Remote tabs last synced time")
142-
view.detailTextLabel.text = String(format: label, timestamp.toNSDate().toRelativeTimeString())
133+
view.detailTextLabel.text = String(format: label, String(timestamp))
143134
if client.type == "desktop" {
144135
view.imageView.image = UIImage(named: "deviceTypeDesktop")
145136
} else {

ClientTests/RelativeDatesTests.swift

Lines changed: 0 additions & 67 deletions
This file was deleted.

Utils/TimeConstants.swift

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,6 @@ extension NSDate {
1818
public class func now() -> Timestamp {
1919
return UInt64(1000 * NSDate().timeIntervalSince1970)
2020
}
21-
22-
public func toRelativeTimeString() -> String {
23-
24-
let now = NSDate()
25-
26-
let units = NSCalendarUnit.CalendarUnitSecond | NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitHour
27-
28-
let components = NSCalendar.currentCalendar().components(units, fromDate: self, toDate: now, options: NSCalendarOptions.allZeros)
29-
30-
if components.year > 0 {
31-
if components.year > 1 {
32-
return String(format: NSLocalizedString("%@ years ago", comment: "relative time"), String(components.year))
33-
} else if components.year == 1 {
34-
return String(format: NSLocalizedString("a year ago", comment: "relative time"))
35-
}
36-
} else if components.month > 0 {
37-
if components.month > 1 {
38-
return String(format: NSLocalizedString("%@ months ago", comment: "relative time"), String(components.month))
39-
} else if components.month == 1 {
40-
return String(format: NSLocalizedString("a month ago", comment: "relative time"))
41-
}
42-
} else if components.weekOfYear > 0 {
43-
if components.weekOfYear > 1 {
44-
return String(format: NSLocalizedString("%@ weeks ago", comment: "relative time"), String(components.weekOfYear))
45-
} else if components.weekOfYear == 1 {
46-
return String(format: NSLocalizedString("a week ago", comment: "relative time"))
47-
}
48-
} else if components.day > 0 {
49-
if components.day > 1 {
50-
return String(format: NSLocalizedString("%@ days ago", comment: "relative time"), String(components.day))
51-
} else if components.day == 1 {
52-
return String(format: NSLocalizedString("a day ago", comment: "relative time"))
53-
}
54-
} else if components.hour > 0 {
55-
if components.hour > 1 {
56-
println(components.hour)
57-
return String(format: NSLocalizedString("%@ hours ago", comment: "relative time"), String(components.hour))
58-
} else if components.hour == 1 {
59-
return String(format: NSLocalizedString("an hour ago", comment: "relative time"))
60-
}
61-
} else if components.minute > 0 {
62-
if components.minute > 1 {
63-
return String(format: NSLocalizedString("%@ minutes ago", comment: "relative time"), String(components.minute))
64-
} else if components.minute == 1 {
65-
return String(format: NSLocalizedString("a minute ago", comment: "relative time"))
66-
}
67-
} else {
68-
if components.second >= 10 {
69-
return String(format: NSLocalizedString("%@ seconds ago", comment: "relative time"), String(components.second))
70-
}
71-
}
72-
return String(format: NSLocalizedString("just now", comment: "relative time"))
73-
}
7421
}
7522

7623
public func decimalSecondsStringToTimestamp(input: String) -> Timestamp? {
@@ -83,10 +30,4 @@ public func decimalSecondsStringToTimestamp(input: String) -> Timestamp? {
8330
public func millisecondsToDecimalSeconds(input: Timestamp) -> String {
8431
let val: Double = Double(input) / 1000
8532
return String(format: "%.2F", val)
86-
}
87-
88-
extension Timestamp {
89-
public func toNSDate() -> NSDate {
90-
return NSDate(timeIntervalSince1970: NSTimeInterval(self / 1000))
91-
}
92-
}
33+
}

0 commit comments

Comments
 (0)