All of lore.kernel.org
 help / color / mirror / Atom feed
* git-gui appears to not respect Windows 7 settings on Display Language.
@ 2010-10-31 19:53 Michael Menegakis
  2010-11-01  0:23 ` Konstantin Khomoutov
  2010-11-02 15:25 ` [PATCH] git-gui: detect the use of MUI langauge packs on Windows Pat Thoyts
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Menegakis @ 2010-10-31 19:53 UTC (permalink / raw)
  To: git

For some unknown sorcery Microsoft does not refer to 'Locale' the same
as UNIX. There is only a display-characters method, only if a
character set is not unicode. For actual display of language they have
now on 7 a package downloading mechanism to have the whole system show
a language.

On 7 right now I have locale on Greek so that any non-unicode programs
will work with that. But the display language is English and no Greek
or other non-English package has been installed. The location is also
Greece but that doesn't affect other programs either.

In general these settings make almost all programs to display English
by default. Only a minority like git-gui don't.

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

* Re: git-gui appears to not respect Windows 7 settings on Display Language.
  2010-10-31 19:53 git-gui appears to not respect Windows 7 settings on Display Language Michael Menegakis
@ 2010-11-01  0:23 ` Konstantin Khomoutov
  2010-11-02 15:25 ` [PATCH] git-gui: detect the use of MUI langauge packs on Windows Pat Thoyts
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khomoutov @ 2010-11-01  0:23 UTC (permalink / raw)
  To: Michael Menegakis; +Cc: git

On Sun, Oct 31, 2010 at 09:53:37PM +0200, Michael Menegakis wrote:

> For some unknown sorcery Microsoft does not refer to 'Locale' the same
> as UNIX. There is only a display-characters method, only if a
> character set is not unicode. For actual display of language they have
> now on 7 a package downloading mechanism to have the whole system show
> a language.
> 
> On 7 right now I have locale on Greek so that any non-unicode programs
> will work with that. But the display language is English and no Greek
> or other non-English package has been installed. The location is also
> Greece but that doesn't affect other programs either.
> 
> In general these settings make almost all programs to display English
> by default. Only a minority like git-gui don't.
I suggest you raising this question on the msysgit mailing list [1]
or file a bug to its tracker.

1. http://groups.google.com/group/msysgit/

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

* [PATCH] git-gui: detect the use of MUI langauge packs on Windows
  2010-10-31 19:53 git-gui appears to not respect Windows 7 settings on Display Language Michael Menegakis
  2010-11-01  0:23 ` Konstantin Khomoutov
@ 2010-11-02 15:25 ` Pat Thoyts
  1 sibling, 0 replies; 3+ messages in thread
From: Pat Thoyts @ 2010-11-02 15:25 UTC (permalink / raw)
  To: Michael Menegakis; +Cc: git, msysgit, Konstantin Khomoutov

The Tcl msgcat package doesn't detect the use of a multi-lingual language
pack on Windows 7. This means that a user may have their display language
set to Japanese but the system installed langauge was English.
This patch reads the relevent registry key to fix this before loading in
the locale specific parts of git-gui.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---

Pat Thoyts <patthoyts@users.sourceforge.net> writes:
>Michael Menegakis <arxeio@gmail.com> writes:
>>For some unknown sorcery Microsoft does not refer to 'Locale' the same
>>as UNIX. There is only a display-characters method, only if a
>>character set is not unicode. For actual display of language they have
>>now on 7 a package downloading mechanism to have the whole system show
>>a language.
>>
>>On 7 right now I have locale on Greek so that any non-unicode programs
>>will work with that. But the display language is English and no Greek
>>or other non-English package has been installed. The location is also
>>Greece but that doesn't affect other programs either.
>>
>>In general these settings make almost all programs to display English
>>by default. Only a minority like git-gui don't.
>
>This is a fault in Tcl on Windows when you are making use of language
>packs to switch the display language on Vista or Windows 7. Tcl will
>correctly identify your system language but the newer language pack
>features make use of additional settings. See
>https://sourceforge.net/tracker/?func=detail&aid=3036566&group_id=10894&atid=110894
>for more on the Tcl issue.
>Until this is fixed upstream you can fix this for all Tcl/Tk programs
>(and many others) by ensuring that the LANG environment variable
>matches your display locale. ie: if you install the japanese language
>pack on an English version of Windows 7 and then set the display
>locale to japansese and set the LANG environment variable to LANG=ja
>then git gui would appear in Japanese. For Greek - use LANG=gr

It occurred to me that we do not actually have to wait for the patch
mentioned above to be applied to the tcl core. We can patch up the
msgcat package during git-gui startup and check the relevant registry
location to check for a MUI language pack.

This seems to work OK when I check on a Japanese pack on English Win7.

 git-gui.sh |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index d3acf0d..8cba1aa 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -93,6 +93,27 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
 
 package require msgcat
 
+# Check for Windows 7 MUI language pack (missed by msgcat < 1.4.4)
+if {[tk windowingsystem] eq "win32"
+	&& [package vcompare [package provide msgcat] 1.4.4] < 0
+} then {
+	proc _mc_update_locale {} {
+		puts stderr "check for MUI pack"
+		set key {HKEY_CURRENT_USER\Control Panel\Desktop}
+		if {![catch {
+			package require registry
+			set uilocale [registry get $key "PreferredUILanguages"]
+			msgcat::ConvertLocale [string map {- _} [lindex $uilocale 0]]
+		} uilocale]} {
+			if {[string length $uilocale] > 0} {
+				puts stderr "update locale to $uilocale"
+				msgcat::mclocale $uilocale
+			}
+		}
+	}
+	_mc_update_locale
+}
+
 proc _mc_trim {fmt} {
 	set cmk [string first @@ $fmt]
 	if {$cmk > 0} {
-- 
1.7.3.1.msysgit.0

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

end of thread, other threads:[~2010-11-02 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31 19:53 git-gui appears to not respect Windows 7 settings on Display Language Michael Menegakis
2010-11-01  0:23 ` Konstantin Khomoutov
2010-11-02 15:25 ` [PATCH] git-gui: detect the use of MUI langauge packs on Windows Pat Thoyts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.