Preprocessor directives and gettext - patch for pidgin-mtn/pidgin/gtkmain.c
David Mohr
david at mcbf.net
Wed Sep 19 22:18:24 EDT 2007
A simpler workaround would be to just use
" --display=DISPLAY X display to use (Unix only)\n",
and have it be displayed under Windows as well. Then it could be
translated as one string again.
~David
On 9/19/07, Luke Schierer <lschiere at pidgin.im> wrote:
> Is there a better solution, as he suggests, or is his patch the best we
> can do?
>
> luke
>
>
> ----- Forwarded message from Bjoern Voigt <bjoern at cs.tu-berlin.de> -----
>
> Date: Wed, 19 Sep 2007 22:38:01 +0200
> From: Bjoern Voigt <bjoern at cs.tu-berlin.de>
> To: Luke Schierer <lschiere at pidgin.im>
> Subject: Preprocessor directives and gettext - patch for pidgin-mtn/pidgin/gtkmain.c
>
> Hello Luke,
>
> Gettext could not correctly handle preprocessor directives within i18n
> strings. So, this string is not correctly translatable:
>
> text = g_strdup_printf(_("%s %s\n"
> "Usage: %s [OPTION]...\n\n"
> " -c, --config=DIR use DIR for config files\n"
> " -d, --debug print debugging messages
> to stdout
> \n"
> " -h, --help display this help and exit\n"
> " -m, --multiple do not ensure single
> instance\n"
> " -n, --nologin don't automatically login\n"
> " -l, --login[=NAME] automatically login
> (optional argument NAME specifies\n"
> " account(s) to use,
> separated by commas)\n"
> #ifndef WIN32
> " --display=DISPLAY X display to use\n"
> #endif
> " -v, --version display the current
> version and exit\n"), PIDGIN_NAME, VERSION, name);
>
> My attached patch fixes this. May be, there are better solutions, e.g.
> with g_string_append functions.
>
> Greetings,
> Björn
>
> --
> Björn Voigt <bjoern at cs.tu-berlin.de>
> Telefon: (030) 6 36 66 27
> WWW: http://user.cs.tu-berlin.de/~bjoern/
>
>
> #
> # old_revision [005c57c94d8542339f96a33cfed0fefbad65d68e]
> #
> # patch "pidgin/gtkmain.c"
> # from [97d40c4b161c5f8d586a5d75d5e397ace78ea1ba]
> # to [866fcee688cb339c5c113c4c48b7e5a855ae45f0]
> #
> ============================================================
> --- pidgin/gtkmain.c 97d40c4b161c5f8d586a5d75d5e397ace78ea1ba
> +++ pidgin/gtkmain.c 866fcee688cb339c5c113c4c48b7e5a855ae45f0
> @@ -394,10 +394,17 @@ show_usage(const char *name, gboolean te
> " -n, --nologin don't automatically login\n"
> " -l, --login[=NAME] automatically login (optional argument NAME specifies\n"
> " account(s) to use, separated by commas)\n"
> + "%s"
> + " -v, --version display the current version and exit\n"), PIDGIN_NAME, VERSION, name,
> #ifndef WIN32
> - " --display=DISPLAY X display to use\n"
> + _(" --display=DISPLAY X display to use\n")
> +#else
> + ""
> #endif
> - " -v, --version display the current version and exit\n"), PIDGIN_NAME, VERSION, name);
> + );
> +
> +
> +);
> }
>
> purple_print_utf8_to_console(stdout, text);
>
>
> ----- End forwarded message -----
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>
More information about the Devel
mailing list