Use of #define statements with translatable strings
alex.aycinena at gmail.com
Sun Mar 31 20:50:52 EDT 2013
Derek & Christian,
Thanks for the quick responses.
On Sun, Mar 31, 2013 at 2:41 PM, Christian Stimming
<christian at cstimming.de>wrote:
> Am Sonntag, 31. März 2013, 14:22:24 schrieb Alex Aycinena:
> > #define CUT_TRANSACTION_LABEL N_("Cu_t Transaction")
> > #define COPY_TRANSACTION_LABEL N_("_Copy Transaction")
> > ...
> > #define CUT_SPLIT_LABEL N_("Cu_t Split")
> > #define COPY_SPLIT_LABEL N_("_Copy Split")
> > ...
> > Can anyone help me out here? I'm not sure how to proceed.
> For the translation to work, two steps need to work correctly:
> 1. The strings must be marked in the source for extraction by the external
> tool "xgettext", which copies them from the *.c files to the *.po files
> gnucash.pot as intermediate template). This is a compile-time step.
> 2. At runtime, the English strings must be passed through the function
> gettext( ).
> To get a string to be extracted (step #1), you must mark the strings by
> any of
> the macros mentioned in the gettext documentation - either N_( ), or _( ),
> S_( ) or whatever other macro exists. However, the macro must go around the
> real string, not around any macro names. In your case, this is done
> To get a string to be passed through gettext( ) at runtime, the strings can
> either be enclosed by _( ), which expands at compile time to a call to
> gettext( ). Alternatively, the const char* pointers from the strings can be
> passed through gettext( ) or _( ) manually at some later point.
> In your case, I don't know where you're using those macros. If they are
> in a place where the strings are expected in already translated form, N_( )
> was wrong and you need to use _( ) instead. Alternatively, you can also use
> _(CUT_SPLIT_LABEL) in the places where you need the translated string, and
> CUT_SPLIT_LABEL where you need the not-yet-translated static string.
> on the context.
I solved it by using _( ) around the const char* pointers as you suggested.
So now I'm ready to commit, but when I try do do so I get the following:
[gnucash-dev at HPs7700nFedora gnucash-working]$ svn commit -m "Vary some menu
labels and tooltips based on cursor class: transaction or split."
svn: E175013: Commit failed (details follow):
svn: E175013: Access to
[gnucash-dev at HPs7700nFedora gnucash-working]$
Any idea why this is happening? It's worked until recently.
More information about the gnucash-devel