{"thread":{"id":"25604","subject":"git-gui appears to not respect Windows 7 settings on Display Language.","startedAt":"2010-10-31T19:53:37Z","lastAt":"2010-11-02T15:25:29Z","messageCount":3,"participants":["Michael Menegakis","Konstantin Khomoutov","Pat Thoyts"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154897","messageId":"AANLkTin6jP0N4gbiNU3=h0eYrYSOj-e65JfWS5tf1iSd@mail.gmail.com","threadId":"25604","inReplyTo":null,"subject":"git-gui appears to not respect Windows 7 settings on Display Language.","fromName":"Michael Menegakis","fromEmail":"arxeio@gmail.com","sentAt":"2010-10-31T19:53:37Z","receivedAt":"2010-10-31T19:53:37Z","isPatch":false,"sender":{"key":"arxeio@gmail.com","avatar":null},"body":"For some unknown sorcery Microsoft does not refer to 'Locale' the same\nas UNIX. There is only a display-characters method, only if a\ncharacter set is not unicode. For actual display of language they have\nnow on 7 a package downloading mechanism to have the whole system show\na language.\n\nOn 7 right now I have locale on Greek so that any non-unicode programs\nwill work with that. But the display language is English and no Greek\nor other non-English package has been installed. The location is also\nGreece but that doesn't affect other programs either.\n\nIn general these settings make almost all programs to display English\nby default. Only a minority like git-gui don't.\n"},{"id":"154906","messageId":"20101101002334.GF18845@localhost.localdomain","threadId":"25604","inReplyTo":"AANLkTin6jP0N4gbiNU3=h0eYrYSOj-e65JfWS5tf1iSd@mail.gmail.com","subject":"Re: git-gui appears to not respect Windows 7 settings on Display Language.","fromName":"Konstantin Khomoutov","fromEmail":"flatworm@users.sourceforge.net","sentAt":"2010-11-01T00:23:34Z","receivedAt":"2010-11-01T00:23:34Z","isPatch":false,"sender":{"key":"flatworm@users.sourceforge.net","avatar":null},"body":"On Sun, Oct 31, 2010 at 09:53:37PM +0200, Michael Menegakis wrote:\n\n> For some unknown sorcery Microsoft does not refer to 'Locale' the same\n> as UNIX. There is only a display-characters method, only if a\n> character set is not unicode. For actual display of language they have\n> now on 7 a package downloading mechanism to have the whole system show\n> a language.\n> \n> On 7 right now I have locale on Greek so that any non-unicode programs\n> will work with that. But the display language is English and no Greek\n> or other non-English package has been installed. The location is also\n> Greece but that doesn't affect other programs either.\n> \n> In general these settings make almost all programs to display English\n> by default. Only a minority like git-gui don't.\nI suggest you raising this question on the msysgit mailing list [1]\nor file a bug to its tracker.\n\n1. http://groups.google.com/group/msysgit/\n"},{"id":"155003","messageId":"874obztqku.fsf@fox.patthoyts.tk","threadId":"25604","inReplyTo":"AANLkTin6jP0N4gbiNU3=h0eYrYSOj-e65JfWS5tf1iSd@mail.gmail.com","subject":"[PATCH] git-gui: detect the use of MUI langauge packs on Windows","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2010-11-02T15:25:29Z","receivedAt":"2010-11-02T15:25:29Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"The Tcl msgcat package doesn't detect the use of a multi-lingual language\npack on Windows 7. This means that a user may have their display language\nset to Japanese but the system installed langauge was English.\nThis patch reads the relevent registry key to fix this before loading in\nthe locale specific parts of git-gui.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n\nPat Thoyts <patthoyts@users.sourceforge.net> writes:\n>Michael Menegakis <arxeio@gmail.com> writes:\n>>For some unknown sorcery Microsoft does not refer to 'Locale' the same\n>>as UNIX. There is only a display-characters method, only if a\n>>character set is not unicode. For actual display of language they have\n>>now on 7 a package downloading mechanism to have the whole system show\n>>a language.\n>>\n>>On 7 right now I have locale on Greek so that any non-unicode programs\n>>will work with that. But the display language is English and no Greek\n>>or other non-English package has been installed. The location is also\n>>Greece but that doesn't affect other programs either.\n>>\n>>In general these settings make almost all programs to display English\n>>by default. Only a minority like git-gui don't.\n>\n>This is a fault in Tcl on Windows when you are making use of language\n>packs to switch the display language on Vista or Windows 7. Tcl will\n>correctly identify your system language but the newer language pack\n>features make use of additional settings. See\n>https://sourceforge.net/tracker/?func=detail&aid=3036566&group_id=10894&atid=110894\n>for more on the Tcl issue.\n>Until this is fixed upstream you can fix this for all Tcl/Tk programs\n>(and many others) by ensuring that the LANG environment variable\n>matches your display locale. ie: if you install the japanese language\n>pack on an English version of Windows 7 and then set the display\n>locale to japansese and set the LANG environment variable to LANG=ja\n>then git gui would appear in Japanese. For Greek - use LANG=gr\n\nIt occurred to me that we do not actually have to wait for the patch\nmentioned above to be applied to the tcl core. We can patch up the\nmsgcat package during git-gui startup and check the relevant registry\nlocation to check for a MUI language pack.\n\nThis seems to work OK when I check on a Japanese pack on English Win7.\n\n git-gui.sh |   21 +++++++++++++++++++++\n 1 files changed, 21 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex d3acf0d..8cba1aa 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -93,6 +93,27 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {\n \n package require msgcat\n \n+# Check for Windows 7 MUI language pack (missed by msgcat < 1.4.4)\n+if {[tk windowingsystem] eq \"win32\"\n+\t&& [package vcompare [package provide msgcat] 1.4.4] < 0\n+} then {\n+\tproc _mc_update_locale {} {\n+\t\tputs stderr \"check for MUI pack\"\n+\t\tset key {HKEY_CURRENT_USER\\Control Panel\\Desktop}\n+\t\tif {![catch {\n+\t\t\tpackage require registry\n+\t\t\tset uilocale [registry get $key \"PreferredUILanguages\"]\n+\t\t\tmsgcat::ConvertLocale [string map {- _} [lindex $uilocale 0]]\n+\t\t} uilocale]} {\n+\t\t\tif {[string length $uilocale] > 0} {\n+\t\t\t\tputs stderr \"update locale to $uilocale\"\n+\t\t\t\tmsgcat::mclocale $uilocale\n+\t\t\t}\n+\t\t}\n+\t}\n+\t_mc_update_locale\n+}\n+\n proc _mc_trim {fmt} {\n \tset cmk [string first @@ $fmt]\n \tif {$cmk > 0} {\n-- \n1.7.3.1.msysgit.0\n"}]}