[PATCH] Add back translation support in combo boxes

John Ralls jralls at ceridwen.us
Wed Jul 3 10:11:29 EDT 2013


On Jul 3, 2013, at 6:57 AM, John Ralls <jralls at ceridwen.us> wrote:

> 
> On Jul 3, 2013, at 5:52 AM, Geert Janssens <janssens-geert at telenet.be> wrote:
> 
>> On 03-07-13 14:34, Aurimas Fišeras wrote:
>>> 2013.07.03 15:26, Geert Janssens rašė:
>>>> Hi Aurimas,
>>>> 
>>>> Thanks for the patch.
>>>> 
>>>> I have looked at it but didn't apply it yet. My knowledge of gettext is
>>>> limited, but it looks odd to me to wrap a variable inside the _() macro.
>>>> I noticed this was the same in the old code you refer to, but I don't
>>>> know if this is correct or not. Perhaps someone with a better
>>>> understanding of gettext can give his opinion ?
>>>> 
>>>> Geert
>>> Hello,
>>> check the manual for explanation:
>>> https://developer.gnome.org/glib/2.30/glib-I18N.html#gettext-macro
>>> 
>> I did, but I still wasn't sure. So I'll leave this to someone else to properly evaluate.
> 
> The _() macro just calls gettext(), which takes the passed-in string, compares it against the
> appropriate message catalog, and returns a translation if it finds one, and the provided string
> if it doesn't.
> 
> So passing a variable to _() is fine. The potential problem is the other use of _() -- or gettext() --
> which is to flag an enclosed string constant for xgettext to extract and include in the pot file.
> 
> I don't see where that part is done, but if it is somewhere, then there's no gettext problem.

Sorry, that didn't make sense. What I meant to say is that one should pass variables to _() only
if the constant values have been flagged to xgettext so that they're in the message catalog. I
don't see where that happens in the code, but the gnc_option_get_permissible_values functions
refer to a struct of SCM variables, so perhaps it's done in scheme somewhere.

Regards,
John Ralls




More information about the gnucash-devel mailing list