Weird wrapper for enum as string macro gettext handling.
More...
#include "config.h"
#include <libintl.h>
#include <locale.h>
#include "qof-expenses.h"
Go to the source code of this file.
|
#define | _GNU_SOURCE |
|
#define | _(String) dgettext (LIBRARY_GETTEXT_PACKAGE, String) |
|
#define | STRING(name, value) gchar * G_GNUC_UNUSED name##noop = _(#name); |
|
#define | MARKUP(name, list) |
|
|
static void G_GNUC_UNUSED | ExpenseTypetranslate (void) |
|
static void G_GNUC_UNUSED | ExpensePaymenttranslate (void) |
|
Weird wrapper for enum as string macro gettext handling.
- Author
- Copyright (c) 2007 Neil Williams linux.nosp@m.@cod.nosp@m.ehelp.nosp@m..co..nosp@m.uk
This is a bit of a strange file - take care.
- The enumerators and matching strings are used for the backend WITHOUT translation.
- The enumerator setting is REPRESENTED as a translated string in the GUI
- gettext doesn't like the macros that keep the whole thing in one piece, so this is a dummy file, preprocessed for gettext purposes and a complete no-op.
- The net result is that the macros handle converting enum to untranslated string for storage in the backend. gettext handles converting the enum to a translated string solely for display in the GUI frontend. Do NOT store translated strings in backends!!
- gcc -E sets a non-zero exit value so it has to be wrapped in a shell script.
- translate.h is a complete no-op - it is not used during the compilation, only as a "starter file" for gettext. As such, it does NOT matter that only gcc is used. This file is cross-compiler safe - honest. The cross-compiler is perfectly happy using translate.c - translate.h is ignored. Do NOT specifically include translate.h in ANY source file!!
- translate.c is compiled into the gpe-expenses executable and provides the location of the strings that gettext can use to find the translated string for the GUI.
- The benefits of this approach are that the automation of enum to string is retained so that changes are automatically aligned.
- One consequence of this arrangement is that comments on the new strings cannot be passed to the translators because comments are dropped by gcc -E.
Definition in file translate.c.