Merge branch 'wip/piotrdrag/i18n-fixes' into 'master'

Add translator comments and disambiguate a string

See merge request GNOME/sysprof!7
This commit is contained in:
Christian Hergert
2018-09-25 18:50:16 +00:00
6 changed files with 30 additions and 13 deletions

View File

@ -55,7 +55,7 @@
<child type="center">
<object class="GtkLabel">
<property name="hexpand">true</property>
<property name="label" translatable="yes">Profile my _entire system</property>
<property name="label" translatable="yes" comments="Translators: This is the description for a switch.">Profile my _entire system</property>
<property name="use-underline">true</property>
<property name="visible">true</property>
<property name="xalign">1</property>
@ -92,7 +92,7 @@
</style>
<child>
<object class="GtkEntry" id="process_filter_entry">
<property name="placeholder-text" translatable="yes">Search</property>
<property name="placeholder-text" translatable="yes" comments="Translators: This is the placeholder in a search entry.">Search</property>
<property name="visible">true</property>
</object>
</child>
@ -161,7 +161,7 @@
<child>
<object class="GtkCheckButton" id="inherit_environ">
<property name="active">true</property>
<property name="label" translatable="yes">Inherit current environment</property>
<property name="label" translatable="yes" comments="Translators: This is a check button.">Inherit current environment</property>
<property name="visible">true</property>
</object>
</child>

View File

@ -272,6 +272,7 @@ handle_capture_results (GObject *object,
if (state->has_cpu)
{
GtkWidget *row = g_object_new (SP_TYPE_CPU_VISUALIZER_ROW,
/* Translators: CPU is the processor. */
"title", _("CPU"),
"height-request", 50,
"selectable", FALSE,
@ -286,6 +287,7 @@ handle_capture_results (GObject *object,
{
GdkRGBA rgba;
GtkWidget *row = g_object_new (SP_TYPE_LINE_VISUALIZER_ROW,
/* Translators: FPS is frames per second. */
"title", _("FPS"),
"height-request", 35,
"selectable", FALSE,

View File

@ -134,11 +134,13 @@ sp_profiler_menu_button_update_label (SpProfilerMenuButton *self)
if (n_pids == 1)
{
/* Translators: %d is the PID of the process. */
str = g_strdup_printf (_("Process %d"), pids[0]);
gtk_label_set_label (priv->label, str);
return;
}
/* Translators: %u is the number (amount) of processes. */
str = g_strdup_printf (ngettext("%u Process", "%u Processes", n_pids), n_pids);
gtk_label_set_label (priv->label, str);
}

View File

@ -41,7 +41,7 @@
</child>
<child>
<object class="GtkButton" id="record_button">
<property name="label" translatable="yes">_Record</property>
<property name="label" translatable="yes" comments="Translators: This is a button.">_Record</property>
<property name="use-underline">true</property>
<property name="visible">true</property>
<property name="width-request">100</property>
@ -115,7 +115,7 @@
</child>
<child>
<object class="GtkButton" id="close_info_button">
<property name="label" translatable="yes">_Close</property>
<property name="label" translatable="yes" comments="Translators: This is a button.">_Close</property>
<property name="use-underline">true</property>
<property name="visible">true</property>
<property name="width-request">100</property>
@ -209,7 +209,7 @@
<object class="GtkButton">
<property name="action-name">zoom.zoom-out</property>
<property name="hexpand">true</property>
<property name="tooltip-text" translatable="yes">Zoom out (Ctrl+-)</property>
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Zoom out (Ctrl+-)</property>
<property name="visible">true</property>
<style>
<class name="image-button"/>
@ -225,7 +225,7 @@
<child>
<object class="GtkButton">
<property name="action-name">zoom.zoom-one</property>
<property name="tooltip-text" translatable="yes">Reset zoom level (Ctrl+0)</property>
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Reset zoom level (Ctrl+0)</property>
<property name="visible">true</property>
<child>
<object class="GtkLabel" id="zoom_one_label">
@ -239,7 +239,7 @@
<object class="GtkButton">
<property name="action-name">zoom.zoom-in</property>
<property name="hexpand">true</property>
<property name="tooltip-text" translatable="yes">Zoom in (Ctrl++)</property>
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Zoom in (Ctrl++)</property>
<property name="visible">true</property>
<style>
<class name="image-button"/>
@ -264,7 +264,7 @@
<child>
<object class="GtkModelButton">
<property name="action-name">app.new-window</property>
<property name="text" translatable="yes">New Window</property>
<property name="text" translatable="yes" comments="Translators: This is a menu label.">New Window</property>
<property name="visible">true</property>
</object>
</child>
@ -277,14 +277,14 @@
<child>
<object class="GtkModelButton">
<property name="action-name">win.open-capture</property>
<property name="text" translatable="yes">Open Capture…</property>
<property name="text" translatable="yes" context="menu label" comments="Translators: This is a menu label.">Open Capture…</property>
<property name="visible">true</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="action-name">win.save-capture</property>
<property name="text" translatable="yes">Save As…</property>
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Save As…</property>
<property name="visible">true</property>
</object>
</child>
@ -297,7 +297,7 @@
<child>
<object class="GtkModelButton">
<property name="action-name">win.screenshot</property>
<property name="text" translatable="yes">Screenshot</property>
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Screenshot</property>
<property name="visible">true</property>
</object>
</child>
@ -310,7 +310,7 @@
<child>
<object class="GtkModelButton">
<property name="action-name">win.close-capture</property>
<property name="text" translatable="yes">Close</property>
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Close</property>
<property name="visible">true</property>
</object>
</child>

View File

@ -146,6 +146,7 @@ sp_window_update_stats (gpointer data)
sp_capture_writer_stat (writer, &stbuf);
count = stbuf.frame_count[SP_CAPTURE_FRAME_SAMPLE];
/* Translators: %u is the number (amount) of samples. */
str = g_strdup_printf (_("Samples: %u"), count);
gtk_label_set_label (self->stat_label, str);
}
@ -192,6 +193,7 @@ sp_window_update_subtitle (SpWindow *self)
dt = g_date_time_new_from_timeval_local (&tv);
str = g_date_time_format (dt, "%x %X");
/* Translators: The first %s is a file name, the second is the date and time. */
label = g_strdup_printf (_("%s — %s"), filename, str);
gtk_label_set_label (self->subtitle, label);
@ -303,6 +305,7 @@ sp_window_set_state (SpWindow *self,
{
case SP_WINDOW_STATE_EMPTY:
case SP_WINDOW_STATE_FAILED:
/* Translators: This is a button. */
gtk_button_set_label (self->record_button, _("Record"));
gtk_widget_set_sensitive (GTK_WIDGET (self->record_button), TRUE);
add_class (self->record_button, "suggested-action");
@ -323,6 +326,7 @@ sp_window_set_state (SpWindow *self,
break;
case SP_WINDOW_STATE_RECORDING:
/* Translators: This is a button. */
gtk_button_set_label (self->record_button, _("Stop"));
gtk_widget_set_sensitive (GTK_WIDGET (self->record_button), TRUE);
remove_class (self->record_button, "suggested-action");
@ -347,6 +351,7 @@ sp_window_set_state (SpWindow *self,
break;
case SP_WINDOW_STATE_BROWSING:
/* Translators: This is a button. */
gtk_button_set_label (self->record_button, _("Record"));
gtk_widget_set_sensitive (GTK_WIDGET (self->record_button), TRUE);
add_class (self->record_button, "suggested-action");
@ -592,10 +597,13 @@ sp_window_save_capture (GSimpleAction *action,
reader = sp_capture_reader_ref (self->reader);
/* Translators: This is a window title. */
dialog = gtk_file_chooser_native_new (_("Save Capture As…"),
GTK_WINDOW (self),
GTK_FILE_CHOOSER_ACTION_SAVE,
/* Translators: This is a button. */
_("Save"),
/* Translators: This is a button. */
_("Cancel"));
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), TRUE);
@ -626,6 +634,7 @@ sp_window_save_capture (GSimpleAction *action,
{
sp_window_notify_user (self,
GTK_MESSAGE_ERROR,
/* Translators: %s is the error message. */
_("An error occurred while attempting to save your capture: %s"),
error->message);
goto failure;
@ -1005,10 +1014,13 @@ sp_window_open_from_dialog (SpWindow *self)
g_assert (SP_IS_WINDOW (self));
/* Translators: This is a window title. */
dialog = gtk_file_chooser_native_new (_("Open Capture…"),
GTK_WINDOW (self),
GTK_FILE_CHOOSER_ACTION_OPEN,
/* Translators: This is a button. */
_("Open"),
/* Translators: This is a button. */
_("Cancel"));
filter = gtk_file_filter_new ();

View File

@ -162,6 +162,7 @@ main (gint argc,
flags |= O_EXCL;
if (g_file_test (filename, G_FILE_TEST_EXISTS))
{
/* Translators: %s is a file name. */
g_printerr (_("%s exists. Use --force to overwrite\n"), filename);
return EXIT_FAILURE;
}