marinofaggiana 3 年之前
父節點
當前提交
3cbd0bf5b0
共有 2 個文件被更改,包括 18 次插入7 次删除
  1. 3 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings
  2. 15 7
      iOSClient/Utility/CCUtility.m

+ 3 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -414,8 +414,11 @@
 "_remove_photo_CameraRoll_desc_"            = "After successful automatic uploads, a confirmation message will be displayed to delete the uploaded photos or videos from the camera roll. The deleted photos or videos will still be available in the iOS Photos Trash for 30 days.";
 "_never_"                       = "never";
 "_less_a_minute_"               = "less than a minute ago";
+"_a_minute_ago_"                = "a minute ago";
 "_minutes_ago_"                 = "%d minutes ago";
+"_an_hour_ago_"                 = "an hour ago";
 "_hours_ago_"                   = "%d hours ago";
+"_a_day_ago_"                   = "a day ago";
 "_days_ago_"                    = "%d days ago";
 "_over_30_days_"                = "over 30 days";
 "_connection_internet_offline_" = "The Internet connection appears to be offline or Wi-Fi is required";

+ 15 - 7
iOSClient/Utility/CCUtility.m

@@ -792,20 +792,28 @@
     double ti = [convertedDate timeIntervalSinceDate:todayDate];
     ti = ti * -1;
     if (ti < 60) {
-        // This minute
         return NSLocalizedString(@"_less_a_minute_", nil);
     } else if (ti < 3600) {
-        // This hour
         int diff = round(ti / 60);
-        return [NSString stringWithFormat:NSLocalizedString(@"_minutes_ago_", nil), diff];
+        if (diff == 1) {
+            return NSLocalizedString(@"_a_minute_ago_", nil);
+        } else {
+            return [NSString stringWithFormat:NSLocalizedString(@"_minutes_ago_", nil), diff];
+        }
     } else if (ti < 86400) {
-        // This day
         int diff = round(ti / 60 / 60);
-        return[NSString stringWithFormat:NSLocalizedString(@"_hours_ago_", nil), diff];
+        if (diff == 1) {
+            return NSLocalizedString(@"_an_hour_ago_", nil);
+        } else {
+            return[NSString stringWithFormat:NSLocalizedString(@"_hours_ago_", nil), diff];
+        }
     } else if (ti < 86400 * 30) {
-        // This month
         int diff = round(ti / 60 / 60 / 24);
-        return[NSString stringWithFormat:NSLocalizedString(@"_days_ago_", nil), diff];
+        if (diff == 1) {
+            return NSLocalizedString(@"_a_day_ago_", nil);
+        } else {
+            return[NSString stringWithFormat:NSLocalizedString(@"_days_ago_", nil), diff];
+        }
     } else {
         // Older than one month
         NSDateFormatter *df = [[NSDateFormatter alloc] init];