summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Roche <didrocks@ubuntu.com>2015-01-26 17:12:54 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2015-02-18 16:33:46 +0100
commitb0d924648600ac10101b22cdfc2b055d502fd899 (patch)
tree024638b7604aa057b1fd217700ca6c096dfc9691
parent20f56fddcd58c84fa73597486e905c652667214f (diff)
Translate fsckd messages for plymouth
For plymouth themes not supporting i18n (like .script), send translated messages to display to user, which is equivalent to the sent machine readable data.
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/fsckd/fsckd.c10
2 files changed, 8 insertions, 3 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b4c1121d1..70e75941c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -5,3 +5,4 @@ src/locale/org.freedesktop.locale1.policy.in
src/login/org.freedesktop.login1.policy.in
src/machine/org.freedesktop.machine1.policy.in
src/timedate/org.freedesktop.timedate1.policy.in
+src/fsckd/fsckd.c
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
index dc00fc6b3..834476c14 100644
--- a/src/fsckd/fsckd.c
+++ b/src/fsckd/fsckd.c
@@ -24,6 +24,7 @@
#include <getopt.h>
#include <errno.h>
+#include <libintl.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -182,7 +183,7 @@ static int send_message_plymouth(Manager *m, const char *message) {
if (r < 0)
return log_warning_errno(errno, "Can't send to plymouth cancel key: %m");
m->plymouth_cancel_sent = true;
- plymouth_cancel_message = strjoina("fsckd-cancel-msg:", "Press Ctrl+C to cancel all filesystem checks in progress");
+ plymouth_cancel_message = strjoina("fsckd-cancel-msg:", _("Press Ctrl+C to cancel all filesystem checks in progress"));
r = send_message_plymouth_socket(m->plymouth_fd, plymouth_cancel_message, false);
if (r < 0)
log_warning_errno(r, "Can't send filesystem cancel message to plymouth: %m");
@@ -222,8 +223,10 @@ static int update_global_progress(Manager *m) {
m->numdevices = current_numdevices;
m->percent = current_percent;
- if (asprintf(&console_message, "Checking in progress on %d disks (%3.1f%% complete)",
- m->numdevices, m->percent) < 0)
+ if (asprintf(&console_message,
+ ngettext("Checking in progress on %d disk (%3.1f%% complete)",
+ "Checking in progress on %d disks (%3.1f%% complete)", m->numdevices),
+ m->numdevices, m->percent) < 0)
return -ENOMEM;
if (asprintf(&fsck_message, "fsckd:%d:%3.1f:%s", m->numdevices, m->percent, console_message) < 0)
return -ENOMEM;
@@ -507,6 +510,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
+ init_gettext();
r = parse_argv(argc, argv);
if (r <= 0)