[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Splitting help message
From: |
Gabor Kelemen |
Subject: |
Splitting help message |
Date: |
Tue, 21 Mar 2006 14:56:32 +0100 |
User-agent: |
Thunderbird 1.5 (X11/20051201) |
Hi!
The help text of gksu is too long, it should be splitted in smaller
chunks. The common problems with long strings are described at
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#long-messages
A simple patch is attached, that fixes the problem.
Regards
Gabor Kelemen
--- /home/gabor/Desktop/gksu-1.3.6/gksu/gksu.c
+++ /home/gabor/gksu-1.3.6/gksu/gksu.c
@@ -392,57 +392,72 @@
void
help (gchar *cmdname)
{
- g_print (_(
-"GKsu version %s\n\n"
-"Usage: %s [-u <user>] [-k] [-l] <command>\n\n"
-" --always-ask-password, -a\n"
-" Do not try to check if a password is really\n"
-" needed for running the command, or if there\n"
-" are other means of obtaining it: simply ask for it.\n"
-" --debug, -d\n"
-" Print information on the screen that might be\n"
-" useful for diagnosing and/or solving problems.\n"
-" --disable-grab, -g\n"
-" Disable the \"locking\" of the keyboard, mouse,\n"
-" and focus done by the program when asking for\n"
-" password.\n"
-" --icon <icon>, -i <icon>\n"
-" Replace the default window icon with the argument.\n"
-" --message <message>, -m <message>\n"
-" Replace the standard message shown to ask for\n"
-" password for the argument passed to the option.\n"
-" --print-pass, -p\n"
-" Ask gksu to print the password to stdout, just\n"
-" like ssh-askpass. Useful to use in scripts with\n"
-" programs that accept receiving the password on\n"
-" stdin.\n"
-" --prompt, -P\n"
-" Ask the user if they want to have their keyboard\n"
-" and mouse grabbed before doing so.\n"
-" --ssh-fwd, -s\n"
-" Strip the host part of the $DISPLAY variable, so that\n"
-" GKSu will work on SSH X11 Forwarding.\n"
-" --sudo-mode, -S\n"
-" Make GKSu use sudo instead of su, as if it had been\n"
-" run as \"gksudo\".\n"
-" --title <title>, -t <title>\n"
-" Replace the default title with the argument.\n"
-" --user <user>, -u <user>\n"
-" Call <command> as the specified user.\n"
-" --desktop <file>, -D <file>\n"
-" Use a .desktop file to get the name of the application"
-" and the icon from.\n"
-"\n"
-" --preserve-env, -k\n"
-" Preserve the current environments, does not set $HOME\n"
-" nor $PATH, for example.\n"
-" --login, -l\n"
-" Make this a login shell. Beware this may cause\n"
-" problems with the Xauthority magic. Run xhost\n"
-" to allow the target user to open windows on your\n"
-" display!\n"
-"\n"
-"\n"), PACKAGE_VERSION, cmdname);
+
+ const char* help_text[]={
+ N_("GKsu version %s\n\n"),
+ N_("Usage: %s [-u <user>] [-k] [-l] <command>\n\n"),
+ N_(" --always-ask-password, -a\n"
+ " Do not try to check if a password is really\n"
+ " needed for running the command, or if there\n"
+ " are other means of obtaining it: simply ask for
it.\n"),
+ N_(" --debug, -d\n"
+ " Print information on the screen that might be\n"
+ " useful for diagnosing and/or solving problems.\n"),
+ N_(" --disable-grab, -g\n"
+ " Disable the \"locking\" of the keyboard, mouse,\n"
+ " and focus done by the program when asking for\n"
+ " password.\n"),
+ N_(" --icon <icon>, -i <icon>\n"
+ " Replace the default window icon with the
argument.\n"),
+ N_(" --message <message>, -m <message>\n"
+ " Replace the standard message shown to ask for\n"
+ " password for the argument passed to the
option.\n"),
+ N_(" --print-pass, -p\n"
+ " Ask gksu to print the password to stdout, just\n"
+ " like ssh-askpass. Useful to use in scripts with\n"
+ " programs that accept receiving the password on\n"
+ " stdin.\n"),
+ N_(" --prompt, -P\n"
+ " Ask the user if they want to have their keyboard\n"
+ " and mouse grabbed before doing so.\n"),
+ N_(" --ssh-fwd, -s\n"
+ " Strip the host part of the $DISPLAY variable, so
that\n"
+ " GKSu will work on SSH X11 Forwarding.\n"),
+ N_(" --sudo-mode, -S\n"
+ " Make GKSu use sudo instead of su, as if it had
been\n"
+ " run as \"gksudo\".\n"),
+ N_(" --title <title>, -t <title>\n"
+ " Replace the default title with the argument.\n"),
+ N_(" --user <user>, -u <user>\n"
+ " Call <command> as the specified user.\n"),
+ N_(" --desktop <file>, -D <file>\n"
+ " Use a .desktop file to get the name of the
application\n"
+ " and the icon from.\n"
+ "\n"),
+ N_(" --preserve-env, -k\n"
+ " Preserve the current environments, does not set
$HOME\n"
+ " nor $PATH, for example.\n"),
+ N_(" --login, -l\n"
+ " Make this a login shell. Beware this may cause\n"
+ " problems with the Xauthority magic. Run xhost\n"
+ " to allow the target user to open windows on your\n"
+ " display!\n"
+ "\n"
+ "\n")
+ };
+
+ char * help_trans;
+
+ help_trans= g_strconcat(_(help_text[0]), _(help_text[1]),
+ _(help_text[2]), _(help_text[3]),
+ _(help_text[4]), _(help_text[5]),
+ _(help_text[6]), _(help_text[7]),
+ _(help_text[8]), _(help_text[9]),
+ _(help_text[10]), _(help_text[11]),
+ _(help_text[12]), _(help_text[13]),
+ _(help_text[14]), _(help_text[15]),
+ NULL);
+ g_print (_(help_trans), PACKAGE_VERSION, cmdname);
}
/* copied from gnome-ssh-askpass */
- Splitting help message,
Gabor Kelemen <=