# Re: git-gui-i18n: Make "Revert changes in these $n files" translatable.

2 messages from 2007-07-27 to 2007-07-27. Participants: Brett Schwarz, Christian Stimming.
Thread: https://gitlist.dev/t/9252

## Brett Schwarz, 2007-07-27 06:41

Subject: Re: git-gui-i18n: Make "Revert changes in these $n files" translatable.
Message-ID: <53264.26898.qm@web38901.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/53264.26898.qm%40web38901.mail.mud.yahoo.com

```
> 
> 
> ----- Original Message ----
> From: Christian Stimming <stimming@tuhh.de>
> To: Harri Ilari Tapio Liusvaara <hliusvaa@cc.hut.fi>
> Cc: Shawn O. Pearce <spearce@spearce.org>; Brett Schwarz <brett_schwarz@yahoo.com>; git@vger.kernel.org; Paul Mackerras <paulus@samba.org>; Junio C Hamano <gitster@pobox.com>
> Sent: Thursday, July 26, 2007 5:34:49 AM
> Subject: Re: git-gui-i18n: Make "Revert changes in these $n files" translatable.
> 
> Quoting Harri Ilari Tapio Liusvaara <hliusvaa@cc.hut.fi>:
> > On Thu, Jul 26, 2007 at 10:47:23AM +0200, Christian Stimming wrote:
> >> The issue with plural forms is even more complicated than that.
> >


<snip>

> > - Buttons in hard reset confirmation (branch->revert or merge->abort,
> >   and it is yes/no dialog).
> 
> I see this in translated form (German Ja/Nein), and also the button  
> text (translated or not) doesn't appear in the git-gui source code.  
> Maybe those need to be translated in the tcl/tk system libraries?
> 

These are indeed in the Tk libs. Unfortunately, there is no straight forward way to change the button text for tk_messageBox. I'll probably submit a patch to Tcl core for this.

In the mean time, if this is important, there are 2 ways around this:

1) override the button text in the msgcat. Tk does it's own msgcat internally (under the Tk namespace), and that's what prevents msgcat from changing these. You can see these under msgs directory where Tk is installed (/usr/local/tk8.4/msgs on my system). So, you would have to override for each language specified in that directory (if it warrants overriding). So, somewhere in the git-gui, you would have to do something like:
    namespace eval ::Tk {
      ::msgcat::mcset en_us &OK <new_term>
      ::msgcat::mcset en_us &Cancel <new_term>
      ::msgcat::mcset en_us &Yes <new_term>
      ::msgcat::mcset en_us &No <new_term>
      <continue for each language, if needed>
    }

2) Re-write the tk_messageBox, to include an option to specify the button text. This wouldn't be too hard actually, but this would live with git-gui.

I don't think option #1 is robust enough, but would be the easiest approach. Note also that this would only be for unix platforms, since for windows and Mac, it calls the platform's equivalent.

HTH,

    --brett






       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting 

```

## Christian Stimming, 2007-07-27 11:49

Subject: Re: git-gui-i18n: Make "Revert changes in these $n files" translatable.
Message-ID: <20070727134923.jahvcmejwgww0oow@webmail.tu-harburg.de>
URL: https://gitlist.dev/e/20070727134923.jahvcmejwgww0oow%40webmail.tu-harburg.de
In-Reply-To: <53264.26898.qm@web38901.mail.mud.yahoo.com>

```
Quoting Brett Schwarz <brett_schwarz@yahoo.com>:
>> > - Buttons in hard reset confirmation (branch->revert or merge->abort,
>> >   and it is yes/no dialog).
>>
>> Maybe those need to be translated in the tcl/tk system libraries?
>
> These are indeed in the Tk libs. Unfortunately, there is no straight  
>  forward way to change the button text for tk_messageBox. I'll   
> probably submit a patch to Tcl core for this.

That would indeed be a very good solution here.

> In the mean time, if this is important, there are 2 ways around this:
>
> 1) override the button text in the msgcat. (...)
> So, somewhere in the git-gui, you would  have to do something like:
>     namespace eval ::Tk {
>       ::msgcat::mcset en_us &OK <new_term>
>       ::msgcat::mcset en_us &Cancel <new_term>
>       ::msgcat::mcset en_us &Yes <new_term>
>       ::msgcat::mcset en_us &No <new_term>
>       <continue for each language, if needed>
>     }

I think this wouldn't help much here. First of all, the original  
messages might be different between different Tcl versions. But  
secondly and more importantly, as Harri Ilari pointed out, we should  
prefer to provide button texts different from Yes/No but rather  
questions like "Revert"/"Cancel".

> 2) Re-write the tk_messageBox, to include an option to specify the   
> button text. This wouldn't be too hard actually, but this would live  
>  with git-gui.

This would indeed be the nicer solution and it would improve both the  
English button labels and their translations all in one.

> I don't think option #1 is robust enough, but would be the easiest   
> approach. Note also that this would only be for unix platforms,   
> since for windows and Mac, it calls the platform's equivalent.

By the way: I have been using git-gui on Windows with mingw-git(+msys)  
and ActiveTcl for several weeks by now. Works like a charm, and I'm  
looking forward to propose it as a fully localized, fully  
cross-platform, and simply the best SCM, to the co-workers in my  
company... :-)

Christian

```
