[nautilus] file: use _() directly for date formatting



commit 882afd8506e7996ffb52ec5a34bb66755256fc22
Author: Carlos Soriano <csoriano gnome org>
Date:   Thu Mar 3 13:53:03 2016 +0100

    file: use _() directly for date formatting
    
    We don't need to use N_() since it's not an array, but just a const
    char.
    This was causing problems with the date format not being translated,
    since N_() only marks for translation, but doesn't allow translator to
    actually translate.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750917

 libnautilus-private/nautilus-file.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index d94d8b2..22e29dd 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4751,28 +4751,28 @@ nautilus_file_get_date_as_string (NautilusFile       *file,
                if (days_ago < 1) {
                        if (use_24) {
                                /* Translators: Time in 24h format */
-                               format = N_("%H:%M");
+                               format = _("%H:%M");
                        } else {
                                /* Translators: Time in 12h format */
-                               format = N_("%l:%M %p");
+                               format = _("%l:%M %p");
                        }
                }
                // Show the word "Yesterday" and time if date is on yesterday
                else if (days_ago < 2) {
                        if (date_format == NAUTILUS_DATE_FORMAT_REGULAR) {
                                // xgettext:no-c-format
-                               format = N_("Yesterday");
+                               format = _("Yesterday");
                        } else {
                                if (use_24) {
                                        /* Translators: this is the word Yesterday followed by
                                         * a time in 24h format. i.e. "Yesterday 23:04" */
                                        // xgettext:no-c-format
-                                       format = N_("Yesterday %H:%M");
+                                       format = _("Yesterday %H:%M");
                                } else {
                                        /* Translators: this is the word Yesterday followed by
                                         * a time in 12h format. i.e. "Yesterday 9:04 PM" */
                                        // xgettext:no-c-format
-                                       format = N_("Yesterday %l:%M %p");
+                                       format = _("Yesterday %l:%M %p");
                                }
                        }
                }
@@ -4780,18 +4780,18 @@ nautilus_file_get_date_as_string (NautilusFile       *file,
                else if (days_ago < 7) {
                        if (date_format == NAUTILUS_DATE_FORMAT_REGULAR) {
                                // xgettext:no-c-format
-                               format = N_("%a");
+                               format = _("%a");
                        } else {
                                if (use_24) {
                                        /* Translators: this is the name of the week day followed by
                                         * a time in 24h format. i.e. "Monday 23:04" */
                                        // xgettext:no-c-format
-                                       format = N_("%a %H:%M");
+                                       format = _("%a %H:%M");
                                } else {
                                        /* Translators: this is the week day name followed by
                                         * a time in 12h format. i.e. "Monday 9:04 PM" */
                                        // xgettext:no-c-format
-                                       format = N_("%a %l:%M %p");
+                                       format = _("%a %l:%M %p");
                                }
                        }
                } else if (g_date_time_get_year (file_date) == g_date_time_get_year (now)) {
@@ -4799,20 +4799,20 @@ nautilus_file_get_date_as_string (NautilusFile       *file,
                                /* Translators: this is the day of the month followed
                                 * by the abbreviated month name i.e. "3 Feb" */
                                // xgettext:no-c-format
-                               format = N_("%-e %b");
+                               format = _("%-e %b");
                        } else {
                                if (use_24) {
                                        /* Translators: this is the day of the month followed
                                         * by the abbreviated month name followed by a time in
                                         * 24h format i.e. "3 Feb 23:04" */
                                        // xgettext:no-c-format
-                                       format = N_("%-e %b %H:%M");
+                                       format = _("%-e %b %H:%M");
                                } else {
                                        /* Translators: this is the day of the month followed
                                         * by the abbreviated month name followed by a time in
                                         * 12h format i.e. "3 Feb 9:04" */
                                        // xgettext:no-c-format
-                                       format = N_("%-e %b %l:%M %p");
+                                       format = _("%-e %b %l:%M %p");
                                }
                        }
                } else {
@@ -4820,20 +4820,20 @@ nautilus_file_get_date_as_string (NautilusFile       *file,
                                /* Translators: this is the day of the month followed by the abbreviated
                                 * month name followed by the year i.e. "3 Feb 2015" */
                                // xgettext:no-c-format
-                               format = N_("%-e %b %Y");
+                               format = _("%-e %b %Y");
                        } else {
                                if (use_24) {
                                        /* Translators: this is the day number followed
                                         * by the abbreviated month name followed by the year followed
                                         * by a time in 24h format i.e. "3 Feb 2015 23:04" */
                                        // xgettext:no-c-format
-                                       format = N_("%-e %b %Y %H:%M");
+                                       format = _("%-e %b %Y %H:%M");
                                } else {
                                        /* Translators: this is the day number followed
                                         * by the abbreviated month name followed by the year followed
                                         * by a time in 12h format i.e. "3 Feb 2015 9:04 PM" */
                                        // xgettext:no-c-format
-                                       format = N_("%-e %b %Y %l:%M %p");
+                                       format = _("%-e %b %Y %l:%M %p");
                                }
                        }
                }
@@ -4842,7 +4842,7 @@ nautilus_file_get_date_as_string (NautilusFile       *file,
                g_date_time_unref (today_midnight);
        } else {
                // xgettext:no-c-format
-               format = N_("%c");
+               format = _("%c");
        }
 
        result = g_date_time_format (file_date, format);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]