[glom/glom-1-18] Add a test for date presentation and parsing in various locales.



commit 7b9dbf8a7c46fbdfd91c511b17855214c92df825
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Nov 16 22:45:07 2011 +0100

    Add a test for date presentation and parsing in various locales.
    
    * Makefile_tests.am:
    * tests/test_glom_date_in_locales.sh: I don't like requiring
    installation of these locales during make check, but I see no other
    way to stop the fixes from being lost by careless translators, at
    least of the major languages.

 ChangeLog                          |   10 ++++++++++
 Makefile_tests.am                  |    7 ++++++-
 tests/test_glom_date_in_locales.sh |   21 +++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 64a8d3b..baf5665 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-11-16  Murray Cumming  <murrayc murrayc com>
+
+	Add a test for date presentation and parsing in various locales.
+
+	* Makefile_tests.am:
+	* tests/test_glom_date_in_locales.sh: I don't like requiring 
+	installation of these locales during make check, but I see no other
+	way to stop the fixes from being lost by careless translators, at 
+	least of the major languages.
+
 1.18.6:
 
 2011-11-16  Murray Cumming  <murrayc murrayc com>
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 7e8b1df..331f648 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -15,6 +15,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Note that test_glom_date_in_locales.sh requires us to have certain locales 
+# installed and configured.
+
 check_PROGRAMS =						\
 	glom/libglom/test_connectionpool			\
 	glom/libglom/example_document_load \
@@ -36,6 +39,7 @@ TESTS =	tests/test_document_load	\
 	tests/test_signal_reemit \
 	tests/test_dtd_file_validation.sh \
 	tests/test_glade_file_validation.sh \
+	tests/test_glom_date_in_locales.sh \
 	tests/python/test_load_python_library \
 	tests/python/test_python_module \
 	tests/test_selfhosting_new_empty \
@@ -47,7 +51,8 @@ TESTS =	tests/test_document_load	\
 # but this is the first use, where we must use =
 dist_noinst_SCRIPTS = tests/test_dtd_file_validation.sh \
 	tests/test_glade_file_validation.sh \
-	tests/test_glade_toplevels_instantiation.sh
+	tests/test_glade_toplevels_instantiation.sh \
+	tests/test_glom_date_in_locales.sh
 
 #TESTS_ENVIRONMENT=which valgrind && valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=30
 
diff --git a/tests/test_glom_date_in_locales.sh b/tests/test_glom_date_in_locales.sh
new file mode 100755
index 0000000..d0a64f7
--- /dev/null
+++ b/tests/test_glom_date_in_locales.sh
@@ -0,0 +1,21 @@
+#/bin/sh -e
+
+# This test checks that dates are presented and interpreted correctly.
+# That sometimes requires a translation of the %x date format in the .po file,
+# and that translation is often lost accidentally
+#
+# This test requires these locales to be installed and configured.
+# That might be a problem on some systems, so feel free to use a patch to edit this file or disable it altogether.
+#
+# These are chosen based on problems found previously,
+# and the ones with good translations shown here: http://l10n.gnome.org/module/glom/
+#TODO: Get a list from po/*.po ?
+#These are apparently not available on Fedora:  "da_DA.UTF-8" "cs_CZ.UTF-8" "nb_NO.UTF-8" "sv_SE.UTF-8"
+locales=("en_US.UTF-8" "en_GB.UTF-8" "en_CA.UTF-8" "de_DE.UTF-8" "es_ES.UTF-8" "fi_FI.UTF-8" "fr_FR.UTF-8" "hu_HU.UTF-8" "it_IT.UTF-8" "pt_PT.UTF-8" "pt_BR.UTF-8" "sl_SI.UTF-8")
+
+for x in "${locales[ ]}"
+do
+  echo testing with LANG="$x"
+  export LANG="$x"
+  ${buildir}glom --debug-date-check || exit 1
+done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]