nautilus r13634 - in trunk: . libnautilus-private src/file-manager



Author: alexl
Date: Tue Jan 22 09:54:42 2008
New Revision: 13634
URL: http://svn.gnome.org/viewvc/nautilus?rev=13634&view=rev

Log:
2008-01-22  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-file-operations.c:
        * libnautilus-private/nautilus-file.c:
        * libnautilus-private/nautilus-progress-info.c:
        * src/file-manager/fm-directory-view.c:
        * src/file-manager/fm-properties-window.c:
	Use thousands separators (#41455)



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-file-operations.c
   trunk/libnautilus-private/nautilus-file.c
   trunk/libnautilus-private/nautilus-progress-info.c
   trunk/src/file-manager/fm-directory-view.c
   trunk/src/file-manager/fm-properties-window.c

Modified: trunk/libnautilus-private/nautilus-file-operations.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file-operations.c	(original)
+++ trunk/libnautilus-private/nautilus-file-operations.c	Tue Jan 22 09:54:42 2008
@@ -206,12 +206,12 @@
 	}
 	
 	if (seconds < 60) {
-		return g_strdup_printf (ngettext ("%d second","%d seconds", (int) seconds), (int) seconds);
+		return g_strdup_printf (ngettext ("%'d second","%'d seconds", (int) seconds), (int) seconds);
 	}
 
 	if (seconds < 60*60) {
 		minutes = (seconds + 30) / 60;
-		return g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes), minutes);
+		return g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
 	}
 
 	hours = seconds / (60*60);
@@ -221,16 +221,16 @@
 
 		minutes = (seconds - hours * 60 * 60 + 30) / 60;
 		
-		h = g_strdup_printf (ngettext ("%d hour", "%d hours", hours), hours);
-		m = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes), minutes);
+		h = g_strdup_printf (ngettext ("%'d hour", "%'d hours", hours), hours);
+		m = g_strdup_printf (ngettext ("%'d minute", "%'d minutes", minutes), minutes);
 		res = g_strconcat (h, ", ", m, NULL);
 		g_free (h);
 		g_free (m);
 		return res;
 	}
 	
-	return g_strdup_printf (ngettext ("approximately %d hour",
-					  "approximately %d hours",
+	return g_strdup_printf (ngettext ("approximately %'d hour",
+					  "approximately %'d hours",
 					  hours), hours);
 }
 
@@ -281,19 +281,19 @@
 			 * if there's no way to do that nicely for a
 			 * particular language.
 			 */
-			format = _("%dst link to %s");
+			format = _("%'dst link to %s");
 			break;
 		case 2:
 			/* appended to new link file */
-			format = _("%dnd link to %s");
+			format = _("%'dnd link to %s");
 			break;
 		case 3:
 			/* appended to new link file */
-			format = _("%drd link to %s");
+			format = _("%'drd link to %s");
 			break;
 		default:
 			/* appended to new link file */
-			format = _("%dth link to %s");
+			format = _("%'dth link to %s");
 			break;
 		}
 		result = g_strdup_printf (format, count, name);
@@ -347,20 +347,20 @@
 static const char untranslated_second_copy_duplicate_format[] = N_("%s (another copy)%s");
 
 /* localizers: appended to x11th file copy */
-static const char untranslated_x11th_copy_duplicate_format[] = N_("%s (%dth copy)%s");
+static const char untranslated_x11th_copy_duplicate_format[] = N_("%s (%'dth copy)%s");
 /* localizers: appended to x12th file copy */
-static const char untranslated_x12th_copy_duplicate_format[] = N_("%s (%dth copy)%s");
+static const char untranslated_x12th_copy_duplicate_format[] = N_("%s (%'dth copy)%s");
 /* localizers: appended to x13th file copy */
-static const char untranslated_x13th_copy_duplicate_format[] = N_("%s (%dth copy)%s");
+static const char untranslated_x13th_copy_duplicate_format[] = N_("%s (%'dth copy)%s");
 
 /* localizers: appended to x1st file copy */
-static const char untranslated_st_copy_duplicate_format[] = N_("%s (%dst copy)%s");
+static const char untranslated_st_copy_duplicate_format[] = N_("%s (%'dst copy)%s");
 /* localizers: appended to x2nd file copy */
-static const char untranslated_nd_copy_duplicate_format[] = N_("%s (%dnd copy)%s");
+static const char untranslated_nd_copy_duplicate_format[] = N_("%s (%'dnd copy)%s");
 /* localizers: appended to x3rd file copy */
-static const char untranslated_rd_copy_duplicate_format[] = N_("%s (%drd copy)%s");
+static const char untranslated_rd_copy_duplicate_format[] = N_("%s (%'drd copy)%s");
 /* localizers: appended to xxth file copy */
-static const char untranslated_th_copy_duplicate_format[] = N_("%s (%dth copy)%s");
+static const char untranslated_th_copy_duplicate_format[] = N_("%s (%'dth copy)%s");
 
 #define FIRST_COPY_DUPLICATE_FORMAT _(untranslated_first_copy_duplicate_format)
 #define SECOND_COPY_DUPLICATE_FORMAT _(untranslated_second_copy_duplicate_format)
@@ -466,7 +466,7 @@
 			}
 			*name_base = extract_string_until (name, tag);
 			/* localizers: opening parentheses of the "th copy)" string */
-			if (sscanf (tag, _(" (%d"), count) == 1) {
+			if (sscanf (tag, _(" (%'d"), count) == 1) {
 				if (*count < 1 || *count > 1000000) {
 					/* keep the count within a reasonable range */
 					*count = 0;
@@ -1072,9 +1072,9 @@
 					    "from the trash?"), files->data);
 	} else {
 		prompt = f (ngettext("Are you sure you want to permanently delete "
-				     "the %d selected item from the trash?",
+				     "the %'d selected item from the trash?",
 				     "Are you sure you want to permanently delete "
-				     "the %d selected items from the trash?",
+				     "the %'d selected items from the trash?",
 				     file_count), 
 			    file_count);
 	}
@@ -1114,9 +1114,9 @@
 			    files->data);
 	} else {
 		prompt = f (ngettext("Are you sure you want to permanently delete "
-				     "the %d selected item?",
+				     "the %'d selected item?",
 				     "Are you sure you want to permanently delete "
-				     "the %d selected items?", file_count),
+				     "the %'d selected items?", file_count),
 			    file_count);
 	}
 	
@@ -1160,8 +1160,8 @@
 	elapsed = g_timer_elapsed (job->time, NULL);
 	if (elapsed < SECONDS_NEEDED_FOR_RELIABLE_TRANSFER_RATE) {
 		char *s;
-		s = f (ngettext ("%d file left to delete",
-				 "%d files left to delete",
+		s = f (ngettext ("%'d file left to delete",
+				 "%'d files left to delete",
 				 files_left),
 		       files_left);
 		nautilus_progress_info_take_details (job->progress, s);
@@ -1171,8 +1171,8 @@
 		remaining_time = files_left / transfer_rate;
 
 		/* To translators: %T will expand to a time like "2 minutes" */		
-		s = f (ngettext ("%d file left to delete \xE2\x80\x94 %T left",
-				 "%d files left to delete \xE2\x80\x94 %T left",
+		s = f (ngettext ("%'d file left to delete \xE2\x80\x94 %T left",
+				 "%'d files left to delete \xE2\x80\x94 %T left",
 				 files_left),
 		       files_left, remaining_time);
 		nautilus_progress_info_take_details (job->progress, s);
@@ -1463,8 +1463,8 @@
 	nautilus_progress_info_take_status (job->progress,
 					    f (_("Moving files to trash")));
 
-	s = f (ngettext ("%d file left to trash",
-			 "%d files left to trash",
+	s = f (ngettext ("%'d file left to trash",
+			 "%'d files left to trash",
 			 files_left),
 	       files_left);
 	nautilus_progress_info_take_details (job->progress, s);
@@ -2000,19 +2000,19 @@
 	switch (source_info->op) {
 	default:
 	case OP_KIND_COPY:
-		s = f (_("Preparing to copy %d files (%S)"),
+		s = f (_("Preparing to copy %'d files (%S)"),
 		       source_info->num_files, source_info->num_bytes);
 		break;
 	case OP_KIND_MOVE:
-		s = f (_("Preparing to move %d files (%S)"),
+		s = f (_("Preparing to move %'d files (%S)"),
 		       source_info->num_files, source_info->num_bytes);
 		break;
 	case OP_KIND_DELETE:
-		s = f (_("Preparing to delete %d files (%S)"),
+		s = f (_("Preparing to delete %'d files (%S)"),
 		       source_info->num_files, source_info->num_bytes);
 		break;
 	case OP_KIND_TRASH:
-		s = f (_("Preparing to trash %d files"),
+		s = f (_("Preparing to trash %'d files"),
 		       source_info->num_files);
 		break;
 	} 
@@ -2480,20 +2480,20 @@
 		if (copy_job->destination != NULL) {
 			nautilus_progress_info_take_status (job->progress,
 							    f (is_move?
-							       ngettext ("Moving %d file (in \"%B\") to \"%B\"",
-									 "Moving %d files (in \"%B\") to \"%B\"",
+							       ngettext ("Moving %'d file (in \"%B\") to \"%B\"",
+									 "Moving %'d files (in \"%B\") to \"%B\"",
 									 files_left)
 							       :
-							       ngettext ("Copying %d file (in \"%B\") to \"%B\"",
-									 "Copying %d files (in \"%B\") to \"%B\"",
+							       ngettext ("Copying %'d file (in \"%B\") to \"%B\"",
+									 "Copying %'d files (in \"%B\") to \"%B\"",
 									 files_left),
 							       files_left,
 							       (GFile *)copy_job->files->data,
 							       copy_job->destination));
 		} else {
 			nautilus_progress_info_take_status (job->progress,
-							    f (ngettext ("Duplicating %d file (in \"%B\")",
-									 "Duplicating %d files (in \"%B\")",
+							    f (ngettext ("Duplicating %'d file (in \"%B\")",
+									 "Duplicating %'d files (in \"%B\")",
 									 files_left),
 							       files_left,
 							       (GFile *)copy_job->files->data));
@@ -2502,18 +2502,18 @@
 		if (copy_job->destination != NULL) {
 			nautilus_progress_info_take_status (job->progress,
 							    f (is_move?
-							       ngettext ("Moving %d file to \"%B\"",
-									 "Moving %d files to \"%B\"",
+							       ngettext ("Moving %'d file to \"%B\"",
+									 "Moving %'d files to \"%B\"",
 									 files_left)
 							       :
-							       ngettext ("Copying %d file to \"%B\"",
-									 "Copying %d files to \"%B\"",
+							       ngettext ("Copying %'d file to \"%B\"",
+									 "Copying %'d files to \"%B\"",
 									 files_left),
 							       files_left, copy_job->destination));
 		} else {
 			nautilus_progress_info_take_status (job->progress,
-							    f (ngettext ("Duplicating %d file",
-									 "Duplicating %d files",
+							    f (ngettext ("Duplicating %'d file",
+									 "Duplicating %'d files",
 									 files_left),
 							       files_left));
 		}
@@ -3608,8 +3608,8 @@
 					       move_job->destination));
 
 	nautilus_progress_info_take_details (job->progress,
-					     f (ngettext ("Preparing to move %d file",
-							  "Preparing to move %d files",
+					     f (ngettext ("Preparing to move %'d file",
+							  "Preparing to move %'d files",
 							  left), left));
 
 	nautilus_progress_info_pulse_progress (job->progress);
@@ -4055,8 +4055,8 @@
 					       link_job->destination));
 
 	nautilus_progress_info_take_details (job->progress,
-					     f (ngettext ("Making links to %d file",
-							  "Making links to %d files",
+					     f (ngettext ("Making links to %'d file",
+							  "Making links to %'d files",
 							  left), left));
 
 	nautilus_progress_info_set_progress (job->progress, (double)left / total);

Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c	(original)
+++ trunk/libnautilus-private/nautilus-file.c	Tue Jan 22 09:54:42 2008
@@ -4839,9 +4839,9 @@
 
 	return g_strdup_printf (includes_directories
 			? (includes_files 
-			   ? ngettext ("%u item", "%u items", item_count) 
-			   : ngettext ("%u folder", "%u folders", item_count))
-			: ngettext ("%u file", "%u files", item_count), item_count);
+			   ? ngettext ("%'u item", "%'u items", item_count) 
+			   : ngettext ("%'u folder", "%'u folders", item_count))
+			: ngettext ("%'u file", "%'u files", item_count), item_count);
 }
 
 /**

Modified: trunk/libnautilus-private/nautilus-progress-info.c
==============================================================================
--- trunk/libnautilus-private/nautilus-progress-info.c	(original)
+++ trunk/libnautilus-private/nautilus-progress-info.c	Tue Jan 22 09:54:42 2008
@@ -281,8 +281,8 @@
 {
 	char *tooltip;
 
-	tooltip = g_strdup_printf (ngettext ("%d file operation active",
-					     "%d file operations active",
+	tooltip = g_strdup_printf (ngettext ("%'d file operation active",
+					     "%'d file operations active",
 					     n_progress_ops),
 				   n_progress_ops);
 	gtk_status_icon_set_tooltip (status_icon, tooltip);

Modified: trunk/src/file-manager/fm-directory-view.c
==============================================================================
--- trunk/src/file-manager/fm-directory-view.c	(original)
+++ trunk/src/file-manager/fm-directory-view.c	Tue Jan 22 09:54:42 2008
@@ -609,8 +609,8 @@
 	}
 
 	prompt = _("Are you sure you want to open all files?");
-	detail = g_strdup_printf (ngettext("This will open %d separate window.",
-					   "This will open %d separate windows.", count), count);
+	detail = g_strdup_printf (ngettext("This will open %'d separate window.",
+					   "This will open %'d separate windows.", count), count);
 	dialog = eel_show_yes_no_dialog (prompt, detail, 
 					 GTK_STOCK_OK, GTK_STOCK_CANCEL,
 					 parent_window);
@@ -634,7 +634,7 @@
 	 * Otherwise, we will complain.
 	 */
 	if (!view->details->menu_states_untrustworthy) {
-		g_warning ("Expected one selected item, found %d. No action will be performed.", 	
+		g_warning ("Expected one selected item, found %'d. No action will be performed.", 	
 			   g_list_length (selection));
 	}
 
@@ -2029,8 +2029,8 @@
 		if (folder_count == 1 && non_folder_count == 0) {
 			folder_count_str = g_strdup_printf (_("\"%s\" selected"), first_item_name);
 		} else {
-			folder_count_str = g_strdup_printf (ngettext("%d folder selected", 
-								     "%d folders selected", 
+			folder_count_str = g_strdup_printf (ngettext("%'d folder selected", 
+								     "%'d folders selected", 
 								     folder_count), 
 							    folder_count);
 		}
@@ -2039,8 +2039,8 @@
 			if (!folder_item_count_known) {
 				folder_item_count_str = g_strdup ("");
 			} else {
-				folder_item_count_str = g_strdup_printf (ngettext(" (containing %d item)",
-										  " (containing %d items)",
+				folder_item_count_str = g_strdup_printf (ngettext(" (containing %'d item)",
+										  " (containing %'d items)",
 										  folder_item_count), 
 									 folder_item_count);
 			}
@@ -2050,8 +2050,8 @@
 				folder_item_count_str = g_strdup ("");
 			} else {
 				/* translators: this is preceded with a string of form 'N folders' (N more than 1) */
-				folder_item_count_str = g_strdup_printf (ngettext(" (containing a total of %d item)",
-										  " (containing a total of %d items)",
+				folder_item_count_str = g_strdup_printf (ngettext(" (containing a total of %'d item)",
+										  " (containing a total of %'d items)",
 										  folder_item_count), 
 									 folder_item_count);
 			}
@@ -2067,15 +2067,15 @@
 				items_string = g_strdup_printf (_("\"%s\" selected"), 
 								  first_item_name);
 			} else {
-				items_string = g_strdup_printf (ngettext("%d item selected",
-									   "%d items selected",
+				items_string = g_strdup_printf (ngettext("%'d item selected",
+									   "%'d items selected",
 									   non_folder_count), 
 								  non_folder_count);
 			}
 		} else {
 			/* Folders selected also, use "other" terminology */
-			items_string = g_strdup_printf (ngettext("%d other item selected",
-								   "%d other items selected",
+			items_string = g_strdup_printf (ngettext("%'d other item selected",
+								   "%'d other items selected",
 								   non_folder_count), 
 							  non_folder_count);
 		}
@@ -2107,7 +2107,7 @@
 
 		item_count = fm_directory_view_get_item_count (view);
 		
-		item_count_str = g_strdup_printf (ngettext ("%u item", "%u items", item_count), item_count);
+		item_count_str = g_strdup_printf (ngettext ("%'u item", "%'u items", item_count), item_count);
 
 		free_space_str = nautilus_file_get_volume_free_space (view->details->directory_as_file);
 		if (free_space_str != NULL) {
@@ -5525,16 +5525,16 @@
 		g_free (name);
 	} else {
 		if (cut) {
-			status_string = g_strdup_printf (ngettext("The %d selected item will be moved "
+			status_string = g_strdup_printf (ngettext("The %'d selected item will be moved "
 								  "if you select the Paste command",
-								  "The %d selected items will be moved "
+								  "The %'d selected items will be moved "
 								  "if you select the Paste command",
 								  count),
 							 count);
 		} else {
-			status_string = g_strdup_printf (ngettext("The %d selected item will be copied "
+			status_string = g_strdup_printf (ngettext("The %'d selected item will be copied "
 								  "if you select the Paste command",
-								  "The %d selected items will be copied "
+								  "The %'d selected items will be copied "
 								  "if you select the Paste command",
 								  count),
 							 count);
@@ -7066,8 +7066,8 @@
 			if (selection_count == 0 || selection_count == 1) {
 				label_with_underscore = g_strdup (_("Open in New Window"));
 			} else {
-				label_with_underscore = g_strdup_printf (ngettext("Open in %d New Window",
-										  "Open in %d New Windows",
+				label_with_underscore = g_strdup_printf (ngettext("Open in %'d New Window",
+										  "Open in %'d New Windows",
 										  selection_count), 
 									 selection_count);
 			}
@@ -7076,8 +7076,8 @@
 			if (selection_count == 0 || selection_count == 1) {
 				label_with_underscore = g_strdup (_("Browse in New Window"));
 			} else {
-				label_with_underscore = g_strdup_printf (ngettext("Browse in %d New Window",
-										  "Browse in %d New Windows",
+				label_with_underscore = g_strdup_printf (ngettext("Browse in %'d New Window",
+										  "Browse in %'d New Windows",
 										  selection_count), 
 									 selection_count);
 			}

Modified: trunk/src/file-manager/fm-properties-window.c
==============================================================================
--- trunk/src/file-manager/fm-properties-window.c	(original)
+++ trunk/src/file-manager/fm-properties-window.c	Tue Jan 22 09:54:42 2008
@@ -2288,8 +2288,8 @@
 	} else {
 		char *size_str;
 		size_str = g_format_size_for_display (total_size);
-		text = g_strdup_printf (ngettext("%d item, with size %s",
-						 "%d items, totalling %s",
+		text = g_strdup_printf (ngettext("%'d item, with size %s",
+						 "%'d items, totalling %s",
 						 total_count),
 					total_count, size_str);
 		g_free (size_str);



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