After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750781 - en_HK date endianess is incorrect
en_HK date endianess is incorrect
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Date and Time
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Kalev Lember
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-11 10:17 UTC by Bastien Nocera
Modified: 2015-06-16 07:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
datetime: Fix date endianess for en_HK (873 bytes, patch)
2015-06-11 16:10 UTC, Mathieu Bridon
reviewed Details | Review
datetime: Fix date endianess for en_HK (1.27 KB, patch)
2015-06-15 15:31 UTC, Mathieu Bridon
accepted-commit_now Details | Review

Description Bastien Nocera 2015-06-11 10:17:40 UTC
$ ./test-endianess en_HK
%A, %B %d, %Y		Middle (MM-DD-YYYY)

Should be LITTLE endian instead.
Comment 1 Mathieu Bridon 2015-06-11 16:09:26 UTC
So, here's what I just did:

    $ cat test-all-date-endianess.sh 
    #!/usr/bin/bash
    
    
    for LOCALE in $(locale -a | grep --text utf8); do
        if [ ${#LOCALE} -ge 16 ]; then
            PAD='\t'
        elif [ ${#LOCALE} -ge 8 ]; then
            PAD='\t\t'
        else
            PAD='\t\t\t'
        fi
    
        echo -e "${LOCALE}${PAD}$(./panels/datetime/test-endianess $LOCALE)"
    done

    $ ./test-all-date-endianess.sh > locales-endianess
    
    (process:18455): datetime-cc-panel-WARNING **: Could not parse format '%Y.%d.%m'

That warning is for ce_RU.utf8 which is bug 749438, so let's ignore it here.

Now:

    $ grep --text '%A, %B %d, %Y' locales-endianess
    en_HK.utf8		%A, %B %d, %Y		Middle (MM-DD-YYYY)

So only en_HK is in this case.

I've made a simple change to fix this issue, which has no impact on other locales, afaics:

    $ diff -u locales-endianess.before locales-endianess
    --- locales-endianess.before	2015-06-11 18:00:36.300546283 +0200
    +++ locales-endianess	2015-06-11 18:04:37.694139973 +0200
    @@ -74,7 +74,7 @@
     en_CA.utf8		%d/%m/%y		Little (DD-MM-YYYY)
     en_DK.utf8		%Y-%m-%d		Big (YYYY-MM-DD)
     en_GB.utf8		%d/%m/%y		Little (DD-MM-YYYY)
    -en_HK.utf8		%A, %B %d, %Y		Middle (MM-DD-YYYY)
    +en_HK.utf8		%A, %B %d, %Y		Little (DD-MM-YYYY)
     en_IE.utf8		%d/%m/%y		Little (DD-MM-YYYY)
     en_IN.utf8		%A %d %B %Y		Little (DD-MM-YYYY)
     en_NG.utf8		%d/%m/%Y		Little (DD-MM-YYYY)

Note that I'm only considering utf8 locales.

Patch is coming.
Comment 2 Mathieu Bridon 2015-06-11 16:10:46 UTC
Created attachment 305080 [details] [review]
datetime: Fix date endianess for en_HK
Comment 3 Bastien Nocera 2015-06-12 11:35:05 UTC
Review of attachment 305080 [details] [review]:

Can you please add some explanations in the body of the commit? Looks fine otherwise.
Comment 4 Mathieu Bridon 2015-06-15 15:31:50 UTC
Created attachment 305312 [details] [review]
datetime: Fix date endianess for en_HK

Hong Kong people expect to use a little endian date in English. (and a
big endian date in Chinese)

The D_FMT format string for en_HK is '%A, %B %d, %Y', which the current
code parses as middle endian.

This commit makes the code parse it as little endian, that is it doesn't
ignore the %A formatter any more.

en_HK is the only UTF-8 locale with this D_FMT format string, so this
shouldn't change anything for other locales.
Comment 5 Bastien Nocera 2015-06-15 22:13:04 UTC
Review of attachment 305312 [details] [review]:

Looks good!
Comment 6 Mathieu Bridon 2015-06-16 07:18:44 UTC
Attachment 305312 [details] pushed as 623abfb - datetime: Fix date endianess for en_HK