GNOME Bugzilla – Bug 750781
en_HK date endianess is incorrect
Last modified: 2015-06-16 07:18:44 UTC
$ ./test-endianess en_HK %A, %B %d, %Y Middle (MM-DD-YYYY) Should be LITTLE endian instead.
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.
Created attachment 305080 [details] [review] datetime: Fix date endianess for en_HK
Review of attachment 305080 [details] [review]: Can you please add some explanations in the body of the commit? Looks fine otherwise.
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.
Review of attachment 305312 [details] [review]: Looks good!
Attachment 305312 [details] pushed as 623abfb - datetime: Fix date endianess for en_HK