Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7561d2f75b8fdb0f64314e3c9b39be3f95cc8067
Ticket: 4a0c163d24549700a25d1e3a47c2c77477b50a25
Win clock locale change not passed to "-locale current"
User & Date: oehhar on 2015-10-21 20:33:40
Changes

  1. icomment:
    For the locale "system", %x translates to the msgcat key DATE_FORMAT, which is set by the registry key "HKEY_CURRENT_USER\Control Panel\International->sShortDate"
    
    Here is the global map:
    
    <verbatim>
        lappend list %EY [string map $list [mc LOCALE_YEAR_FORMAT]]
        lappend list %T  [string map $list [mc TIME_FORMAT_24_SECS]]
        lappend list %R  [string map $list [mc TIME_FORMAT_24]]
        lappend list %r  [string map $list [mc TIME_FORMAT_12]]
        lappend list %X  [string map $list [mc TIME_FORMAT]]
        lappend list %EX [string map $list [mc LOCALE_TIME_FORMAT]]
        lappend list %x  [string map $list [mc DATE_FORMAT]]
        lappend list %Ex [string map $list [mc LOCALE_DATE_FORMAT]]
        lappend list %c  [string map $list [mc DATE_TIME_FORMAT]]
        lappend list %Ec [string map $list [mc LOCALE_DATE_TIME_FORMAT]]
    </verbatim>
    
    And here is what is set by the registry (within "HKEY_CURRENT_USER\Control Panel\International") :
       *   LOCALE_DATE_FORMAT: sLongDate
       *   DATE_FORMAT: sShortDate
       *   sTimeFormat: sTimeFormat
    Those are used to compose:
       *   DATE_TIME_FORMAT
       *   LOCALE_DATE_TIME_FORMAT
    
    But for the locale current, the msgcat value is used.
    Thus, the observed action is ok, but is not ok for the locale current.
    On Unix, "current" and "system" is the same.
    
    Thus the following is a bug:
    <verbatim>
    % mclocale de_de
    % clock format [clock seconds] -locale current -format %x
    01.07.2015
    # mclocale en_us
    % clock format [clock seconds] -locale current -format %x
    01.07.2015
    </verbatim>
    
    A proposed solution is implemented by clearing the format functions on the current locale change (for this locale) in branch [bug-4a0c163d24], commit [e5bf4e6084].
    
  2. login: "oehhar"
  3. mimetype: "text/x-fossil-wiki"
  4. username: "oehhar"