patch from Igor Murzov for a correct use of plural forms with gettext
authorMassimo Maiurana <maiurana@gmail.com>
Wed, 31 Oct 2012 18:44:14 +0000 (18:44 +0000)
committerMassimo Maiurana <maiurana@gmail.com>
Wed, 31 Oct 2012 18:44:14 +0000 (18:44 +0000)
SVN revision: 78716

src/bin/e_utils.c

index 43999904c9c5d08cfafed78941dabf3bf1364a1a..825662fc57883b798c42ab3d0a73eae26a923158 100644 (file)
@@ -905,50 +905,32 @@ e_util_file_time_get(time_t ftime)
         else if (diff >= 31526000)
           {
              test = diff / 31526000;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("Last year"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Years ago"), test);
+             snprintf(buf, sizeof(buf), P_("Last year", "%li Years ago", test), test);
           }
         else if (diff >= 2592000)
           {
              test = diff / 2592000;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("Last month"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Months ago"), test);
+             snprintf(buf, sizeof(buf), P_("Last month", "%li Months ago", test), test);
           }
         else if (diff >= 604800)
           {
              test = diff / 604800;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("Last week"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Weeks ago"), test);
+             snprintf(buf, sizeof(buf), P_("Last week", "%li Weeks ago", test), test);
           }
         else if (diff >= 86400)
           {
              test = diff / 86400;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("Yesterday"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Days ago"), test);
+             snprintf(buf, sizeof(buf), P_("Yesterday", "%li Days ago", test), test);
           }
         else if (diff >= 3600)
           {
              test = diff / 3600;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("An hour ago"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Hours ago"), test);
+             snprintf(buf, sizeof(buf), P_("An hour ago", "%li Hours ago", test), test);
           }
         else if (diff > 60)
           {
              test = diff / 60;
-             if (test == 1)
-               snprintf(buf, sizeof(buf), _("A minute ago"));
-             else
-               snprintf(buf, sizeof(buf), _("%li Minutes ago"), test);
+             snprintf(buf, sizeof(buf), P_("A minute ago", "%li Minutes ago", test), test);
           }
      }