GNOME Bugzilla – Bug 742968
Date format check fails when using mixed locales
Last modified: 2015-01-16 08:34:19 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).
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.)