[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/8] parsers: support translatable token aliases
From: |
Akim Demaille |
Subject: |
Re: [PATCH 5/8] parsers: support translatable token aliases |
Date: |
Fri, 4 Jan 2019 08:06:22 +0100 |
Hi Adrian,
> Le 2 janv. 2019 à 14:54, Adrian Vogelsgesang <address@hidden> a écrit :
>
> Another related topic:
> How should we do the extraction of all translatable strings?
>
> # The problem
>
> Not sure how other translation workflows might look, but in our case we parse
> all our .cpp files to
> find all calls to the "translate" function and extract their parameters. We
> could easily adjust this to
> also look for calls to the "_" function.
That's basically what gettext does too. Except that you used a very strong
word here: you really *parse* the files? Just looking for the pattern
_("...") should suffice. Gettext worked out of the box on these *.y files with
_() markup. Parsing is overkill, a simpler scanner should be able to do the
job.
> I could imagine that other users with other translation workflows have
> similar issues
> extracting the translatable strings, so it might make sense to integrate this
> functionality
> directly into bison.
>
> What are your thoughts on this?
I don't want to generate yet another file. But we could also leave some markup
in the generated file to make it easier for tools that don't want to read the
*.y file. Gettext supports N_("foo"), where N_ is
#define N_(S) S
so that their gatherer can spot the strings to be translated, but that will be
translated later with _. Wouldn't that work for you?