shutdown: impossible to properly localize some strings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
Medium
|
Scott James Remnant (Canonical) |
Bug Description
In compat/
static char *
warning_message (const char *message)
{
char *banner, *msg;
nih_assert (message != NULL);
if (delay > 1) {
banner = nih_sprintf (NULL, _("The system is going down for "
"%s in %d minutes!"),
what, delay);
} else if (delay) {
banner = nih_sprintf (NULL, _("The system is going down for "
"%s IN ONE MINUTE!"),
what);
} else {
banner = nih_sprintf (NULL, _("The system is going down for "
"%s NOW!"),
what);
}
Besides that the possible values of the what variable (maintenance, reboot, halt, power off) are not marked for translation in the file, this is a clear case of what translators call 'string surgery' and what should be generally avoided. For more details please see: http://
Furthermore, using plurals this way is also incorrect, there are several languages that use less or more than two plural forms, for these it's pointless to differentiate between 1 and >1 minutes (NOW can be ok). For more details, please see the next paragraph in the above linked howto.
My proposal to solve all these problems would look something like this:
if (what=="reboot") {
if (delay) {
banner = nih_sprintf (NULL, ngettext ("The system is going down for reboot in %d minute!",
else
banner = nih_sprintf (NULL, _("The system is going down for reboot NOW!"));
}
else if (what=="halt") {...}
and so on, assuming that the above strings must not look like as they currently look, for, say historical reasons.
Changed in upstart: | |
importance: | Undecided → Medium |
status: | Unconfirmed → Confirmed |
Changed in upstart: | |
status: | Confirmed → Triaged |
Changed in upstart: | |
milestone: | 0.5 → none |
Changed in upstart: | |
milestone: | none → 0.5-later |
Changed in upstart: | |
milestone: | 0.5-later → none |
summary: |
- It's impossible to properly localize some strings + shutdown: impossible to properly localize some strings |
Changed in upstart: | |
status: | Triaged → Fix Committed |
Changed in upstart: | |
milestone: | none → 0.6.0 |
It's not so much as "must look", but "do look".
This file has a major revamp coming up, so I'll be sure to fix the string handling when I do that (the "what" goes away completely)