Skip to content

Commit

Permalink
Added gettext calls and german translations for error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuerig committed Jan 29, 2009
1 parent 0d4bf38 commit acb7731
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 27 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Implement restarting on error exits based on status code or exit signal * Implement restarting on error exits based on status code or exit signal
* Listen to multiple streams (stderr)? * Listen to multiple streams (stderr)?
* USE the flags set in config.h! * USE the flags set in config.h!
* gettext-ing for error strings
* Show exit status when command exited with error * Show exit status when command exited with error


Packaging Packaging
Expand Down
39 changes: 27 additions & 12 deletions po/de.po
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: hangon 0.1\n" "Project-Id-Version: hangon 0.1\n"
"Report-Msgid-Bugs-To: michael@schuerig.de\n" "Report-Msgid-Bugs-To: michael@schuerig.de\n"
"POT-Creation-Date: 2009-01-12 00:24+0100\n" "POT-Creation-Date: 2009-01-29 02:10+0100\n"
"PO-Revision-Date: 2009-01-09 23:47+0100\n" "PO-Revision-Date: 2009-01-29 02:14+0100\n"
"Last-Translator: Michael Schuerig <michael@schuerig.de>\n" "Last-Translator: Michael Schuerig <michael@schuerig.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"


#: src/hangon.c:65 #: src/hangon.c:73
#, c-format #, c-format
msgid "Try %s --help for more information.\n" msgid "Try %s --help for more information.\n"
msgstr "„%s --help“ gibt weitere Informationen.\n" msgstr "„%s --help“ gibt weitere Informationen.\n"


#: src/hangon.c:67 #: src/hangon.c:75
#, c-format #, c-format
msgid "Usage: %s [OPTION]... -- COMMAND [COMMAND OPTION]...\n" msgid "Usage: %s [OPTION]... -- COMMAND [COMMAND OPTION]...\n"
msgstr "Aufruf: %s [OPTION]... -- BEFEHL [BEFEHLSOPTIONEN]\n" msgstr "Aufruf: %s [OPTION]... -- BEFEHL [BEFEHLSOPTIONEN]\n"


#: src/hangon.c:71 #: src/hangon.c:79
msgid "" msgid ""
"Restart an erratic COMMAND until it finishes cleanly.\n" "Restart an erratic COMMAND until it finishes cleanly.\n"
" -q, --quiet suppress diagnostic messages\n" " -q, --quiet suppress diagnostic messages\n"
Expand All @@ -39,24 +39,24 @@ msgstr ""
"wird\n" "wird\n"
" -t, --timeout=SEKUNDEN Zeit, nach der der BEFEHL neu gestartet wird\n" " -t, --timeout=SEKUNDEN Zeit, nach der der BEFEHL neu gestartet wird\n"


#: src/hangon.c:78 #: src/hangon.c:86
msgid " -d, --debug show debugging information\n" msgid " -d, --debug show debugging information\n"
msgstr "" msgstr ""
" -d, --debug zeige Informationen für die Fehlersuche an\n" " -d, --debug zeige Informationen für die Fehlersuche an\n"


#: src/hangon.c:82 #: src/hangon.c:90
msgid " --help display this help and exit\n" msgid " --help display this help and exit\n"
msgstr " --help diese Hilfe anzeigen und beenden\n" msgstr " --help diese Hilfe anzeigen und beenden\n"


#: src/hangon.c:85 #: src/hangon.c:93
msgid " --version output version information and exit\n" msgid " --version output version information and exit\n"
msgstr " --version Versionsinformation anzeigen und beenden\n" msgstr " --version Versionsinformation anzeigen und beenden\n"


#: src/hangon.c:96 #: src/hangon.c:105
msgid "(C)" msgid "(C)"
msgstr "©" msgstr "©"


#: src/hangon.c:97 #: src/hangon.c:106
msgid "" msgid ""
"License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl." "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl."
"html>\n" "html>\n"
Expand All @@ -68,12 +68,27 @@ msgstr ""
"Dies ist freie Software: Sie können sie ändern und weitergeben.\n" "Dies ist freie Software: Sie können sie ändern und weitergeben.\n"
"Es gibt keinerlei Garantien, soweit wie es das Gesetz erlaubt.\n" "Es gibt keinerlei Garantien, soweit wie es das Gesetz erlaubt.\n"


#: src/hangon.c:227 #: src/hangon.c:124
#, c-format #, c-format
msgid "timeout must not be negative\n" msgid "timeout must not be negative\n"
msgstr "die Timeout-Option darf nicht negativ sein\n" msgstr "die Timeout-Option darf nicht negativ sein\n"


#: src/hangon.c:234 #: src/hangon.c:131
#, c-format #, c-format
msgid "retries must not be negative\n" msgid "retries must not be negative\n"
msgstr "die retries-Option darf nicht negativ sein\n" msgstr "die retries-Option darf nicht negativ sein\n"

#: src/hangon.c:325
#, c-format
msgid "Command timed out, retrying...\n"
msgstr "Zeitüberschreitung, Befehl wird neu gestartet...\n"

#: src/hangon.c:344
#, c-format
msgid "Command timed out too often.\n"
msgstr "Der Befehl hat zu oft die Timeout-Zeit überschritten.\n"

#: src/hangon.c:347
#, c-format
msgid "Command terminated with status: %d\n"
msgstr "Der Befehl wurde mit einem Fehler beendet: %d\n"
37 changes: 26 additions & 11 deletions po/hangon.pot
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,61 +8,76 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: hangon 0.1\n" "Project-Id-Version: hangon 0.1\n"
"Report-Msgid-Bugs-To: michael@schuerig.de\n" "Report-Msgid-Bugs-To: michael@schuerig.de\n"
"POT-Creation-Date: 2009-01-12 00:24+0100\n" "POT-Creation-Date: 2009-01-29 02:10+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"


#: src/hangon.c:65 #: src/hangon.c:73
#, c-format #, c-format
msgid "Try %s --help for more information.\n" msgid "Try %s --help for more information.\n"
msgstr "" msgstr ""


#: src/hangon.c:67 #: src/hangon.c:75
#, c-format #, c-format
msgid "Usage: %s [OPTION]... -- COMMAND [COMMAND OPTION]...\n" msgid "Usage: %s [OPTION]... -- COMMAND [COMMAND OPTION]...\n"
msgstr "" msgstr ""


#: src/hangon.c:71 #: src/hangon.c:79
msgid "" msgid ""
"Restart an erratic COMMAND until it finishes cleanly.\n" "Restart an erratic COMMAND until it finishes cleanly.\n"
" -q, --quiet suppress diagnostic messages\n" " -q, --quiet suppress diagnostic messages\n"
" -r, --retries=TIMES maximum number of times COMMAND is restarted\n" " -r, --retries=TIMES maximum number of times COMMAND is restarted\n"
" -t, --timeout=SECONDS timeout in seconds\n" " -t, --timeout=SECONDS timeout in seconds\n"
msgstr "" msgstr ""


#: src/hangon.c:78 #: src/hangon.c:86
msgid " -d, --debug show debugging information\n" msgid " -d, --debug show debugging information\n"
msgstr "" msgstr ""


#: src/hangon.c:82 #: src/hangon.c:90
msgid " --help display this help and exit\n" msgid " --help display this help and exit\n"
msgstr "" msgstr ""


#: src/hangon.c:85 #: src/hangon.c:93
msgid " --version output version information and exit\n" msgid " --version output version information and exit\n"
msgstr "" msgstr ""


#: src/hangon.c:96 #: src/hangon.c:105
msgid "(C)" msgid "(C)"
msgstr "" msgstr ""


#: src/hangon.c:97 #: src/hangon.c:106
msgid "" msgid ""
"License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n" "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n" "This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n" "There is NO WARRANTY, to the extent permitted by law.\n"
msgstr "" msgstr ""


#: src/hangon.c:227 #: src/hangon.c:124
#, c-format #, c-format
msgid "timeout must not be negative\n" msgid "timeout must not be negative\n"
msgstr "" msgstr ""


#: src/hangon.c:234 #: src/hangon.c:131
#, c-format #, c-format
msgid "retries must not be negative\n" msgid "retries must not be negative\n"
msgstr "" msgstr ""

#: src/hangon.c:325
#, c-format
msgid "Command timed out, retrying...\n"
msgstr ""

#: src/hangon.c:344
#, c-format
msgid "Command timed out too often.\n"
msgstr ""

#: src/hangon.c:347
#, c-format
msgid "Command terminated with status: %d\n"
msgstr ""
6 changes: 3 additions & 3 deletions src/hangon.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ run_command(char * const command_args[])
if (max_retries == 0 || retries < max_retries) { if (max_retries == 0 || retries < max_retries) {
status = 0; status = 0;
if (!quiet) { if (!quiet) {
fprintf(stderr, "Command timed out, retrying...\n"); fprintf(stderr, _("Command timed out, retrying...\n"));
} }
} }
retries++; retries++;
Expand All @@ -341,10 +341,10 @@ print_status(int command_status)
perror("Error executing command"); perror("Error executing command");
break; break;
case COMMAND_TIMEOUT: case COMMAND_TIMEOUT:
fprintf(stderr, "Command timed out too often.\n"); fprintf(stderr, _("Command timed out too often.\n"));
break; break;
case COMMAND_ERROR: case COMMAND_ERROR:
fprintf(stderr, "Command terminated with status: %d\n", 0); /* FIXME status */ fprintf(stderr, _("Command terminated with status: %d\n"), 0); /* FIXME status */
break; break;
} }
} }
Expand Down

0 comments on commit acb7731

Please sign in to comment.