gnucash maint: Add a missing gettext in plugin page owner tree

Geert Janssens geert.gnucash at kobaltwit.be
Tue Jan 12 06:37:37 EST 2016


On Saturday 09 January 2016 06:24:01 Frank H. Ellenberger wrote:
> Am 08.01.2016 um 16:03 schrieb John Ralls:
> >> On Jan 8, 2016, at 1:39 AM, Geert Janssens
> >> <geert.gnucash at kobaltwit.be> wrote:
> >> 
> >> Frank,
> >> 
> >> I'm not sure this is the right solution to the problem. Instead of
> >> marking the variable name as translatable I'd be inclined to mark
> >> the label definitions themselves as translatable. These are a few
> >> lines up in the code and currently set as N_(...). We could change
> >> them there to _(...) to avoid marking a variable instead of a
> >> constant as translatable.
> >> 
> >> What do you think ?
> > 
> > They're effectively equivalent, see
> > http://wiki.gnucash.org/wiki/Translation#How_to_make_strings_in_cod
> > e_translatable. In both cases it's the constant that's marked as
> > translatable. xgettext knows not to put an identifier in a potfile.
> > With Frank's way the message catalog is searched only once at
> > runtime for the label that's actually needed instead of four times
> > for all of the possibilities.
> > 
> > However, I think that it's premature optimization because
> > 
> >   label = _("foo");
> >   bar(baz, label);
> > 
> > is a bit more idiomatic.
> > 
> > Regards,
> > John Ralls
> 
> I assumed, if _() were possible, the original author would have taken
> it. ;-)
> 
The original author learns as he goes ;)
That code was my first big gui addition, so I relied heavily on examples I found in the existing 
code (mostly the account hierarchy code in this case). I'm certainly open to improvements in 
my code.

> simplyfied in commit 9df89b7.
> 
> 
> As we are here, I am wondering why we get the different strings
> #: ../src/gnome-utils/gnc-tree-view-owner.c:397
> msgid "Owner Name"
> msgstr ""
> 
> #: ../src/gnome-utils/gnc-tree-view-owner.c:408
> msgid "Owner ID"
> msgstr ""
> which result in strange translations. The owner of an employee - isn't
> that slavery? Yes, we have an entry about owner in the glossary, but
> it is often not remembered.
> 
> We could either simply use "Name" and "Number" or "ID", but then we
> have later "address name" and "phone number" as column labels.
> Or we could use the same strings as in the New... dialogs.
> 
> Regards
> Frank

I agree with you and John we should hide the "owner" generalization from the users. Best 
would be to reuse the strings that are used in other dialogs. That would give the best user 
experience IMO.

Regards,

Geert


More information about the gnucash-devel mailing list