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 742968 - Date format check fails when using mixed locales
Date format check fails when using mixed locales
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2015-01-15 12:24 UTC by Murray Cumming
Modified: 2015-01-16 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2015-01-15 12:24:48 UTC
When using, for instance LC_TIME="es_ES.UTF-8" when LANG is set to "en_US.UTF-8", the date check fails, though it works if both are set to the same value.

For instance:
[murrayc@murrayc-ThinkPad-X220 ~]$ env | grep "LANG"
LANG=en_US.UTF-8
GDM_LANG=en_US
[murrayc@murrayc-ThinkPad-X220 ~]$ env | grep "LC_"
LC_PAPER=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_NAME=en_US.UTF-8
[murrayc@murrayc-ThinkPad-X220 ~]$ 
[murrayc@murrayc-ThinkPad-X220 ~]$ glom --debug-date-check
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
DEBUG: 22nd November 2008 in this locale (en_US.UTF-8) has this text represention: 11/22/2008
[murrayc@murrayc-ThinkPad-X220 ~]$ 
[murrayc@murrayc-ThinkPad-X220 ~]$ export LC_TIME="es_ES.UTF-8"
[murrayc@murrayc-ThinkPad-X220 ~]$ 
[murrayc@murrayc-ThinkPad-X220 ~]$ glom --debug-date-check
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
DEBUG: 22nd November 2008 in this locale (LC_CTYPE=en_US.UTF-8;LC_NUMERIC=en_US.UTF-8;LC_TIME=es_ES.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8;LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=en_US.UTF-8) has this text represention: 22/11/08
ERROR: sanity_check_date_text_representation_uses_4_digit_year(): Sanity check failed: Glom does not seem to use 4 digits to display years in a date's text representation, in this locale. Defaulting to dd/mm/yyyy though this might be incorrect for your locale. This needs attention from a translator. Please file a bug - see http://www.glom.org
  Unexpected date text: 22/11/08
  Current locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=en_US.UTF-8;LC_TIME=es_ES.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8;LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=en_US.UTF-8
bool Glom::LocalOptionGroup::handle_options(): Glom: ERROR: Date presentation sanity checks failed. Glom will not display dates correctly. This needs attention from a translator. Please file a bug. See http://www.glom.org.
[murrayc@murrayc-ThinkPad-X220 ~]$ 
[murrayc@murrayc-ThinkPad-X220 ~]$ export LANG="es_ES.UTF-8"
[murrayc@murrayc-ThinkPad-X220 ~]$ 
[murrayc@murrayc-ThinkPad-X220 ~]$ glom --debug-date-check
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
DEBUG: 22nd November 2008 in this locale (LC_CTYPE=es_ES.UTF-8;LC_NUMERIC=en_US.UTF-8;LC_TIME=es_ES.UTF-8;LC_COLLATE=es_ES.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=es_ES.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8;LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=en_US.UTF-8) has this text represention: 22/11/2008


This is probably because Spanish needs to use the "%X" translation (see po/es.po), because the default %X doesn't use 4-digit years. But we use gettext() to get that translation, which uses just the general locale instead of LC_TIME (or LC_NUMERIC, which some Glom code comments mention).
Comment 1 Murray Cumming 2015-01-16 08:34:19 UTC
Fixed by this commit, I believe:
https://git.gnome.org/browse/glom/commit/?id=a9c730541705fbbbe90ee6333d090927c47c6e5c
(The subsequent commit corrects the comment in the .sh.in file.)