[gnome-disk-utility] Fix a couple of internationalization problems
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Fix a couple of internationalization problems
- Date: Mon, 27 Feb 2012 15:58:21 +0000 (UTC)
commit 01d041f4bd85b5838fe46531c38a2707946d8f14
Author: David Zeuthen <davidz redhat com>
Date: Mon Feb 27 10:57:43 2012 -0500
Fix a couple of internationalization problems
See https://bugzilla.gnome.org/show_bug.cgi?id=670840
Signed-off-by: David Zeuthen <davidz redhat com>
data/ui/palimpsest.ui | 14 +++---
data/ui/smart-dialog.ui | 2 +-
src/palimpsest/gduatasmartdialog.c | 65 +++++++++++++++++++++-------
src/palimpsest/gdurestorediskimagedialog.c | 4 +-
src/palimpsest/gduutils.c | 24 +++++-----
5 files changed, 71 insertions(+), 38 deletions(-)
---
diff --git a/data/ui/palimpsest.ui b/data/ui/palimpsest.ui
index ff82a34..4d45b79 100644
--- a/data/ui/palimpsest.ui
+++ b/data/ui/palimpsest.ui
@@ -314,7 +314,7 @@
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">nothing_selected</property>
+ <property name="label">nothing_selected</property>
</object>
<packing>
<property name="tab_fill">False</property>
@@ -328,7 +328,7 @@
<object class="GtkLabel" id="label4x">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Page not implemented yet</property>
+ <property name="label">Page not implemented yet</property>
</object>
</child>
</object>
@@ -340,7 +340,7 @@
<object class="GtkLabel" id="label3x">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">not_implemented</property>
+ <property name="label">not_implemented</property>
</object>
<packing>
<property name="position">1</property>
@@ -949,7 +949,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">Contents</property>
+ <property name="label" translatable="yes" comments="The contents of the device, for example 'Unknown', 'FAT (32-bit version)', 'Ext4 (version 1.0)', 'Swap (version 2)'">Contents</property>
<style>
<class name="dim-label"/>
</style>
@@ -1097,7 +1097,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">Backing File</property>
+ <property name="label" translatable="yes" comments="The filename or URI of the file that is used as backing store for the loop device.">Backing File</property>
<style>
<class name="dim-label"/>
</style>
@@ -1154,7 +1154,7 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">devtab</property>
+ <property name="label">devtab</property>
</object>
<packing>
<property name="position">2</property>
@@ -1183,7 +1183,7 @@
<object class="GtkLabel" id="newtab_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">new</property>
+ <property name="label">new</property>
</object>
<packing>
<property name="position">3</property>
diff --git a/data/ui/smart-dialog.ui b/data/ui/smart-dialog.ui
index 762d55d..17231d7 100644
--- a/data/ui/smart-dialog.ui
+++ b/data/ui/smart-dialog.ui
@@ -403,7 +403,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">Updates</property>
+ <property name="label" translatable="yes" comments="How often the attribute is updated. The two possible values are 'Every time data is collected (online)' and 'Only during off-line activities (Not Online)'">Updates</property>
<style>
<class name="dim-label"/>
</style>
diff --git a/src/palimpsest/gduatasmartdialog.c b/src/palimpsest/gduatasmartdialog.c
index 4de9df1..66b7d25 100644
--- a/src/palimpsest/gduatasmartdialog.c
+++ b/src/palimpsest/gduatasmartdialog.c
@@ -702,35 +702,42 @@ static gchar *
format_duration_msec (guint64 msec)
{
gchar *ret;
+ gdouble val;
if (msec > 1000 * 60 * 60 * 24 * 365.25)
{
+ val = msec / 1000.0 / 60.0 / 60.0 / 24.0 / 365.25;
/* Translators: Used for a time-based unit that exceed one year */
- ret = g_strdup_printf (_("%.1f years"), msec / 1000.0 / 60.0 / 60.0 / 24.0 / 365.25);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f year", "%.1f years", val), val);
}
else if (msec > 1000 * 60 * 60 * 24)
{
+ val = msec / 1000.0 / 60.0 / 60.0 / 24.0;
/* Translators: Used for a time-based unit that exceed one day but not one year */
- ret = g_strdup_printf (_("%.1f days"), msec / 1000.0 / 60.0 / 60.0 / 24.0);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f day", "%.1f days", val), val);
}
else if (msec > 1000 * 60 * 60)
{
+ val = msec / 1000.0 / 60.0 / 60.0;
/* Translators: Used for a time-based unit that exceed one hour but not one day */
- ret = g_strdup_printf (_("%.1f hours"), msec / 1000.0 / 60.0 / 60.0);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f hour", "%.1f hours", val), val);
}
else if (msec > 1000 * 60)
{
+ val = msec / 1000.0 / 60.0;
/* Translators: Used for a time-based unit that exceed one minute but not one hour */
- ret = g_strdup_printf (_("%.1f minutes"), msec / 1000.0 / 60.0);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f minute", "%.1f minutes", val), val);
}
else if (msec > 1000)
{
+ val = msec / 1000.0;
/* Translators: Used for a time-based unit that exceed one second but not one minute */
- ret = g_strdup_printf (_("%.1f seconds"), msec / 1000.0);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f second", "%.1f seconds", val), val);
}
else
{
+ val = msec;
/* Translators: Used for a time-based unit that is counted in milliseconds and doesn't exceed one second */
- ret = g_strdup_printf (_("%d msec"), (gint) msec);
+ ret = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%.1f msec", "%.1f msecs", val), val);
}
return ret;
}
@@ -952,31 +959,57 @@ calculate_self_test (UDisksDriveAta *ata,
s = udisks_drive_ata_get_smart_selftest_status (ata);
if (g_strcmp0 (s, "success") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test completed successfully"));
+ {
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test completed successfully"));
+ }
else if (g_strcmp0 (s, "aborted") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test was aborted"));
+ {
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test was aborted"));
+ }
else if (g_strcmp0 (s, "interrupted") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test was interrupted"));
+ {
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test was interrupted"));
+ }
else if (g_strcmp0 (s, "fatal") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test did not complete"));
+ {
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test did not complete"));
+ }
else if (g_strcmp0 (s, "error_unknown") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test failed"));
+ {
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test failed"));
+ }
else if (g_strcmp0 (s, "error_electrical") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (electrical)"));
+ {
+ /* Translators: shown when the last self-test failed and the problem is with the electrical subsystem */
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (electrical)"));
+ }
else if (g_strcmp0 (s, "error_servo") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (servo)"));
+ {
+ /* Translators: shown when the last self-test failed and the problem is with the servo subsystem - see http://en.wikipedia.org/wiki/Servomechanism */
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (servo)"));
+ }
else if (g_strcmp0 (s, "error_read") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (read)"));
+ {
+ /* Translators: shown when the last self-test failed and the problem is with the reading subsystem - */
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (read)"));
+ }
else if (g_strcmp0 (s, "error_handling") == 0)
- ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (handling)"));
+ {
+ /* Translators: shown when the last self-test failed and the disk is suspected of having handling damage (e.g. physical damage to the hard disk) */
+ ret = g_strdup (C_("smart-self-test-result", "Last self-test failed (handling)"));
+ }
else if (g_strcmp0 (s, "inprogress") == 0)
{
+ /* Translators: shown when a self-test is in progress. The first %d is the percentage of the test remaining. */
ret = g_strdup_printf (C_("smart-self-test-result", "Self-test in progress â %d%% remaining"),
udisks_drive_ata_get_smart_selftest_percent_remaining (ata));
selftest_running = TRUE;
}
else
- ret = g_strdup_printf (C_("smart-self-test-result", "Unknown (%s)"), s);
+ {
+ /* Translators: Shown when a self-test is not unknown. The %s is the result-code from the API code. */
+ ret = g_strdup_printf (C_("smart-self-test-result", "Unknown (%s)"), s);
+ }
if (out_selftest_running)
*out_selftest_running = selftest_running;
diff --git a/src/palimpsest/gdurestorediskimagedialog.c b/src/palimpsest/gdurestorediskimagedialog.c
index a2deb50..041c9f1 100644
--- a/src/palimpsest/gdurestorediskimagedialog.c
+++ b/src/palimpsest/gdurestorediskimagedialog.c
@@ -173,7 +173,7 @@ restore_disk_image_update (RestoreDiskImageData *data)
{
s = udisks_client_get_size_for_display (gdu_window_get_client (data->window),
data->block_size - size, FALSE, FALSE);
- restore_warning = g_strdup_printf (_("The selected image is %s bytes smaller than the device"), s);
+ restore_warning = g_strdup_printf (_("The selected image is %s smaller than the device"), s);
g_free (s);
}
can_proceed = TRUE;
@@ -182,7 +182,7 @@ restore_disk_image_update (RestoreDiskImageData *data)
{
s = udisks_client_get_size_for_display (gdu_window_get_client (data->window),
size - data->block_size, FALSE, FALSE);
- restore_error = g_strdup_printf (_("The selected image is %s bytes bigger than the device"), s);
+ restore_error = g_strdup_printf (_("The selected image is %s bigger than the device"), s);
g_free (s);
}
else
diff --git a/src/palimpsest/gduutils.c b/src/palimpsest/gduutils.c
index c0f88be..a1139c3 100644
--- a/src/palimpsest/gduutils.c
+++ b/src/palimpsest/gduutils.c
@@ -101,10 +101,10 @@ gdu_utils_duration_to_string (guint duration_sec,
{
if (include_second_precision)
{
- s = g_strdup_printf (dngettext (GETTEXT_PACKAGE,
- N_("%d second"),
- N_("%d seconds"),
- duration_sec),
+ s = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "%d second",
+ "%d seconds",
+ duration_sec),
duration_sec);
}
else
@@ -114,18 +114,18 @@ gdu_utils_duration_to_string (guint duration_sec,
}
else if (duration_sec < 3600)
{
- s = g_strdup_printf (dngettext (GETTEXT_PACKAGE,
- N_("%d minute"),
- N_("%d minutes"),
- duration_sec / 60),
+ s = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "%d minute",
+ "%d minutes",
+ duration_sec / 60),
duration_sec / 60);
}
else
{
- s = g_strdup_printf (dngettext (GETTEXT_PACKAGE,
- N_("%d hour"),
- N_("%d hours"),
- duration_sec / 3600),
+ s = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "%d hour",
+ "%d hours",
+ duration_sec / 3600),
duration_sec / 3600);
}
return s;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]