PATCH, i18n - Use thousands separators in user-visible strings (Bug #41455)
- From: Gregory Merchan <merchan phys lsu edu>
- To: nautilus-list gnome org
- Subject: PATCH, i18n - Use thousands separators in user-visible strings (Bug #41455)
- Date: Mon, 15 Jul 2002 22:41:34 -0500
The attached patch should close bug #41455 for all SUSv2 (and later?)
systems. Afaict, non-compliant systems will see warnings but will not
otherwise be affected.
I think I caught all of the user-visible strings. Some are unchanged
because the number should never be greater than 999, such as a display
of seconds.
This is a string change and a ui change. Note the freeze on Friday.
Commit?
Cheers,
Greg Merchan
Index: components/hardware/nautilus-hardware-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/hardware/nautilus-hardware-view.c,v
retrieving revision 1.54
diff -p -u -r1.54 nautilus-hardware-view.c
--- components/hardware/nautilus-hardware-view.c 17 Apr 2002 13:46:11 -0000 1.54
+++ components/hardware/nautilus-hardware-view.c 16 Jul 2002 03:31:10 -0000
@@ -341,9 +341,9 @@ get_RAM_description (void)
ram_size = (strtoul (temp_str, NULL, 10) + 500) / 1000;
if (ram_size >= 1000) {
- result = g_strdup_printf (_("%lu GB RAM"), ram_size / 1000);
+ result = g_strdup_printf (_("%'lu GB RAM"), ram_size / 1000);
} else {
- result = g_strdup_printf (_("%lu MB RAM"), ram_size);
+ result = g_strdup_printf (_("%'lu MB RAM"), ram_size);
}
g_free (temp_str);
@@ -401,9 +401,9 @@ get_IDE_description (const char *device)
capacity = (512 * (strtoul (temp_str, NULL, 10) / 1000)) / 1000;
if (capacity >= 1000) {
- num_str = g_strdup_printf (_("%lu GB"), capacity / 1000);
+ num_str = g_strdup_printf (_("%'lu GB"), capacity / 1000);
} else {
- num_str = g_strdup_printf (_("%lu MB"), capacity);
+ num_str = g_strdup_printf (_("%'lu MB"), capacity);
}
g_string_append (string_data, "\n");
@@ -483,7 +483,7 @@ update_uptime_text (gpointer callback_da
uptime_hours = (uptime_seconds - (uptime_days * 86400)) / 3600;
uptime_minutes = (uptime_seconds - (uptime_days * 86400) - (uptime_hours * 3600)) / 60;
- uptime_text = g_strdup_printf (_("Uptime is %d days, %d hours, %d minutes"), uptime_days, uptime_hours, uptime_minutes);
+ uptime_text = g_strdup_printf (_("Uptime is %'d days, %d hours, %d minutes"), uptime_days, uptime_hours, uptime_minutes);
gtk_label_set_text (NAUTILUS_HARDWARE_VIEW (callback_data)->details->uptime_label, uptime_text);
g_free (uptime_text);
@@ -744,7 +744,7 @@ make_summary_string (NautilusHardwareVie
if (hardware_view->details->cpu_count == 1) {
return g_strdup ("1 CPU");
} else {
- return g_strdup_printf ("%d CPUs", hardware_view->details->cpu_count);
+ return g_strdup_printf ("%'d CPUs", hardware_view->details->cpu_count);
}
}
Index: components/music/fileinfo.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/music/fileinfo.c,v
retrieving revision 1.9
diff -p -u -r1.9 fileinfo.c
--- components/music/fileinfo.c 7 Mar 2002 19:35:45 -0000 1.9
+++ components/music/fileinfo.c 16 Jul 2002 03:31:10 -0000
@@ -183,8 +183,8 @@ static void file_info_http(char *filenam
mpg123_bitrate != 0)
{
set_mpeg_level_label(mpg123_mpeg25, mpg123_lsf, mpg123_layer);
- label_set_text(mpeg_bitrate, _("Bitrate: %d kb/s"), mpg123_bitrate);
- label_set_text(mpeg_samplerate, _("Samplerate: %ld Hz"), mpg123_frequency);
+ label_set_text(mpeg_bitrate, _("Bitrate: %'d kb/s"), mpg123_bitrate);
+ label_set_text(mpeg_samplerate, _("Samplerate: %'ld Hz"), mpg123_frequency);
label_set_text(mpeg_flags, "%s", channel_mode_name(mpg123_mode));
}
}
@@ -453,16 +453,16 @@ void mpg123_file_info_box(char *filename
if (mpg123_get_xing_header(&xing_header, buf))
{
num_frames = xing_header.frames;
- label_set_text(mpeg_bitrate, _("Bitrate: Variable,\navg. bitrate: %d kb/s"), (gint) ((xing_header.bytes * 8) / (tpf * xing_header.frames * 1000)));
+ label_set_text(mpeg_bitrate, _("Bitrate: Variable,\navg. bitrate: %'d kb/s"), (gint) ((xing_header.bytes * 8) / (tpf * xing_header.frames * 1000)));
}
else
{
num_frames = ((ftell(fh) - pos - (id3_found ? 128 : 0)) / mpg123_compute_bpf(&frm)) + 1;
- label_set_text(mpeg_bitrate, _("Bitrate: %d kb/s"), tabsel_123[frm.lsf][frm.lay - 1][frm.bitrate_index]);
+ label_set_text(mpeg_bitrate, _("Bitrate: %'d kb/s"), tabsel_123[frm.lsf][frm.lay - 1][frm.bitrate_index]);
}
- label_set_text(mpeg_samplerate, _("Samplerate: %ld Hz"), mpg123_freqs[frm.sampling_frequency]);
+ label_set_text(mpeg_samplerate, _("Samplerate: %'ld Hz"), mpg123_freqs[frm.sampling_frequency]);
label_set_text(mpeg_flags, _("%s\nError protection: %s\nCopyright: %s\nOriginal: %s\nEmphasis: %s"), channel_mode_name(frm.mode), bool_label[frm.error_protection], bool_label[frm.copyright], bool_label[frm.original], emphasis[frm.emphasis]);
- label_set_text(mpeg_fileinfo, _("%d frames\nFilesize: %lu B"), num_frames, ftell(fh));
+ label_set_text(mpeg_fileinfo, _("%'d frames\nFilesize: %'lu B"), num_frames, ftell(fh));
g_free(buf);
}
fclose(fh);
Index: components/music/nautilus-music-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/music/nautilus-music-view.c,v
retrieving revision 1.173
diff -p -u -r1.173 nautilus-music-view.c
--- components/music/nautilus-music-view.c 8 Jul 2002 15:32:02 -0000 1.173
+++ components/music/nautilus-music-view.c 16 Jul 2002 03:31:12 -0000
@@ -271,7 +271,7 @@ track_cell_data_func (GtkTreeViewColumn
str = NULL;
}
else {
- str = g_strdup_printf ("%d", track_number);
+ str = g_strdup_printf ("%'d", track_number);
}
g_object_set (cell,
@@ -296,7 +296,7 @@ bitrate_cell_data_func (GtkTreeViewColum
str = g_strdup (_("Unknown"));
}
else {
- str = g_strdup_printf ("%d kbps", bitrate);
+ str = g_strdup_printf ("%'d kbps", bitrate);
}
g_object_set (cell,
@@ -322,7 +322,7 @@ time_cell_data_func (GtkTreeViewColumn *
minutes = seconds / 60;
remain_seconds = seconds - (60 * minutes);
- str = g_strdup_printf ("%d:%02d ", minutes, remain_seconds);
+ str = g_strdup_printf ("%'d:%02d ", minutes, remain_seconds);
g_object_set (cell,
"text", str,
@@ -1130,7 +1130,7 @@ play_status_display (NautilusMusicView *
minutes = seconds / 60;
seconds = seconds % 60;
- play_time_str = g_strdup_printf ("<span size=\"x-large\">%02d:%02d</span>", minutes, seconds);
+ play_time_str = g_strdup_printf ("<span size=\"x-large\">%'02d:%02d</span>", minutes, seconds);
percentage = (float) ((float)current_time / (float)music_view->details->current_duration) * 100.0;
@@ -1382,7 +1382,7 @@ slider_moved_callback (GtkWidget *bar, G
minutes = seconds / 60;
seconds = seconds % 60;
- temp_str = g_strdup_printf ("<span size=\"x-large\">%02d:%02d</span>", minutes, seconds);
+ temp_str = g_strdup_printf ("<span size=\"x-large\">%'02d:%02d</span>", minutes, seconds);
gtk_label_set_markup (GTK_LABEL(music_view->details->playtime), temp_str);
}
Index: libnautilus-private/nautilus-file-operations-progress.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations-progress.c,v
retrieving revision 1.36
diff -p -u -r1.36 nautilus-file-operations-progress.c
--- libnautilus-private/nautilus-file-operations-progress.c 17 Apr 2002 12:29:10 -0000 1.36
+++ libnautilus-private/nautilus-file-operations-progress.c 16 Jul 2002 03:31:15 -0000
@@ -415,7 +415,7 @@ nautilus_file_operations_progress_new_fi
(EEL_ELLIPSIZING_LABEL (progress->details->item_name),
item_name);
- progress_count = g_strdup_printf (_("%ld of %ld"),
+ progress_count = g_strdup_printf (_("%'ld of %'ld"),
file_index,
progress->details->files_total);
gtk_label_set_text (GTK_LABEL (progress->details->progress_count_label), progress_count);
Index: libnautilus-private/nautilus-file-operations.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations.c,v
retrieving revision 1.153
diff -p -u -r1.153 nautilus-file-operations.c
--- libnautilus-private/nautilus-file-operations.c 12 Jul 2002 18:36:13 -0000 1.153
+++ libnautilus-private/nautilus-file-operations.c 16 Jul 2002 03:31:17 -0000
@@ -1126,19 +1126,19 @@ get_link_name (char *name, int count)
* 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;
}
unescaped_result = g_strdup_printf (format, count, unescaped_name);
@@ -1196,20 +1196,20 @@ static const char untranslated_first_cop
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)
@@ -1315,7 +1315,7 @@ parse_previous_duplicate_name (const cha
}
*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;
Index: libnautilus-private/nautilus-file.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v
retrieving revision 1.294
diff -p -u -r1.294 nautilus-file.c
--- libnautilus-private/nautilus-file.c 2 Jul 2002 20:40:34 -0000 1.294
+++ libnautilus-private/nautilus-file.c 16 Jul 2002 03:31:22 -0000
@@ -3810,8 +3810,8 @@ format_item_count_for_display (guint ite
: _("1 file"));
}
return g_strdup_printf (includes_directories
- ? (includes_files ? _("%u items") : _("%u folders"))
- : _("%u files"), item_count);
+ ? (includes_files ? _("%'u items") : _("%'u folders"))
+ : _("%'u files"), item_count);
}
/**
Index: src/nautilus-location-bar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-location-bar.c,v
retrieving revision 1.90
diff -p -u -r1.90 nautilus-location-bar.c
--- src/nautilus-location-bar.c 11 Jul 2002 08:16:20 -0000 1.90
+++ src/nautilus-location-bar.c 16 Jul 2002 03:31:23 -0000
@@ -148,7 +148,7 @@ drag_data_received_callback (GtkWidget *
*/
name_count = g_list_length (names);
if (name_count > 1) {
- prompt = g_strdup_printf (_("Do you want to view these %d locations "
+ prompt = g_strdup_printf (_("Do you want to view these %'d locations "
"in separate windows?"),
name_count);
/* eel_run_simple_dialog should really take in pairs
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.545
diff -p -u -r1.545 fm-directory-view.c
--- src/file-manager/fm-directory-view.c 15 Jul 2002 18:13:23 -0000 1.545
+++ src/file-manager/fm-directory-view.c 16 Jul 2002 03:31:29 -0000
@@ -473,9 +473,9 @@ fm_directory_view_confirm_multiple_windo
return TRUE;
}
- prompt = g_strdup_printf (_("This will open %d separate windows. "
+ prompt = g_strdup_printf (_("This will open %'d separate windows. "
"Are you sure you want to do this?"), count);
- title = g_strdup_printf (_("Open %d Windows?"), count);
+ title = g_strdup_printf (_("Open %'d Windows?"), count);
dialog = eel_show_yes_no_dialog (prompt, title,
GTK_STOCK_OK, GTK_STOCK_CANCEL,
fm_directory_view_get_containing_window (view));
@@ -823,7 +823,7 @@ confirm_delete_directly (FMDirectoryView
g_free (file_name);
} else {
prompt = g_strdup_printf (_("Are you sure you want to permanently delete "
- "the %d selected items?"), uri_count);
+ "the %'d selected items?"), uri_count);
}
dialog = eel_show_yes_no_dialog
@@ -1495,7 +1495,7 @@ fm_directory_view_display_selection_info
folder_count_str = g_strdup (_("1 folder selected"));
}
} else {
- folder_count_str = g_strdup_printf (_("%d folders selected"), folder_count);
+ folder_count_str = g_strdup_printf (_("%'d folders selected"), folder_count);
}
if (folder_count == 1) {
@@ -1506,7 +1506,7 @@ fm_directory_view_display_selection_info
} else if (folder_item_count == 1) {
folder_item_count_str = g_strdup (_(" (containing 1 item)"));
} else {
- folder_item_count_str = g_strdup_printf (_(" (containing %d items)"), folder_item_count);
+ folder_item_count_str = g_strdup_printf (_(" (containing %'d items)"), folder_item_count);
}
}
else {
@@ -1517,7 +1517,7 @@ fm_directory_view_display_selection_info
} else if (folder_item_count == 1) {
folder_item_count_str = g_strdup (_(" (containing a total of 1 item)"));
} else {
- folder_item_count_str = g_strdup_printf (_(" (containing a total of %d items)"), folder_item_count);
+ folder_item_count_str = g_strdup_printf (_(" (containing a total of %'d items)"), folder_item_count);
}
}
@@ -1534,7 +1534,7 @@ fm_directory_view_display_selection_info
first_item_name,
size_string);
} else {
- non_folder_str = g_strdup_printf (_("%d items selected (%s)"),
+ non_folder_str = g_strdup_printf (_("%'d items selected (%s)"),
non_folder_count,
size_string);
}
@@ -1544,7 +1544,7 @@ fm_directory_view_display_selection_info
non_folder_str = g_strdup_printf (_("1 other item selected (%s)"),
size_string);
} else {
- non_folder_str = g_strdup_printf (_("%d other items selected (%s)"),
+ non_folder_str = g_strdup_printf (_("%'d other items selected (%s)"),
non_folder_count,
size_string);
}
@@ -3035,13 +3035,13 @@ fm_directory_view_confirm_deletion (FMDi
g_free (file_name);
} else {
if (all) {
- prompt = g_strdup_printf (_("The %d selected items cannot be moved "
+ prompt = g_strdup_printf (_("The %'d selected items cannot be moved "
"to the Trash. Do you want to delete them "
"immediately?"), uri_count);
} else {
- prompt = g_strdup_printf (_("%d of the selected items cannot be moved "
+ prompt = g_strdup_printf (_("%'d of the selected items cannot be moved "
"to the Trash. Do you want to delete those "
- "%d items immediately?"), uri_count, uri_count);
+ "%'d items immediately?"), uri_count, uri_count);
}
}
@@ -3084,7 +3084,7 @@ confirm_delete_from_trash (FMDirectoryVi
g_free (file_name);
} else {
prompt = g_strdup_printf (_("Are you sure you want to permanently delete "
- "the %d selected items from the Trash?"), uri_count);
+ "the %'d selected items from the Trash?"), uri_count);
}
dialog = eel_show_yes_no_dialog (
@@ -4092,11 +4092,11 @@ copy_or_cut_files (FMDirectoryView *view
g_free (name);
} else {
if (cut) {
- status_string = g_strdup_printf (_("The %d selected items will be moved "
+ status_string = g_strdup_printf (_("The %'d selected items will be moved "
"if you select the Paste Files command"),
count);
} else {
- status_string = g_strdup_printf (_("The %d selected items will be copied "
+ status_string = g_strdup_printf (_("The %'d selected items will be copied "
"if you select the Paste Files command"),
count);
}
@@ -4366,7 +4366,7 @@ real_update_menus (FMDirectoryView *view
if (selection_count <= 1) {
label_with_underscore = g_strdup (_("Open _in New Window"));
} else {
- label_with_underscore = g_strdup_printf (_("Open _in %d New Windows"), selection_count);
+ label_with_underscore = g_strdup_printf (_("Open _in %'d New Windows"), selection_count);
}
nautilus_bonobo_set_label
(view->details->ui,
Index: src/file-manager/fm-properties-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-properties-window.c,v
retrieving revision 1.154
diff -p -u -r1.154 fm-properties-window.c
--- src/file-manager/fm-properties-window.c 11 Jul 2002 17:54:29 -0000 1.154
+++ src/file-manager/fm-properties-window.c 16 Jul 2002 03:31:31 -0000
@@ -1165,7 +1165,7 @@ directory_contents_value_field_update (F
if (total_count == 1) {
text = g_strdup_printf (_("1 item, with size %s"), size_string);
} else {
- text = g_strdup_printf (_("%d items, totalling %s"), total_count, size_string);
+ text = g_strdup_printf (_("%'d items, totalling %s"), total_count, size_string);
}
g_free (size_string);
Index: src/file-manager/fm-search-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-search-list-view.c,v
retrieving revision 1.96
diff -p -u -r1.96 fm-search-list-view.c
--- src/file-manager/fm-search-list-view.c 7 Mar 2002 19:36:17 -0000 1.96
+++ src/file-manager/fm-search-list-view.c 16 Jul 2002 03:31:32 -0000
@@ -565,7 +565,7 @@ compute_reveal_item_name_and_sensitivity
* items visible (this comment is to inform translators of this
* tricky concept).
*/
- name_with_underscore = g_strdup_printf (_("Reveal in %d _New Windows"), count);
+ name_with_underscore = g_strdup_printf (_("Reveal in %'d _New Windows"), count);
}
*return_sensitivity = selected_files != NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]