git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to run git-gui always in English?
@ 2007-10-21  6:47 Steffen Prohaska
  2007-10-21  6:52 ` Shawn O. Pearce
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Steffen Prohaska @ 2007-10-21  6:47 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailing List

There are a lot of efforts going on to localize git-gui,
including technical terms like "push". Personally I don't
understand what this should be useful for. The command is called
"git push"s. So, why should it be named differently in the gui.

Anyway, I can switch it off, right? So here's my question.

How can I switch msysgit's git-gui to English, independently of
the language selected for Windows? I recognized that git-gui
adjusts to the 'language selection' of Windows. How can I
disable this? I want git-gui to always display English. Nothing
else, never! I can't help people who use a different language
in the gui, because I'll not understand what they are talking
about and they'll not understand me.

Can I set an option in git-gui's option menu? I haven't
found one.

	Steffen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-21  6:47 How to run git-gui always in English? Steffen Prohaska
@ 2007-10-21  6:52 ` Shawn O. Pearce
  2007-10-21  7:03   ` Steffen Prohaska
  2007-10-23 20:00 ` Steffen Prohaska
  2007-10-26  8:00 ` Peter Karlsson
  2 siblings, 1 reply; 11+ messages in thread
From: Shawn O. Pearce @ 2007-10-21  6:52 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

Steffen Prohaska <prohaska@zib.de> wrote:
> There are a lot of efforts going on to localize git-gui,
> including technical terms like "push". Personally I don't
> understand what this should be useful for. The command is called
> "git push"s. So, why should it be named differently in the gui.
> 
> Anyway, I can switch it off, right? So here's my question.
> 
> How can I switch msysgit's git-gui to English, independently of
> the language selected for Windows? I recognized that git-gui
> adjusts to the 'language selection' of Windows. How can I
> disable this? I want git-gui to always display English. Nothing
> else, never! I can't help people who use a different language
> in the gui, because I'll not understand what they are talking
> about and they'll not understand me.
> 
> Can I set an option in git-gui's option menu? I haven't
> found one.

Yea, we don't have a UI to let you set what language the UI should
appear in.  Partly because once the UI is up we'd have to restart
the entire process to change the strings its using.  And partly
because nobody has asked for this before.

I think that if you set LANG=en before you start git-gui it will
take on English, and so will all of the standard dialogs that we
"borrow" from wish.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-21  6:52 ` Shawn O. Pearce
@ 2007-10-21  7:03   ` Steffen Prohaska
  2007-10-21  7:15     ` Shawn O. Pearce
  0 siblings, 1 reply; 11+ messages in thread
From: Steffen Prohaska @ 2007-10-21  7:03 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailing List


On Oct 21, 2007, at 8:52 AM, Shawn O. Pearce wrote:

> Steffen Prohaska <prohaska@zib.de> wrote:
>
>> How can I switch msysgit's git-gui to English, independently of
>> the language selected for Windows? I recognized that git-gui
>> adjusts to the 'language selection' of Windows. How can I
>> disable this? I want git-gui to always display English. Nothing
>> else, never! I can't help people who use a different language
>> in the gui, because I'll not understand what they are talking
>> about and they'll not understand me.
>>
>> Can I set an option in git-gui's option menu? I haven't
>> found one.
>>
>
> Yea, we don't have a UI to let you set what language the UI should
> appear in.  Partly because once the UI is up we'd have to restart
> the entire process to change the strings its using.  And partly
> because nobody has asked for this before.
>
> I think that if you set LANG=en before you start git-gui it will
> take on English, and so will all of the standard dialogs that we
> "borrow" from wish.

Hmm. I have no shell. I run git-gui from the Windows Start Menu.
It directly runs wish to execute the Windows git-gui wrapper:

--- SNIP ---
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@"

if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
         cd [lindex $argv 1]
         set argv [lrange $argv 2 end]
         incr argc -2
}

set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
unset gitguidir

source [file join [file dirname [info script]] git-gui.tcl]
--- SNIP ---

Do we have a chance before we source the real git-gui.tcl?
Maybe we could "set env(LANG)" based on "git config gui.lang"?
Or is it already too late because we needed to restart wish?

	Steffen

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-21  7:03   ` Steffen Prohaska
@ 2007-10-21  7:15     ` Shawn O. Pearce
  0 siblings, 0 replies; 11+ messages in thread
From: Shawn O. Pearce @ 2007-10-21  7:15 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

Steffen Prohaska <prohaska@zib.de> wrote:
> On Oct 21, 2007, at 8:52 AM, Shawn O. Pearce wrote:
> >
> >I think that if you set LANG=en before you start git-gui it will
> >take on English, and so will all of the standard dialogs that we
> >"borrow" from wish.
> 
> Do we have a chance before we source the real git-gui.tcl?
> Maybe we could "set env(LANG)" based on "git config gui.lang"?
> Or is it already too late because we needed to restart wish?

Hmm.  Really quick testing here shows that we just need to make sure
env(LANG) is set before we do the msgcat::mcload call in git-gui.sh
line 104.

If we're going to use a `git config gui.lang` thing then we can
probably just make a msgcat::mclocale call on line 103 just before we
load our message file.  Unfortunately this is before we have located
git so technically git-gui doesn't know how to run git-config and
thus cannot get to gui.lang.  :-|

Hmm.  Looking at this further we may be able to insert the mclocale
call at two locations; one at line 864 before we open the repository
wizard, and again at line 1802, just before we start to initialize
our UI.  This does mean that for really serious errors (e.g. "No
git in PATH") we'll be using your native OS language.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-21  6:47 How to run git-gui always in English? Steffen Prohaska
  2007-10-21  6:52 ` Shawn O. Pearce
@ 2007-10-23 20:00 ` Steffen Prohaska
  2007-10-23 22:45   ` Shawn O. Pearce
  2007-10-26  8:00 ` Peter Karlsson
  2 siblings, 1 reply; 11+ messages in thread
From: Steffen Prohaska @ 2007-10-23 20:00 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailing List, msysGit

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]


On Oct 21, 2007, at 8:47 AM, Steffen Prohaska wrote:

> How can I switch msysgit's git-gui to English, independently of
> the language selected for Windows? I recognized that git-gui
> adjusts to the 'language selection' of Windows. How can I
> disable this? I want git-gui to always display English. Nothing
> else, never! I can't help people who use a different language
> in the gui, because I'll not understand what they are talking
> about and they'll not understand me.

And it's even worse. An error in the localization can completely
break git-gui. Apparently the German localization included in
msysgit's Git-1.5.3-preview20071019.exe _is_ broken (see
attached png).

Shouldn't the localization code be a bit more fault tolerant?

	Steffen



[-- Attachment #2: gitGui Fehler.png --]
[-- Type: image/png, Size: 36458 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-23 20:00 ` Steffen Prohaska
@ 2007-10-23 22:45   ` Shawn O. Pearce
  0 siblings, 0 replies; 11+ messages in thread
From: Shawn O. Pearce @ 2007-10-23 22:45 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List, msysGit

Steffen Prohaska <prohaska@zib.de> wrote:
> On Oct 21, 2007, at 8:47 AM, Steffen Prohaska wrote:
> 
> >How can I switch msysgit's git-gui to English, independently of
> >the language selected for Windows? I recognized that git-gui
> >adjusts to the 'language selection' of Windows. How can I
> >disable this? I want git-gui to always display English. Nothing
> >else, never! I can't help people who use a different language
> >in the gui, because I'll not understand what they are talking
> >about and they'll not understand me.
> 
> And it's even worse. An error in the localization can completely
> break git-gui. Apparently the German localization included in
> msysgit's Git-1.5.3-preview20071019.exe _is_ broken (see
> attached png).
> 
> Shouldn't the localization code be a bit more fault tolerant?

Yes.  This is a possible workaround:

>From 410aa617e7ca8240500e90f0b0389bde7b7b40aa Mon Sep 17 00:00:00 2001
From: Shawn O. Pearce <spearce@spearce.org>
Date: Tue, 23 Oct 2007 18:44:55 -0400
Subject: [PATCH] git-gui: Protect against bad translation strings

If a translation string uses a format character we don't have an
argument for then it may throw an error when we attempt to format
the translation.  In this case switch back to the default format
that comes with the program (aka the English translation).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 git-gui.sh |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 38c6e59..a7227ac 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -88,13 +88,20 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
 
 package require msgcat
 
-proc mc {fmt args} {
-	set fmt [::msgcat::mc $fmt]
+proc _mc_trim {fmt} {
 	set cmk [string first @@ $fmt]
 	if {$cmk > 0} {
-		set fmt [string range $fmt 0 [expr {$cmk - 1}]]
+		return [string range $fmt 0 [expr {$cmk - 1}]]
 	}
-	return [eval [list format $fmt] $args]
+	return $fmt
+}
+
+proc mc {en_fmt args} {
+	set fmt [_mc_trim [::msgcat::mc $en_fmt]]
+	if {[catch {set msg [eval [list format $fmt] $args]} err]} {
+		set msg [eval [list format [_mc_trim $en_fmt]] $args]
+	}
+	return $msg
 }
 
 proc strcat {args} {
-- 
1.5.3.4.1324.ga7925



-- 
Shawn.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-21  6:47 How to run git-gui always in English? Steffen Prohaska
  2007-10-21  6:52 ` Shawn O. Pearce
  2007-10-23 20:00 ` Steffen Prohaska
@ 2007-10-26  8:00 ` Peter Karlsson
  2007-10-26 21:41   ` Alex Riesen
  2 siblings, 1 reply; 11+ messages in thread
From: Peter Karlsson @ 2007-10-26  8:00 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Shawn O. Pearce, Git Mailing List

Steffen Prohaska:

> There are a lot of efforts going on to localize git-gui, including 
> technical terms like "push". Personally I don't understand what this 
> should be useful for. The command is called "git push"s. So, why should it 
> be named differently in the gui.

Not that I agree that "push" is a technical word, but perhaps you have a 
point. Why should there be such words in the GUI to start with? It's a GUI, 
trying to abstract away the command line. Why not have a button "Send" or a 
menu entry "Send changes to server", mimicing the "git push" command line 
option? Using command line names or showing protocol data directly in a 
user-oriented GUI is most often a bad idea.

Or perhaps what we need is an actual translation from "gitish" to English, 
which would have

msgid "Push"
msgstr "Send changes to server"

?

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-26  8:00 ` Peter Karlsson
@ 2007-10-26 21:41   ` Alex Riesen
  2007-10-29 12:58     ` Peter Karlsson
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Riesen @ 2007-10-26 21:41 UTC (permalink / raw)
  To: Peter Karlsson; +Cc: Steffen Prohaska, Shawn O. Pearce, Git Mailing List

Peter Karlsson, Fri, Oct 26, 2007 10:00:32 +0200:
> Steffen Prohaska:
>
>> There are a lot of efforts going on to localize git-gui, including 
>> technical terms like "push". Personally I don't understand what this 
>> should be useful for. The command is called "git push"s. So, why should it 
>> be named differently in the gui.
>
> Not that I agree that "push" is a technical word, but perhaps you have a 
> point. Why should there be such words in the GUI to start with? It's a GUI, 
> trying to abstract away the command line. Why not have a button "Send" or a 
> menu entry "Send changes to server", mimicing the "git push" command line 
> option? Using command line names or showing protocol data directly in a 
> user-oriented GUI is most often a bad idea.
>
> Or perhaps what we need is an actual translation from "gitish" to English, 
> which would have
>
> msgid "Push"
> msgstr "Send changes to server"
>

Because you do not send changes to a _server_. There is no server.
There is just another repo. Hence just "push"

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-26 21:41   ` Alex Riesen
@ 2007-10-29 12:58     ` Peter Karlsson
  2007-10-30  8:56       ` Junio C Hamano
  2007-10-30  9:58       ` Johannes Schindelin
  0 siblings, 2 replies; 11+ messages in thread
From: Peter Karlsson @ 2007-10-29 12:58 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Steffen Prohaska, Shawn O. Pearce, Git Mailing List

Alex Riesen:

> Because you do not send changes to a _server_. There is no server. There 
> is just another repo. Hence just "push"

Fine. "Send to repository", then. My point is that if "push" is a technical 
term, then it doesn't belong in the GUI, and if it isn't, then it should be 
translated like any other UI element.

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-29 12:58     ` Peter Karlsson
@ 2007-10-30  8:56       ` Junio C Hamano
  2007-10-30  9:58       ` Johannes Schindelin
  1 sibling, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2007-10-30  8:56 UTC (permalink / raw)
  To: Peter Karlsson
  Cc: Alex Riesen, Steffen Prohaska, Shawn O. Pearce, Git Mailing List

Peter Karlsson <peter@softwolves.pp.se> writes:

> Alex Riesen:
>
>> Because you do not send changes to a _server_. There is no
>> server. There is just another repo. Hence just "push"
>
> Fine. "Send to repository", then. My point is that if "push" is a
> technical term, then it doesn't belong in the GUI, and if it isn't,
> then it should be translated like any other UI element.

Why doesn't a "technical term" belong in the GUI in the first
place?

If majority of people who use git know and use the term "push"
to describe that concept, certainly they will be the people from
whom the new people who start to use git (either from command
line or from GUI) get help.  Why do you want to have them use
different language to make the communication more difficult?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to run git-gui always in English?
  2007-10-29 12:58     ` Peter Karlsson
  2007-10-30  8:56       ` Junio C Hamano
@ 2007-10-30  9:58       ` Johannes Schindelin
  1 sibling, 0 replies; 11+ messages in thread
From: Johannes Schindelin @ 2007-10-30  9:58 UTC (permalink / raw)
  To: Peter Karlsson
  Cc: Alex Riesen, Steffen Prohaska, Shawn O. Pearce, Git Mailing List

Hi,

On Mon, 29 Oct 2007, Peter Karlsson wrote:

> Alex Riesen:
> 
> > Because you do not send changes to a _server_. There is no server. There is
> > just another repo. Hence just "push"
> 
> Fine. "Send to repository", then. My point is that if "push" is a technical
> term, then it doesn't belong in the GUI, and if it isn't, then it should be
> translated like any other UI element.

Come on.  "Byte" is a technical term, too, and only the French translate 
it.  Same goes for "Computer".  There is a point where hiding the truth 
from the user becomes silly.  This is it.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-10-30  9:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-21  6:47 How to run git-gui always in English? Steffen Prohaska
2007-10-21  6:52 ` Shawn O. Pearce
2007-10-21  7:03   ` Steffen Prohaska
2007-10-21  7:15     ` Shawn O. Pearce
2007-10-23 20:00 ` Steffen Prohaska
2007-10-23 22:45   ` Shawn O. Pearce
2007-10-26  8:00 ` Peter Karlsson
2007-10-26 21:41   ` Alex Riesen
2007-10-29 12:58     ` Peter Karlsson
2007-10-30  8:56       ` Junio C Hamano
2007-10-30  9:58       ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).