[Freeciv-Dev] Re: (PR#7000) Which message should be translated and which
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7000 >
Raimar Falke wrote:
> Index: doc/HACKING
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/doc/HACKING,v
> retrieving revision 1.16
> diff -u -u -r1.16 HACKING
> --- doc/HACKING 2003/11/28 17:37:21 1.16
> +++ doc/HACKING 2004/01/06 20:56:26
> @@ -939,3 +939,12 @@
> A suggested "diff_ignore" file is included in the Freeciv distribution.
>
> ===========================================================================
> +Internationalization (I18N)
> +===========================================================================
> +
> +Messages and text in general which are shown in the GUI should be
> +translated by using the "_()" macro. In addition freelog(LOG_NORMAL,
> +...) messages should be translated. The other loglevels (LOG_FATAL,
> +LOG_ERROR,LOG_VERBOSE, LOG_DEBUG) should NOT be translated.
> +
> +===========================================================================
Fine with me.
In the future it might be worthwhile to display both translated and
non-translated versions of ERROR and FATAL messages.
freelog(LOG_ERROR, N_("This is an error."));
void freelog(...)
{
/* ... */
fprintf(stderr, "%s", msg);
fprintf(stderr, "%s", _(msg));
/* ... */
}
Another (orthogonal) option is to include the translation in the macro
itself. Something like
log_normal("This is a normal message.");
log_debug("This is a debug message.");
#define log_normal(msg, ...) freelog(LOG_NORMAL, _(msg), ...)
#define log_debug(msg, ...) freelog(LOG_DEBUG, msg, ...)
with suitable additions to the xgettext-running code.
jason
|
|